@itwin/core-geometry 5.3.0-dev.16 → 5.3.0-dev.18

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 (536) hide show
  1. package/CHANGELOG.md +6 -1
  2. package/lib/cjs/Constant.js.map +1 -1
  3. package/lib/cjs/Geometry.js.map +1 -1
  4. package/lib/cjs/bspline/AkimaCurve3d.js.map +1 -1
  5. package/lib/cjs/bspline/BSpline1dNd.js.map +1 -1
  6. package/lib/cjs/bspline/BSplineCurve.js.map +1 -1
  7. package/lib/cjs/bspline/BSplineCurve3dH.js.map +1 -1
  8. package/lib/cjs/bspline/BSplineCurveOps.js.map +1 -1
  9. package/lib/cjs/bspline/BSplineSurface.js.map +1 -1
  10. package/lib/cjs/bspline/Bezier1dNd.js.map +1 -1
  11. package/lib/cjs/bspline/BezierCurve3d.js.map +1 -1
  12. package/lib/cjs/bspline/BezierCurve3dH.js.map +1 -1
  13. package/lib/cjs/bspline/BezierCurveBase.js.map +1 -1
  14. package/lib/cjs/bspline/InterpolationCurve3d.js.map +1 -1
  15. package/lib/cjs/bspline/KnotVector.js.map +1 -1
  16. package/lib/cjs/bspline/SurfaceLocationDetail.js.map +1 -1
  17. package/lib/cjs/clipping/AlternatingConvexClipTree.js.map +1 -1
  18. package/lib/cjs/clipping/BooleanClipFactory.js.map +1 -1
  19. package/lib/cjs/clipping/BooleanClipNode.js.map +1 -1
  20. package/lib/cjs/clipping/ClipPlane.js.map +1 -1
  21. package/lib/cjs/clipping/ClipPrimitive.js.map +1 -1
  22. package/lib/cjs/clipping/ClipUtils.js.map +1 -1
  23. package/lib/cjs/clipping/ClipVector.js.map +1 -1
  24. package/lib/cjs/clipping/ConvexClipPlaneSet.js.map +1 -1
  25. package/lib/cjs/clipping/UnionOfConvexClipPlaneSets.js.map +1 -1
  26. package/lib/cjs/clipping/internalContexts/LineStringOffsetClipperContext.js.map +1 -1
  27. package/lib/cjs/core-geometry.js.map +1 -1
  28. package/lib/cjs/curve/Arc3d.d.ts +15 -1
  29. package/lib/cjs/curve/Arc3d.d.ts.map +1 -1
  30. package/lib/cjs/curve/Arc3d.js +31 -2
  31. package/lib/cjs/curve/Arc3d.js.map +1 -1
  32. package/lib/cjs/curve/ConstructCurveBetweenCurves.js.map +1 -1
  33. package/lib/cjs/curve/CoordinateXYZ.js.map +1 -1
  34. package/lib/cjs/curve/CurveChainWithDistanceIndex.js.map +1 -1
  35. package/lib/cjs/curve/CurveCollection.js.map +1 -1
  36. package/lib/cjs/curve/CurveCurve.js.map +1 -1
  37. package/lib/cjs/curve/CurveExtendMode.js.map +1 -1
  38. package/lib/cjs/curve/CurveFactory.js.map +1 -1
  39. package/lib/cjs/curve/CurveLocationDetail.js.map +1 -1
  40. package/lib/cjs/curve/CurveOps.js.map +1 -1
  41. package/lib/cjs/curve/CurvePrimitive.js.map +1 -1
  42. package/lib/cjs/curve/CurveProcessor.js.map +1 -1
  43. package/lib/cjs/curve/CurveTypes.js.map +1 -1
  44. package/lib/cjs/curve/CurveWireMomentsXYZ.js.map +1 -1
  45. package/lib/cjs/curve/GeometryQuery.js.map +1 -1
  46. package/lib/cjs/curve/LineSegment3d.js.map +1 -1
  47. package/lib/cjs/curve/LineString3d.js.map +1 -1
  48. package/lib/cjs/curve/Loop.js.map +1 -1
  49. package/lib/cjs/curve/OffsetOptions.js.map +1 -1
  50. package/lib/cjs/curve/ParityRegion.js.map +1 -1
  51. package/lib/cjs/curve/Path.js.map +1 -1
  52. package/lib/cjs/curve/PointString3d.js.map +1 -1
  53. package/lib/cjs/curve/ProxyCurve.js.map +1 -1
  54. package/lib/cjs/curve/Query/ConsolidateAdjacentPrimitivesContext.js.map +1 -1
  55. package/lib/cjs/curve/Query/CurveSplitContext.js.map +1 -1
  56. package/lib/cjs/curve/Query/CylindricalRange.js.map +1 -1
  57. package/lib/cjs/curve/Query/InOutTests.js.map +1 -1
  58. package/lib/cjs/curve/Query/PlanarSubdivision.js.map +1 -1
  59. package/lib/cjs/curve/Query/StrokeCountChain.js.map +1 -1
  60. package/lib/cjs/curve/Query/StrokeCountMap.js.map +1 -1
  61. package/lib/cjs/curve/RegionMomentsXY.js.map +1 -1
  62. package/lib/cjs/curve/RegionOps.js.map +1 -1
  63. package/lib/cjs/curve/RegionOpsClassificationSweeps.js.map +1 -1
  64. package/lib/cjs/curve/StrokeOptions.js.map +1 -1
  65. package/lib/cjs/curve/UnionRegion.js.map +1 -1
  66. package/lib/cjs/curve/internalContexts/AnnounceTangentStrokeHandler.js.map +1 -1
  67. package/lib/cjs/curve/internalContexts/AppendPlaneIntersectionStrokeHandler.js.map +1 -1
  68. package/lib/cjs/curve/internalContexts/ChainCollectorContext.js.map +1 -1
  69. package/lib/cjs/curve/internalContexts/CloneCurvesContext.js.map +1 -1
  70. package/lib/cjs/curve/internalContexts/CloneWithExpandedLineStrings.js.map +1 -1
  71. package/lib/cjs/curve/internalContexts/ClosestPointStrokeHandler.js.map +1 -1
  72. package/lib/cjs/curve/internalContexts/CountLinearPartsSearchContext.js.map +1 -1
  73. package/lib/cjs/curve/internalContexts/CurveCurveCloseApproachXY.js.map +1 -1
  74. package/lib/cjs/curve/internalContexts/CurveCurveIntersectXY.js.map +1 -1
  75. package/lib/cjs/curve/internalContexts/CurveCurveIntersectXYZ.js.map +1 -1
  76. package/lib/cjs/curve/internalContexts/CurveLengthContext.js.map +1 -1
  77. package/lib/cjs/curve/internalContexts/CurveOffsetXYHandler.js.map +1 -1
  78. package/lib/cjs/curve/internalContexts/EllipticalArcApproximationContext.js.map +1 -1
  79. package/lib/cjs/curve/internalContexts/GapSearchContext.js.map +1 -1
  80. package/lib/cjs/curve/internalContexts/MultiChainCollector.js.map +1 -1
  81. package/lib/cjs/curve/internalContexts/NewtonRtoRStrokeHandler.js.map +1 -1
  82. package/lib/cjs/curve/internalContexts/PlaneAltitudeRangeContext.js.map +1 -1
  83. package/lib/cjs/curve/internalContexts/PolygonOffsetContext.js.map +1 -1
  84. package/lib/cjs/curve/internalContexts/SumLengthsContext.js.map +1 -1
  85. package/lib/cjs/curve/internalContexts/TransferWithSplitArcs.js.map +1 -1
  86. package/lib/cjs/curve/internalContexts/TransformInPlaceContext.js.map +1 -1
  87. package/lib/cjs/curve/spiral/AustralianRailCorpXYEvaluator.d.ts +10 -13
  88. package/lib/cjs/curve/spiral/AustralianRailCorpXYEvaluator.d.ts.map +1 -1
  89. package/lib/cjs/curve/spiral/AustralianRailCorpXYEvaluator.js +23 -22
  90. package/lib/cjs/curve/spiral/AustralianRailCorpXYEvaluator.js.map +1 -1
  91. package/lib/cjs/curve/spiral/ClothoidSeries.d.ts +5 -5
  92. package/lib/cjs/curve/spiral/ClothoidSeries.d.ts.map +1 -1
  93. package/lib/cjs/curve/spiral/ClothoidSeries.js +28 -16
  94. package/lib/cjs/curve/spiral/ClothoidSeries.js.map +1 -1
  95. package/lib/cjs/curve/spiral/CubicEvaluator.d.ts +7 -6
  96. package/lib/cjs/curve/spiral/CubicEvaluator.d.ts.map +1 -1
  97. package/lib/cjs/curve/spiral/CubicEvaluator.js +29 -14
  98. package/lib/cjs/curve/spiral/CubicEvaluator.js.map +1 -1
  99. package/lib/cjs/curve/spiral/CzechSpiralEvaluator.d.ts +30 -40
  100. package/lib/cjs/curve/spiral/CzechSpiralEvaluator.d.ts.map +1 -1
  101. package/lib/cjs/curve/spiral/CzechSpiralEvaluator.js +43 -49
  102. package/lib/cjs/curve/spiral/CzechSpiralEvaluator.js.map +1 -1
  103. package/lib/cjs/curve/spiral/DirectHalfCosineSpiralEvaluator.d.ts +2 -2
  104. package/lib/cjs/curve/spiral/DirectHalfCosineSpiralEvaluator.d.ts.map +1 -1
  105. package/lib/cjs/curve/spiral/DirectHalfCosineSpiralEvaluator.js +17 -7
  106. package/lib/cjs/curve/spiral/DirectHalfCosineSpiralEvaluator.js.map +1 -1
  107. package/lib/cjs/curve/spiral/DirectSpiral3d.d.ts +103 -95
  108. package/lib/cjs/curve/spiral/DirectSpiral3d.d.ts.map +1 -1
  109. package/lib/cjs/curve/spiral/DirectSpiral3d.js +132 -106
  110. package/lib/cjs/curve/spiral/DirectSpiral3d.js.map +1 -1
  111. package/lib/cjs/curve/spiral/IntegratedSpiral3d.d.ts +70 -52
  112. package/lib/cjs/curve/spiral/IntegratedSpiral3d.d.ts.map +1 -1
  113. package/lib/cjs/curve/spiral/IntegratedSpiral3d.js +97 -65
  114. package/lib/cjs/curve/spiral/IntegratedSpiral3d.js.map +1 -1
  115. package/lib/cjs/curve/spiral/MXCubicAlongArcSpiralEvaluator.d.ts +7 -11
  116. package/lib/cjs/curve/spiral/MXCubicAlongArcSpiralEvaluator.d.ts.map +1 -1
  117. package/lib/cjs/curve/spiral/MXCubicAlongArcSpiralEvaluator.js +10 -12
  118. package/lib/cjs/curve/spiral/MXCubicAlongArcSpiralEvaluator.js.map +1 -1
  119. package/lib/cjs/curve/spiral/NormalizedTransition.d.ts +29 -24
  120. package/lib/cjs/curve/spiral/NormalizedTransition.d.ts.map +1 -1
  121. package/lib/cjs/curve/spiral/NormalizedTransition.js +53 -35
  122. package/lib/cjs/curve/spiral/NormalizedTransition.js.map +1 -1
  123. package/lib/cjs/curve/spiral/PolishCubicSpiralEvaluator.d.ts +12 -17
  124. package/lib/cjs/curve/spiral/PolishCubicSpiralEvaluator.d.ts.map +1 -1
  125. package/lib/cjs/curve/spiral/PolishCubicSpiralEvaluator.js +20 -23
  126. package/lib/cjs/curve/spiral/PolishCubicSpiralEvaluator.js.map +1 -1
  127. package/lib/cjs/curve/spiral/TransitionConditionalProperties.d.ts +25 -23
  128. package/lib/cjs/curve/spiral/TransitionConditionalProperties.d.ts.map +1 -1
  129. package/lib/cjs/curve/spiral/TransitionConditionalProperties.js +34 -29
  130. package/lib/cjs/curve/spiral/TransitionConditionalProperties.js.map +1 -1
  131. package/lib/cjs/curve/spiral/TransitionSpiral3d.d.ts +43 -33
  132. package/lib/cjs/curve/spiral/TransitionSpiral3d.d.ts.map +1 -1
  133. package/lib/cjs/curve/spiral/TransitionSpiral3d.js +56 -38
  134. package/lib/cjs/curve/spiral/TransitionSpiral3d.js.map +1 -1
  135. package/lib/cjs/curve/spiral/XYCurveEvaluator.d.ts +27 -21
  136. package/lib/cjs/curve/spiral/XYCurveEvaluator.d.ts.map +1 -1
  137. package/lib/cjs/curve/spiral/XYCurveEvaluator.js +23 -18
  138. package/lib/cjs/curve/spiral/XYCurveEvaluator.js.map +1 -1
  139. package/lib/cjs/geometry3d/Angle.js.map +1 -1
  140. package/lib/cjs/geometry3d/AngleSweep.js.map +1 -1
  141. package/lib/cjs/geometry3d/BarycentricTriangle.js.map +1 -1
  142. package/lib/cjs/geometry3d/BilinearPatch.js.map +1 -1
  143. package/lib/cjs/geometry3d/CoincidentGeometryOps.js.map +1 -1
  144. package/lib/cjs/geometry3d/Ellipsoid.js.map +1 -1
  145. package/lib/cjs/geometry3d/FrameBuilder.js.map +1 -1
  146. package/lib/cjs/geometry3d/FrustumAnimation.js.map +1 -1
  147. package/lib/cjs/geometry3d/GeometryHandler.js.map +1 -1
  148. package/lib/cjs/geometry3d/GrowableBlockedArray.js.map +1 -1
  149. package/lib/cjs/geometry3d/GrowableFloat64Array.js.map +1 -1
  150. package/lib/cjs/geometry3d/GrowableXYArray.js.map +1 -1
  151. package/lib/cjs/geometry3d/GrowableXYZArray.js.map +1 -1
  152. package/lib/cjs/geometry3d/IndexedCollectionInterval.js.map +1 -1
  153. package/lib/cjs/geometry3d/IndexedXYCollection.js.map +1 -1
  154. package/lib/cjs/geometry3d/IndexedXYZCollection.js.map +1 -1
  155. package/lib/cjs/geometry3d/LongitudeLatitudeAltitude.js.map +1 -1
  156. package/lib/cjs/geometry3d/Matrix3d.js.map +1 -1
  157. package/lib/cjs/geometry3d/OrderedRotationAngles.js.map +1 -1
  158. package/lib/cjs/geometry3d/Plane3d.js.map +1 -1
  159. package/lib/cjs/geometry3d/Plane3dByOriginAndUnitNormal.js.map +1 -1
  160. package/lib/cjs/geometry3d/Plane3dByOriginAndVectors.js.map +1 -1
  161. package/lib/cjs/geometry3d/Point2dArrayCarrier.js.map +1 -1
  162. package/lib/cjs/geometry3d/Point2dVector2d.js.map +1 -1
  163. package/lib/cjs/geometry3d/Point3dArrayCarrier.js.map +1 -1
  164. package/lib/cjs/geometry3d/Point3dVector3d.js.map +1 -1
  165. package/lib/cjs/geometry3d/PointHelpers.js.map +1 -1
  166. package/lib/cjs/geometry3d/PointStreaming.js.map +1 -1
  167. package/lib/cjs/geometry3d/PolygonOps.js.map +1 -1
  168. package/lib/cjs/geometry3d/PolylineCompressionByEdgeOffset.js.map +1 -1
  169. package/lib/cjs/geometry3d/PolylineOps.js.map +1 -1
  170. package/lib/cjs/geometry3d/Range.js.map +1 -1
  171. package/lib/cjs/geometry3d/Ray2d.js.map +1 -1
  172. package/lib/cjs/geometry3d/Ray3d.js.map +1 -1
  173. package/lib/cjs/geometry3d/ReusableObjectCache.js.map +1 -1
  174. package/lib/cjs/geometry3d/Segment1d.js.map +1 -1
  175. package/lib/cjs/geometry3d/SortablePolygon.js.map +1 -1
  176. package/lib/cjs/geometry3d/Transform.js.map +1 -1
  177. package/lib/cjs/geometry3d/UVSurfaceOps.js.map +1 -1
  178. package/lib/cjs/geometry3d/XYZProps.js.map +1 -1
  179. package/lib/cjs/geometry3d/YawPitchRollAngles.js.map +1 -1
  180. package/lib/cjs/geometry4d/Map4d.js.map +1 -1
  181. package/lib/cjs/geometry4d/Matrix4d.js.map +1 -1
  182. package/lib/cjs/geometry4d/MomentData.js.map +1 -1
  183. package/lib/cjs/geometry4d/PlaneByOriginAndVectors4d.js.map +1 -1
  184. package/lib/cjs/geometry4d/Point4d.js.map +1 -1
  185. package/lib/cjs/numerics/BandedSystem.js.map +1 -1
  186. package/lib/cjs/numerics/BezierPolynomials.js.map +1 -1
  187. package/lib/cjs/numerics/ClusterableArray.js.map +1 -1
  188. package/lib/cjs/numerics/Complex.js.map +1 -1
  189. package/lib/cjs/numerics/ConvexPolygon2d.js.map +1 -1
  190. package/lib/cjs/numerics/Newton.js.map +1 -1
  191. package/lib/cjs/numerics/PascalCoefficients.js.map +1 -1
  192. package/lib/cjs/numerics/PolarData.js.map +1 -1
  193. package/lib/cjs/numerics/Polynomials.js.map +1 -1
  194. package/lib/cjs/numerics/Quadrature.js.map +1 -1
  195. package/lib/cjs/numerics/Range1dArray.js.map +1 -1
  196. package/lib/cjs/numerics/SmallSystem.js.map +1 -1
  197. package/lib/cjs/numerics/TriDiagonalSystem.js.map +1 -1
  198. package/lib/cjs/numerics/UnionFind.js.map +1 -1
  199. package/lib/cjs/numerics/UsageSums.js.map +1 -1
  200. package/lib/cjs/polyface/AuxData.js.map +1 -1
  201. package/lib/cjs/polyface/BoxTopology.js.map +1 -1
  202. package/lib/cjs/polyface/FacetFaceData.js.map +1 -1
  203. package/lib/cjs/polyface/FacetLocationDetail.js.map +1 -1
  204. package/lib/cjs/polyface/FacetOrientation.js.map +1 -1
  205. package/lib/cjs/polyface/GreedyTriangulationBetweenLineStrings.js.map +1 -1
  206. package/lib/cjs/polyface/IndexedEdgeMatcher.js.map +1 -1
  207. package/lib/cjs/polyface/IndexedPolyfaceVisitor.js.map +1 -1
  208. package/lib/cjs/polyface/IndexedPolyfaceWalker.js.map +1 -1
  209. package/lib/cjs/polyface/Polyface.js.map +1 -1
  210. package/lib/cjs/polyface/PolyfaceBuilder.js.map +1 -1
  211. package/lib/cjs/polyface/PolyfaceClip.js.map +1 -1
  212. package/lib/cjs/polyface/PolyfaceData.js.map +1 -1
  213. package/lib/cjs/polyface/PolyfaceQuery.js.map +1 -1
  214. package/lib/cjs/polyface/RangeLengthData.js.map +1 -1
  215. package/lib/cjs/polyface/RangeTree/LineString3dRangeTreeContext.js.map +1 -1
  216. package/lib/cjs/polyface/RangeTree/MinimumValueTester.js.map +1 -1
  217. package/lib/cjs/polyface/RangeTree/Point3dArrayRangeTreeContext.js.map +1 -1
  218. package/lib/cjs/polyface/RangeTree/PolyfaceRangeTreeContext.js.map +1 -1
  219. package/lib/cjs/polyface/RangeTree/RangeTreeNode.js.map +1 -1
  220. package/lib/cjs/polyface/RangeTree/RangeTreeSearchHandlers.js.map +1 -1
  221. package/lib/cjs/polyface/TaggedNumericData.js.map +1 -1
  222. package/lib/cjs/polyface/TriangleCandidate.js.map +1 -1
  223. package/lib/cjs/polyface/multiclip/BuildAverageNormalsContext.js.map +1 -1
  224. package/lib/cjs/polyface/multiclip/GriddedRaggedRange2dSet.js.map +1 -1
  225. package/lib/cjs/polyface/multiclip/GriddedRaggedRange2dSetWithOverflow.js.map +1 -1
  226. package/lib/cjs/polyface/multiclip/LinearSearchRange2dArray.js.map +1 -1
  227. package/lib/cjs/polyface/multiclip/OffsetMeshContext.js.map +1 -1
  228. package/lib/cjs/polyface/multiclip/Range2dSearchInterface.js.map +1 -1
  229. package/lib/cjs/polyface/multiclip/RangeSearch.js.map +1 -1
  230. package/lib/cjs/polyface/multiclip/SweepLineStringToFacetContext.js.map +1 -1
  231. package/lib/cjs/polyface/multiclip/XYPointBuckets.js.map +1 -1
  232. package/lib/cjs/serialization/BGFBAccessors.js.map +1 -1
  233. package/lib/cjs/serialization/BGFBReader.js.map +1 -1
  234. package/lib/cjs/serialization/BGFBWriter.js.map +1 -1
  235. package/lib/cjs/serialization/BentleyGeometryFlatBuffer.js.map +1 -1
  236. package/lib/cjs/serialization/DeepCompare.js.map +1 -1
  237. package/lib/cjs/serialization/GeometrySamples.js.map +1 -1
  238. package/lib/cjs/serialization/IModelJsonSchema.js.map +1 -1
  239. package/lib/cjs/serialization/SerializationHelpers.js.map +1 -1
  240. package/lib/cjs/solid/Box.js.map +1 -1
  241. package/lib/cjs/solid/Cone.js.map +1 -1
  242. package/lib/cjs/solid/LinearSweep.js.map +1 -1
  243. package/lib/cjs/solid/RotationalSweep.js.map +1 -1
  244. package/lib/cjs/solid/RuledSweep.js.map +1 -1
  245. package/lib/cjs/solid/SolidPrimitive.js.map +1 -1
  246. package/lib/cjs/solid/Sphere.js.map +1 -1
  247. package/lib/cjs/solid/SweepContour.js.map +1 -1
  248. package/lib/cjs/solid/TorusPipe.js.map +1 -1
  249. package/lib/cjs/topology/ChainMerge.js.map +1 -1
  250. package/lib/cjs/topology/Graph.js.map +1 -1
  251. package/lib/cjs/topology/HalfEdgeGraphFromIndexedLoopsContext.js.map +1 -1
  252. package/lib/cjs/topology/HalfEdgeGraphSearch.js.map +1 -1
  253. package/lib/cjs/topology/HalfEdgeGraphSpineContext.js.map +1 -1
  254. package/lib/cjs/topology/HalfEdgeGraphValidation.js.map +1 -1
  255. package/lib/cjs/topology/HalfEdgeMarkSet.js.map +1 -1
  256. package/lib/cjs/topology/HalfEdgeNodeXYZUV.js.map +1 -1
  257. package/lib/cjs/topology/HalfEdgePointInGraphSearch.js.map +1 -1
  258. package/lib/cjs/topology/HalfEdgePositionDetail.js.map +1 -1
  259. package/lib/cjs/topology/HalfEdgePriorityQueue.js.map +1 -1
  260. package/lib/cjs/topology/InsertAndRetriangulateContext.js.map +1 -1
  261. package/lib/cjs/topology/MaskManager.js.map +1 -1
  262. package/lib/cjs/topology/Merging.js.map +1 -1
  263. package/lib/cjs/topology/RegularizeFace.js.map +1 -1
  264. package/lib/cjs/topology/SignedDataSummary.js.map +1 -1
  265. package/lib/cjs/topology/SpaceTriangulation.js.map +1 -1
  266. package/lib/cjs/topology/Triangulation.js.map +1 -1
  267. package/lib/cjs/topology/Voronoi.js.map +1 -1
  268. package/lib/cjs/topology/XYParitySearchContext.js.map +1 -1
  269. package/lib/esm/Constant.js.map +1 -1
  270. package/lib/esm/Geometry.js.map +1 -1
  271. package/lib/esm/bspline/AkimaCurve3d.js.map +1 -1
  272. package/lib/esm/bspline/BSpline1dNd.js.map +1 -1
  273. package/lib/esm/bspline/BSplineCurve.js.map +1 -1
  274. package/lib/esm/bspline/BSplineCurve3dH.js.map +1 -1
  275. package/lib/esm/bspline/BSplineCurveOps.js.map +1 -1
  276. package/lib/esm/bspline/BSplineSurface.js.map +1 -1
  277. package/lib/esm/bspline/Bezier1dNd.js.map +1 -1
  278. package/lib/esm/bspline/BezierCurve3d.js.map +1 -1
  279. package/lib/esm/bspline/BezierCurve3dH.js.map +1 -1
  280. package/lib/esm/bspline/BezierCurveBase.js.map +1 -1
  281. package/lib/esm/bspline/InterpolationCurve3d.js.map +1 -1
  282. package/lib/esm/bspline/KnotVector.js.map +1 -1
  283. package/lib/esm/bspline/SurfaceLocationDetail.js.map +1 -1
  284. package/lib/esm/clipping/AlternatingConvexClipTree.js.map +1 -1
  285. package/lib/esm/clipping/BooleanClipFactory.js.map +1 -1
  286. package/lib/esm/clipping/BooleanClipNode.js.map +1 -1
  287. package/lib/esm/clipping/ClipPlane.js.map +1 -1
  288. package/lib/esm/clipping/ClipPrimitive.js.map +1 -1
  289. package/lib/esm/clipping/ClipUtils.js.map +1 -1
  290. package/lib/esm/clipping/ClipVector.js.map +1 -1
  291. package/lib/esm/clipping/ConvexClipPlaneSet.js.map +1 -1
  292. package/lib/esm/clipping/UnionOfConvexClipPlaneSets.js.map +1 -1
  293. package/lib/esm/clipping/internalContexts/LineStringOffsetClipperContext.js.map +1 -1
  294. package/lib/esm/core-geometry.js.map +1 -1
  295. package/lib/esm/curve/Arc3d.d.ts +15 -1
  296. package/lib/esm/curve/Arc3d.d.ts.map +1 -1
  297. package/lib/esm/curve/Arc3d.js +31 -2
  298. package/lib/esm/curve/Arc3d.js.map +1 -1
  299. package/lib/esm/curve/ConstructCurveBetweenCurves.js.map +1 -1
  300. package/lib/esm/curve/CoordinateXYZ.js.map +1 -1
  301. package/lib/esm/curve/CurveChainWithDistanceIndex.js.map +1 -1
  302. package/lib/esm/curve/CurveCollection.js.map +1 -1
  303. package/lib/esm/curve/CurveCurve.js.map +1 -1
  304. package/lib/esm/curve/CurveExtendMode.js.map +1 -1
  305. package/lib/esm/curve/CurveFactory.js.map +1 -1
  306. package/lib/esm/curve/CurveLocationDetail.js.map +1 -1
  307. package/lib/esm/curve/CurveOps.js.map +1 -1
  308. package/lib/esm/curve/CurvePrimitive.js.map +1 -1
  309. package/lib/esm/curve/CurveProcessor.js.map +1 -1
  310. package/lib/esm/curve/CurveTypes.js.map +1 -1
  311. package/lib/esm/curve/CurveWireMomentsXYZ.js.map +1 -1
  312. package/lib/esm/curve/GeometryQuery.js.map +1 -1
  313. package/lib/esm/curve/LineSegment3d.js.map +1 -1
  314. package/lib/esm/curve/LineString3d.js.map +1 -1
  315. package/lib/esm/curve/Loop.js.map +1 -1
  316. package/lib/esm/curve/OffsetOptions.js.map +1 -1
  317. package/lib/esm/curve/ParityRegion.js.map +1 -1
  318. package/lib/esm/curve/Path.js.map +1 -1
  319. package/lib/esm/curve/PointString3d.js.map +1 -1
  320. package/lib/esm/curve/ProxyCurve.js.map +1 -1
  321. package/lib/esm/curve/Query/ConsolidateAdjacentPrimitivesContext.js.map +1 -1
  322. package/lib/esm/curve/Query/CurveSplitContext.js.map +1 -1
  323. package/lib/esm/curve/Query/CylindricalRange.js.map +1 -1
  324. package/lib/esm/curve/Query/InOutTests.js.map +1 -1
  325. package/lib/esm/curve/Query/PlanarSubdivision.js.map +1 -1
  326. package/lib/esm/curve/Query/StrokeCountChain.js.map +1 -1
  327. package/lib/esm/curve/Query/StrokeCountMap.js.map +1 -1
  328. package/lib/esm/curve/RegionMomentsXY.js.map +1 -1
  329. package/lib/esm/curve/RegionOps.js.map +1 -1
  330. package/lib/esm/curve/RegionOpsClassificationSweeps.js.map +1 -1
  331. package/lib/esm/curve/StrokeOptions.js.map +1 -1
  332. package/lib/esm/curve/UnionRegion.js.map +1 -1
  333. package/lib/esm/curve/internalContexts/AnnounceTangentStrokeHandler.js.map +1 -1
  334. package/lib/esm/curve/internalContexts/AppendPlaneIntersectionStrokeHandler.js.map +1 -1
  335. package/lib/esm/curve/internalContexts/ChainCollectorContext.js.map +1 -1
  336. package/lib/esm/curve/internalContexts/CloneCurvesContext.js.map +1 -1
  337. package/lib/esm/curve/internalContexts/CloneWithExpandedLineStrings.js.map +1 -1
  338. package/lib/esm/curve/internalContexts/ClosestPointStrokeHandler.js.map +1 -1
  339. package/lib/esm/curve/internalContexts/CountLinearPartsSearchContext.js.map +1 -1
  340. package/lib/esm/curve/internalContexts/CurveCurveCloseApproachXY.js.map +1 -1
  341. package/lib/esm/curve/internalContexts/CurveCurveIntersectXY.js.map +1 -1
  342. package/lib/esm/curve/internalContexts/CurveCurveIntersectXYZ.js.map +1 -1
  343. package/lib/esm/curve/internalContexts/CurveLengthContext.js.map +1 -1
  344. package/lib/esm/curve/internalContexts/CurveOffsetXYHandler.js.map +1 -1
  345. package/lib/esm/curve/internalContexts/EllipticalArcApproximationContext.js.map +1 -1
  346. package/lib/esm/curve/internalContexts/GapSearchContext.js.map +1 -1
  347. package/lib/esm/curve/internalContexts/MultiChainCollector.js.map +1 -1
  348. package/lib/esm/curve/internalContexts/NewtonRtoRStrokeHandler.js.map +1 -1
  349. package/lib/esm/curve/internalContexts/PlaneAltitudeRangeContext.js.map +1 -1
  350. package/lib/esm/curve/internalContexts/PolygonOffsetContext.js.map +1 -1
  351. package/lib/esm/curve/internalContexts/SumLengthsContext.js.map +1 -1
  352. package/lib/esm/curve/internalContexts/TransferWithSplitArcs.js.map +1 -1
  353. package/lib/esm/curve/internalContexts/TransformInPlaceContext.js.map +1 -1
  354. package/lib/esm/curve/spiral/AustralianRailCorpXYEvaluator.d.ts +10 -13
  355. package/lib/esm/curve/spiral/AustralianRailCorpXYEvaluator.d.ts.map +1 -1
  356. package/lib/esm/curve/spiral/AustralianRailCorpXYEvaluator.js +23 -22
  357. package/lib/esm/curve/spiral/AustralianRailCorpXYEvaluator.js.map +1 -1
  358. package/lib/esm/curve/spiral/ClothoidSeries.d.ts +5 -5
  359. package/lib/esm/curve/spiral/ClothoidSeries.d.ts.map +1 -1
  360. package/lib/esm/curve/spiral/ClothoidSeries.js +28 -16
  361. package/lib/esm/curve/spiral/ClothoidSeries.js.map +1 -1
  362. package/lib/esm/curve/spiral/CubicEvaluator.d.ts +7 -6
  363. package/lib/esm/curve/spiral/CubicEvaluator.d.ts.map +1 -1
  364. package/lib/esm/curve/spiral/CubicEvaluator.js +29 -14
  365. package/lib/esm/curve/spiral/CubicEvaluator.js.map +1 -1
  366. package/lib/esm/curve/spiral/CzechSpiralEvaluator.d.ts +30 -40
  367. package/lib/esm/curve/spiral/CzechSpiralEvaluator.d.ts.map +1 -1
  368. package/lib/esm/curve/spiral/CzechSpiralEvaluator.js +43 -49
  369. package/lib/esm/curve/spiral/CzechSpiralEvaluator.js.map +1 -1
  370. package/lib/esm/curve/spiral/DirectHalfCosineSpiralEvaluator.d.ts +2 -2
  371. package/lib/esm/curve/spiral/DirectHalfCosineSpiralEvaluator.d.ts.map +1 -1
  372. package/lib/esm/curve/spiral/DirectHalfCosineSpiralEvaluator.js +17 -7
  373. package/lib/esm/curve/spiral/DirectHalfCosineSpiralEvaluator.js.map +1 -1
  374. package/lib/esm/curve/spiral/DirectSpiral3d.d.ts +103 -95
  375. package/lib/esm/curve/spiral/DirectSpiral3d.d.ts.map +1 -1
  376. package/lib/esm/curve/spiral/DirectSpiral3d.js +132 -106
  377. package/lib/esm/curve/spiral/DirectSpiral3d.js.map +1 -1
  378. package/lib/esm/curve/spiral/IntegratedSpiral3d.d.ts +70 -52
  379. package/lib/esm/curve/spiral/IntegratedSpiral3d.d.ts.map +1 -1
  380. package/lib/esm/curve/spiral/IntegratedSpiral3d.js +97 -65
  381. package/lib/esm/curve/spiral/IntegratedSpiral3d.js.map +1 -1
  382. package/lib/esm/curve/spiral/MXCubicAlongArcSpiralEvaluator.d.ts +7 -11
  383. package/lib/esm/curve/spiral/MXCubicAlongArcSpiralEvaluator.d.ts.map +1 -1
  384. package/lib/esm/curve/spiral/MXCubicAlongArcSpiralEvaluator.js +10 -12
  385. package/lib/esm/curve/spiral/MXCubicAlongArcSpiralEvaluator.js.map +1 -1
  386. package/lib/esm/curve/spiral/NormalizedTransition.d.ts +29 -24
  387. package/lib/esm/curve/spiral/NormalizedTransition.d.ts.map +1 -1
  388. package/lib/esm/curve/spiral/NormalizedTransition.js +53 -35
  389. package/lib/esm/curve/spiral/NormalizedTransition.js.map +1 -1
  390. package/lib/esm/curve/spiral/PolishCubicSpiralEvaluator.d.ts +12 -17
  391. package/lib/esm/curve/spiral/PolishCubicSpiralEvaluator.d.ts.map +1 -1
  392. package/lib/esm/curve/spiral/PolishCubicSpiralEvaluator.js +20 -23
  393. package/lib/esm/curve/spiral/PolishCubicSpiralEvaluator.js.map +1 -1
  394. package/lib/esm/curve/spiral/TransitionConditionalProperties.d.ts +25 -23
  395. package/lib/esm/curve/spiral/TransitionConditionalProperties.d.ts.map +1 -1
  396. package/lib/esm/curve/spiral/TransitionConditionalProperties.js +34 -29
  397. package/lib/esm/curve/spiral/TransitionConditionalProperties.js.map +1 -1
  398. package/lib/esm/curve/spiral/TransitionSpiral3d.d.ts +43 -33
  399. package/lib/esm/curve/spiral/TransitionSpiral3d.d.ts.map +1 -1
  400. package/lib/esm/curve/spiral/TransitionSpiral3d.js +56 -38
  401. package/lib/esm/curve/spiral/TransitionSpiral3d.js.map +1 -1
  402. package/lib/esm/curve/spiral/XYCurveEvaluator.d.ts +27 -21
  403. package/lib/esm/curve/spiral/XYCurveEvaluator.d.ts.map +1 -1
  404. package/lib/esm/curve/spiral/XYCurveEvaluator.js +23 -18
  405. package/lib/esm/curve/spiral/XYCurveEvaluator.js.map +1 -1
  406. package/lib/esm/geometry3d/Angle.js.map +1 -1
  407. package/lib/esm/geometry3d/AngleSweep.js.map +1 -1
  408. package/lib/esm/geometry3d/BarycentricTriangle.js.map +1 -1
  409. package/lib/esm/geometry3d/BilinearPatch.js.map +1 -1
  410. package/lib/esm/geometry3d/CoincidentGeometryOps.js.map +1 -1
  411. package/lib/esm/geometry3d/Ellipsoid.js.map +1 -1
  412. package/lib/esm/geometry3d/FrameBuilder.js.map +1 -1
  413. package/lib/esm/geometry3d/FrustumAnimation.js.map +1 -1
  414. package/lib/esm/geometry3d/GeometryHandler.js.map +1 -1
  415. package/lib/esm/geometry3d/GrowableBlockedArray.js.map +1 -1
  416. package/lib/esm/geometry3d/GrowableFloat64Array.js.map +1 -1
  417. package/lib/esm/geometry3d/GrowableXYArray.js.map +1 -1
  418. package/lib/esm/geometry3d/GrowableXYZArray.js.map +1 -1
  419. package/lib/esm/geometry3d/IndexedCollectionInterval.js.map +1 -1
  420. package/lib/esm/geometry3d/IndexedXYCollection.js.map +1 -1
  421. package/lib/esm/geometry3d/IndexedXYZCollection.js.map +1 -1
  422. package/lib/esm/geometry3d/LongitudeLatitudeAltitude.js.map +1 -1
  423. package/lib/esm/geometry3d/Matrix3d.js.map +1 -1
  424. package/lib/esm/geometry3d/OrderedRotationAngles.js.map +1 -1
  425. package/lib/esm/geometry3d/Plane3d.js.map +1 -1
  426. package/lib/esm/geometry3d/Plane3dByOriginAndUnitNormal.js.map +1 -1
  427. package/lib/esm/geometry3d/Plane3dByOriginAndVectors.js.map +1 -1
  428. package/lib/esm/geometry3d/Point2dArrayCarrier.js.map +1 -1
  429. package/lib/esm/geometry3d/Point2dVector2d.js.map +1 -1
  430. package/lib/esm/geometry3d/Point3dArrayCarrier.js.map +1 -1
  431. package/lib/esm/geometry3d/Point3dVector3d.js.map +1 -1
  432. package/lib/esm/geometry3d/PointHelpers.js.map +1 -1
  433. package/lib/esm/geometry3d/PointStreaming.js.map +1 -1
  434. package/lib/esm/geometry3d/PolygonOps.js.map +1 -1
  435. package/lib/esm/geometry3d/PolylineCompressionByEdgeOffset.js.map +1 -1
  436. package/lib/esm/geometry3d/PolylineOps.js.map +1 -1
  437. package/lib/esm/geometry3d/Range.js.map +1 -1
  438. package/lib/esm/geometry3d/Ray2d.js.map +1 -1
  439. package/lib/esm/geometry3d/Ray3d.js.map +1 -1
  440. package/lib/esm/geometry3d/ReusableObjectCache.js.map +1 -1
  441. package/lib/esm/geometry3d/Segment1d.js.map +1 -1
  442. package/lib/esm/geometry3d/SortablePolygon.js.map +1 -1
  443. package/lib/esm/geometry3d/Transform.js.map +1 -1
  444. package/lib/esm/geometry3d/UVSurfaceOps.js.map +1 -1
  445. package/lib/esm/geometry3d/XYZProps.js.map +1 -1
  446. package/lib/esm/geometry3d/YawPitchRollAngles.js.map +1 -1
  447. package/lib/esm/geometry4d/Map4d.js.map +1 -1
  448. package/lib/esm/geometry4d/Matrix4d.js.map +1 -1
  449. package/lib/esm/geometry4d/MomentData.js.map +1 -1
  450. package/lib/esm/geometry4d/PlaneByOriginAndVectors4d.js.map +1 -1
  451. package/lib/esm/geometry4d/Point4d.js.map +1 -1
  452. package/lib/esm/numerics/BandedSystem.js.map +1 -1
  453. package/lib/esm/numerics/BezierPolynomials.js.map +1 -1
  454. package/lib/esm/numerics/ClusterableArray.js.map +1 -1
  455. package/lib/esm/numerics/Complex.js.map +1 -1
  456. package/lib/esm/numerics/ConvexPolygon2d.js.map +1 -1
  457. package/lib/esm/numerics/Newton.js.map +1 -1
  458. package/lib/esm/numerics/PascalCoefficients.js.map +1 -1
  459. package/lib/esm/numerics/PolarData.js.map +1 -1
  460. package/lib/esm/numerics/Polynomials.js.map +1 -1
  461. package/lib/esm/numerics/Quadrature.js.map +1 -1
  462. package/lib/esm/numerics/Range1dArray.js.map +1 -1
  463. package/lib/esm/numerics/SmallSystem.js.map +1 -1
  464. package/lib/esm/numerics/TriDiagonalSystem.js.map +1 -1
  465. package/lib/esm/numerics/UnionFind.js.map +1 -1
  466. package/lib/esm/numerics/UsageSums.js.map +1 -1
  467. package/lib/esm/polyface/AuxData.js.map +1 -1
  468. package/lib/esm/polyface/BoxTopology.js.map +1 -1
  469. package/lib/esm/polyface/FacetFaceData.js.map +1 -1
  470. package/lib/esm/polyface/FacetLocationDetail.js.map +1 -1
  471. package/lib/esm/polyface/FacetOrientation.js.map +1 -1
  472. package/lib/esm/polyface/GreedyTriangulationBetweenLineStrings.js.map +1 -1
  473. package/lib/esm/polyface/IndexedEdgeMatcher.js.map +1 -1
  474. package/lib/esm/polyface/IndexedPolyfaceVisitor.js.map +1 -1
  475. package/lib/esm/polyface/IndexedPolyfaceWalker.js.map +1 -1
  476. package/lib/esm/polyface/Polyface.js.map +1 -1
  477. package/lib/esm/polyface/PolyfaceBuilder.js.map +1 -1
  478. package/lib/esm/polyface/PolyfaceClip.js.map +1 -1
  479. package/lib/esm/polyface/PolyfaceData.js.map +1 -1
  480. package/lib/esm/polyface/PolyfaceQuery.js.map +1 -1
  481. package/lib/esm/polyface/RangeLengthData.js.map +1 -1
  482. package/lib/esm/polyface/RangeTree/LineString3dRangeTreeContext.js.map +1 -1
  483. package/lib/esm/polyface/RangeTree/MinimumValueTester.js.map +1 -1
  484. package/lib/esm/polyface/RangeTree/Point3dArrayRangeTreeContext.js.map +1 -1
  485. package/lib/esm/polyface/RangeTree/PolyfaceRangeTreeContext.js.map +1 -1
  486. package/lib/esm/polyface/RangeTree/RangeTreeNode.js.map +1 -1
  487. package/lib/esm/polyface/RangeTree/RangeTreeSearchHandlers.js.map +1 -1
  488. package/lib/esm/polyface/TaggedNumericData.js.map +1 -1
  489. package/lib/esm/polyface/TriangleCandidate.js.map +1 -1
  490. package/lib/esm/polyface/multiclip/BuildAverageNormalsContext.js.map +1 -1
  491. package/lib/esm/polyface/multiclip/GriddedRaggedRange2dSet.js.map +1 -1
  492. package/lib/esm/polyface/multiclip/GriddedRaggedRange2dSetWithOverflow.js.map +1 -1
  493. package/lib/esm/polyface/multiclip/LinearSearchRange2dArray.js.map +1 -1
  494. package/lib/esm/polyface/multiclip/OffsetMeshContext.js.map +1 -1
  495. package/lib/esm/polyface/multiclip/Range2dSearchInterface.js.map +1 -1
  496. package/lib/esm/polyface/multiclip/RangeSearch.js.map +1 -1
  497. package/lib/esm/polyface/multiclip/SweepLineStringToFacetContext.js.map +1 -1
  498. package/lib/esm/polyface/multiclip/XYPointBuckets.js.map +1 -1
  499. package/lib/esm/serialization/BGFBAccessors.js.map +1 -1
  500. package/lib/esm/serialization/BGFBReader.js.map +1 -1
  501. package/lib/esm/serialization/BGFBWriter.js.map +1 -1
  502. package/lib/esm/serialization/BentleyGeometryFlatBuffer.js.map +1 -1
  503. package/lib/esm/serialization/DeepCompare.js.map +1 -1
  504. package/lib/esm/serialization/GeometrySamples.js.map +1 -1
  505. package/lib/esm/serialization/IModelJsonSchema.js.map +1 -1
  506. package/lib/esm/serialization/SerializationHelpers.js.map +1 -1
  507. package/lib/esm/solid/Box.js.map +1 -1
  508. package/lib/esm/solid/Cone.js.map +1 -1
  509. package/lib/esm/solid/LinearSweep.js.map +1 -1
  510. package/lib/esm/solid/RotationalSweep.js.map +1 -1
  511. package/lib/esm/solid/RuledSweep.js.map +1 -1
  512. package/lib/esm/solid/SolidPrimitive.js.map +1 -1
  513. package/lib/esm/solid/Sphere.js.map +1 -1
  514. package/lib/esm/solid/SweepContour.js.map +1 -1
  515. package/lib/esm/solid/TorusPipe.js.map +1 -1
  516. package/lib/esm/topology/ChainMerge.js.map +1 -1
  517. package/lib/esm/topology/Graph.js.map +1 -1
  518. package/lib/esm/topology/HalfEdgeGraphFromIndexedLoopsContext.js.map +1 -1
  519. package/lib/esm/topology/HalfEdgeGraphSearch.js.map +1 -1
  520. package/lib/esm/topology/HalfEdgeGraphSpineContext.js.map +1 -1
  521. package/lib/esm/topology/HalfEdgeGraphValidation.js.map +1 -1
  522. package/lib/esm/topology/HalfEdgeMarkSet.js.map +1 -1
  523. package/lib/esm/topology/HalfEdgeNodeXYZUV.js.map +1 -1
  524. package/lib/esm/topology/HalfEdgePointInGraphSearch.js.map +1 -1
  525. package/lib/esm/topology/HalfEdgePositionDetail.js.map +1 -1
  526. package/lib/esm/topology/HalfEdgePriorityQueue.js.map +1 -1
  527. package/lib/esm/topology/InsertAndRetriangulateContext.js.map +1 -1
  528. package/lib/esm/topology/MaskManager.js.map +1 -1
  529. package/lib/esm/topology/Merging.js.map +1 -1
  530. package/lib/esm/topology/RegularizeFace.js.map +1 -1
  531. package/lib/esm/topology/SignedDataSummary.js.map +1 -1
  532. package/lib/esm/topology/SpaceTriangulation.js.map +1 -1
  533. package/lib/esm/topology/Triangulation.js.map +1 -1
  534. package/lib/esm/topology/Voronoi.js.map +1 -1
  535. package/lib/esm/topology/XYParitySearchContext.js.map +1 -1
  536. package/package.json +3 -3
@@ -1 +1 @@
1
- {"version":3,"file":"OrderedRotationAngles.js","sourceRoot":"","sources":["../../../src/geometry3d/OrderedRotationAngles.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;;;AAE/F;;GAEG;AACH,0CAAkD;AAClD,mCAAgC;AAChC,yCAAsC;AAEtC,wFAAwF;AAExF;;;;;;;;;;GAUG;AACH,MAAa,qBAAqB;IAChC,wBAAwB;IAChB,EAAE,CAAQ;IAClB,wBAAwB;IAChB,EAAE,CAAQ;IAClB,wBAAwB;IAChB,EAAE,CAAQ;IAClB,2GAA2G;IACnG,MAAM,CAAY;IAC1B,sCAAsC;IAC9B,MAAM,CAAC,uBAAuB,GAAY,KAAK,CAAC;IACxD,kBAAkB;IAClB,YAAoB,CAAQ,EAAE,CAAQ,EAAE,CAAQ,EAAE,SAAoB;QACpE,IAAI,CAAC,EAAE,GAAG,CAAC,CAAC;QACZ,IAAI,CAAC,EAAE,GAAG,CAAC,CAAC;QACZ,IAAI,CAAC,EAAE,GAAG,CAAC,CAAC;QACZ,IAAI,CAAC,MAAM,GAAG,SAAS,CAAC;IAC1B,CAAC;IACD,0FAA0F;IAC1F,IAAW,KAAK;QACd,OAAO,IAAI,CAAC,MAAM,CAAC;IACrB,CAAC;IACD,gFAAgF;IAChF,IAAW,MAAM;QACf,OAAO,IAAI,CAAC,EAAE,CAAC,KAAK,EAAE,CAAC;IACzB,CAAC;IACD,gFAAgF;IAChF,IAAW,MAAM;QACf,OAAO,IAAI,CAAC,EAAE,CAAC,KAAK,EAAE,CAAC;IACzB,CAAC;IACD,gFAAgF;IAChF,IAAW,MAAM;QACf,OAAO,IAAI,CAAC,EAAE,CAAC,KAAK,EAAE,CAAC;IACzB,CAAC;IACD,4EAA4E;IAC5E,IAAW,QAAQ;QACjB,OAAO,IAAI,CAAC,EAAE,CAAC,OAAO,CAAC;IACzB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,GAAG,IAAI,GAAG,EAAE,EAC3C,EAAE,EAAE,EAAE,GAAG,EAAE,EAAE,CAAC,EAAE,GAAG,EAAE,EACrB,CAAC,EAAE,GAAG,EAAE,EAAE,IAAI,GAAG,IAAI,GAAG,EAAE,EAAE,IAAI,GAAG,IAAI,GAAG,EAAE,CAC7C,CAAC;QACJ,CAAC;aAAM,CAAC;YACN,GAAG,CAAC,WAAW,EAAE,CAAC;QACpB,CAAC;QACD,yEAAyE;QACzE,IAAI,CAAC,qBAAqB,CAAC,qBAAqB;YAC9C,GAAG,CAAC,gBAAgB,EAAE,CAAC;QAEzB,OAAO,GAAG,CAAC;IACb,CAAC;;AAvVH,sDAwVC","sourcesContent":["/*---------------------------------------------------------------------------------------------\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\nimport { AxisOrder, Geometry } from \"../Geometry\";\r\nimport { Angle } from \"./Angle\";\r\nimport { Matrix3d } from \"./Matrix3d\";\r\n\r\n/* cspell:word cxcz, cxsz, cxcy, cxsy, sxcz, sxsz, sxcy, sxsy, cycz, cysz, sycz, sysz */\r\n\r\n/**\r\n * Represents a non-trivial rotation using three simple axis rotation angles and an order in which to apply them.\r\n * * This class accommodates application-specific interpretation of \"multiplying 3 rotation matrices\" with regard to\r\n * * Whether a \"vector\" is a \"row\" or a \"column\"\r\n * * The order in which the X,Y,Z rotations are applied.\r\n * * This class bakes in angle rotation directions via create functions (i.e., createRadians, createDegrees, and\r\n * createAngles) so you can define each of the 3 rotations to be clockwise or counterclockwise. The default\r\n * rotation is counterclockwise.\r\n * * Within the imodel geometry library, the preferred rotation order is encapsulated in `YawPitchRollAngles`.\r\n * @alpha\r\n */\r\nexport class OrderedRotationAngles {\r\n /** rotation around x */\r\n private _x: Angle;\r\n /** rotation around y */\r\n private _y: Angle;\r\n /** rotation around z */\r\n private _z: Angle;\r\n /** rotation order. For example XYZ means to rotate around x axis first, then y axis, and finally Z axis */\r\n private _order: AxisOrder;\r\n /** treat vectors as matrix columns */\r\n private static _sTreatVectorsAsColumns: boolean = false;\r\n /** constructor */\r\n private constructor(x: Angle, y: Angle, z: Angle, axisOrder: AxisOrder) {\r\n this._x = x;\r\n this._y = y;\r\n this._z = z;\r\n this._order = axisOrder;\r\n }\r\n /** (Property accessor) Return the `AxisOrder` controlling matrix multiplication order. */\r\n public get order(): AxisOrder {\r\n return this._order;\r\n }\r\n /** (Property accessor) Return the strongly typed angle of rotation around x. */\r\n public get xAngle(): Angle {\r\n return this._x.clone();\r\n }\r\n /** (Property accessor) Return the strongly typed angle of rotation around y. */\r\n public get yAngle(): Angle {\r\n return this._y.clone();\r\n }\r\n /** (Property accessor) Return the strongly typed angle of rotation around z. */\r\n public get zAngle(): Angle {\r\n return this._z.clone();\r\n }\r\n /** (Property accessor) Return the angle of rotation around x, in degrees */\r\n public get xDegrees(): number {\r\n return this._x.degrees;\r\n }\r\n /** (Property accessor) Return the angle of rotation around y, in degrees */\r\n public get xRadians(): number {\r\n return this._x.radians;\r\n }\r\n /** (Property accessor) Return the angle of rotation around z, in degrees */\r\n public get yDegrees(): number {\r\n return this._y.degrees;\r\n }\r\n /** (Property accessor) Return the angle of rotation around x, in radians */\r\n public get yRadians(): number {\r\n return this._y.radians;\r\n }\r\n /** (Property accessor) Return the angle of rotation around y, in radians */\r\n public get zDegrees(): number {\r\n return this._z.degrees;\r\n }\r\n /** (Property accessor) Return the angle of rotation around z, in radians */\r\n public get zRadians(): number {\r\n return this._z.radians;\r\n }\r\n /** The flag controlling whether vectors are treated as rows or as columns */\r\n public static get treatVectorsAsColumns(): boolean {\r\n return OrderedRotationAngles._sTreatVectorsAsColumns;\r\n }\r\n public static set treatVectorsAsColumns(value: boolean) {\r\n OrderedRotationAngles._sTreatVectorsAsColumns = value;\r\n }\r\n /**\r\n * Create an OrderedRotationAngles from three angles (in radians), an ordering in which to apply them when\r\n * rotating, and a flag triple controlling whether direction of x,y,z is clockwise or counterclockwise.\r\n * @param xRadians rotation around x\r\n * @param yRadians rotation around y\r\n * @param zRadians rotation around z\r\n * @param order left to right order of axis names identifies the order that rotations are applied.\r\n * For example XYZ means to rotate around x axis first, then y axis, and finally Z axis.\r\n * * Note that rotation order is reverse of rotation matrix multiplication so for XYZ the rotation\r\n * matrix multiplication would be zRot*yRot*xRot\r\n * * Visualization can be found at https://www.itwinjs.org/sandbox/SaeedTorabi/CubeRotationAroundStandardAxes\r\n * @param xyzRotationIsClockwise the flags controlling whether direction of x,y,z is clockwise or counterclockwise.\r\n * rotation direction of x,y,z: true ---> clockwise - false ---> counterclockwise.\r\n * * if xyzRotationIsClockwise is undefined it's set to [false, false, false].\r\n * @param result caller-allocated OrderedRotationAngles\r\n */\r\n public static createRadians(xRadians: number, yRadians: number, zRadians: number, order: AxisOrder,\r\n xyzRotationIsClockwise?: [boolean, boolean, boolean], result?: OrderedRotationAngles): OrderedRotationAngles {\r\n if (!xyzRotationIsClockwise) {\r\n xyzRotationIsClockwise = [false, false, false];\r\n }\r\n const xRadian = xyzRotationIsClockwise[0] ? -xRadians : xRadians;\r\n const yRadian = xyzRotationIsClockwise[1] ? -yRadians : yRadians;\r\n const zRadian = xyzRotationIsClockwise[2] ? -zRadians : zRadians;\r\n if (result) {\r\n result._x.setRadians(xRadian);\r\n result._y.setRadians(yRadian);\r\n result._z.setRadians(zRadian);\r\n result._order = order;\r\n return result;\r\n }\r\n return new OrderedRotationAngles(\r\n Angle.createRadians(xRadian),\r\n Angle.createRadians(yRadian),\r\n Angle.createRadians(zRadian),\r\n order,\r\n );\r\n }\r\n /**\r\n * Create an OrderedRotationAngles from three angles (in degrees) and an ordering in which to apply\r\n * them when rotating.\r\n * @param xDegrees rotation around x\r\n * @param yDegrees rotation around y\r\n * @param zDegrees rotation around z\r\n * @param order left to right order of axis names identifies the order that rotations are applied.\r\n * For example XYZ means to rotate around x axis first, then y axis, and finally Z axis.\r\n * * Note that rotation order is reverse of rotation matrix multiplication so for XYZ the rotation\r\n * matrix multiplication would be zRot*yRot*xRot\r\n * @param xyzRotationIsClockwise the flags controlling whether direction of x,y,z is clockwise or counterclockwise.\r\n * rotation direction of x,y,z: true ---> clockwise - false ---> counterclockwise.\r\n * * if xyzRotationIsClockwise is undefined it's set to [false, false, false].\r\n * @param result caller-allocated OrderedRotationAngles\r\n */\r\n public static createDegrees(xDegrees: number, yDegrees: number, zDegrees: number, order: AxisOrder,\r\n xyzRotationIsClockwise?: [boolean, boolean, boolean], result?: OrderedRotationAngles): OrderedRotationAngles {\r\n return OrderedRotationAngles.createRadians(\r\n Angle.degreesToRadians(xDegrees),\r\n Angle.degreesToRadians(yDegrees),\r\n Angle.degreesToRadians(zDegrees),\r\n order,\r\n xyzRotationIsClockwise,\r\n result,\r\n );\r\n }\r\n /**\r\n * Create an OrderedRotationAngles from three angles, an ordering in which to apply them when rotating,\r\n * and a flag triple controlling whether direction of x,y,z is clockwise or counterclockwise.\r\n * @param xRotation rotation around x\r\n * @param yRotation rotation around y\r\n * @param zRotation rotation around z\r\n * @param order left to right order of axis names identifies the order that rotations are applied\r\n * For example XYZ means to rotate around x axis first, then y axis, and finally Z axis.\r\n * * Note that rotation order is reverse of rotation matrix multiplication so for XYZ the rotation\r\n * matrix multiplication would be zRot*yRot*xRot\r\n * @param xyzRotationIsClockwise the flags controlling whether direction of x,y,z is clockwise or counterclockwise.\r\n * rotation direction of x,y,z: true ---> clockwise - false ---> counterclockwise.\r\n * * if xyzRotationIsClockwise is undefined it's set to [false, false, false].\r\n * @param result caller-allocated OrderedRotationAngles\r\n */\r\n public static createAngles(xRotation: Angle, yRotation: Angle, zRotation: Angle, order: AxisOrder,\r\n xyzRotationIsClockwise?: [boolean, boolean, boolean], result?: OrderedRotationAngles): OrderedRotationAngles {\r\n return OrderedRotationAngles.createRadians(\r\n xRotation.radians,\r\n yRotation.radians,\r\n zRotation.radians,\r\n order,\r\n xyzRotationIsClockwise,\r\n result,\r\n );\r\n }\r\n /**\r\n * Create an OrderedRotationAngles from a 3x3 rotational matrix, given the ordering of axis rotations\r\n * that the matrix derives from.\r\n * * This function creates an OrderedRotationAngles with default angle rotation directions, i.e.,\r\n * it assumes all x, y, and z rotations are counterclockwise.\r\n * * In the failure case the method's return value is `undefined`.\r\n * * In the failure case, if the optional result was supplied, that result will nonetheless be filled with\r\n * a set of angles.\r\n */\r\n public static createFromMatrix3d(matrix: Matrix3d, order: AxisOrder, result?: OrderedRotationAngles):\r\n OrderedRotationAngles | undefined {\r\n // treat vector as columns\r\n let m11 = matrix.coffs[0], m12 = matrix.coffs[1], m13 = matrix.coffs[2];\r\n let m21 = matrix.coffs[3], m22 = matrix.coffs[4], m23 = matrix.coffs[5];\r\n let m31 = matrix.coffs[6], m32 = matrix.coffs[7], m33 = matrix.coffs[8];\r\n // treat vector as rows\r\n if (!OrderedRotationAngles.treatVectorsAsColumns) {\r\n m11 = matrix.coffs[0], m12 = matrix.coffs[3], m13 = matrix.coffs[6];\r\n m21 = matrix.coffs[1], m22 = matrix.coffs[4], m23 = matrix.coffs[7];\r\n m31 = matrix.coffs[2], m32 = matrix.coffs[5], m33 = matrix.coffs[8];\r\n }\r\n\r\n let xRad: number;\r\n let yRad: number;\r\n let zRad: number;\r\n\r\n switch (order) {\r\n case AxisOrder.XYZ: {\r\n yRad = Math.asin(Math.max(-1, Math.min(1, -m31))); // limit asin domain to [-1,1]\r\n\r\n if (Math.abs(m31) < 0.99999) {\r\n xRad = Math.atan2(m32, m33);\r\n zRad = Math.atan2(m21, m11);\r\n } else {\r\n /**\r\n * If Math.abs(m31) = 1 then yRad = +-90 degrees and therefore, we have a gimbal lock.\r\n * This means xRad and zRad can be anything as long as their sum xRad + zRad is constant.\r\n * so we can pick zRad = 0 and calculate xRad (or pick xRad = 0 and calculate zRad).\r\n * Therefore, rotation matrix becomes\r\n * Matrix3d.createRowValues(\r\n * 0, +-sx, +-cx,\r\n * 0, cx, -sx,\r\n * -+1, 0, 0\r\n * );\r\n * Math details can be found\r\n * https://en.wikipedia.org/wiki/Gimbal_lock#Loss_of_a_degree_of_freedom_with_Euler_angles\r\n */\r\n xRad = Math.atan2(-m23, m22);\r\n zRad = 0;\r\n }\r\n break;\r\n } case AxisOrder.YXZ: {\r\n xRad = Math.asin(Math.max(-1, Math.min(1, m32))); // limit asin domain to [-1,1]\r\n\r\n if (Math.abs(m32) < 0.99999) {\r\n yRad = Math.atan2(-m31, m33);\r\n zRad = Math.atan2(-m12, m22);\r\n } else {\r\n yRad = Math.atan2(m13, m11);\r\n zRad = 0;\r\n }\r\n break;\r\n } case AxisOrder.ZXY: {\r\n xRad = Math.asin(Math.max(-1, Math.min(1, -m23))); // limit asin domain to [-1,1]\r\n\r\n if (Math.abs(m23) < 0.99999) {\r\n yRad = Math.atan2(m13, m33);\r\n zRad = Math.atan2(m21, m22);\r\n } else {\r\n yRad = 0;\r\n zRad = Math.atan2(-m12, m11);\r\n }\r\n break;\r\n } case AxisOrder.ZYX: {\r\n yRad = Math.asin(Math.max(-1, Math.min(1, m13))); // limit asin domain to [-1,1]\r\n\r\n if (Math.abs(m13) < 0.99999) {\r\n xRad = Math.atan2(-m23, m33);\r\n zRad = Math.atan2(-m12, m11);\r\n } else {\r\n xRad = 0;\r\n zRad = Math.atan2(m21, m22);\r\n }\r\n break;\r\n } case AxisOrder.YZX: {\r\n zRad = Math.asin(Math.max(-1, Math.min(1, -m12))); // limit asin domain to [-1,1]\r\n\r\n if (Math.abs(m12) < 0.99999) {\r\n xRad = Math.atan2(m32, m22);\r\n yRad = Math.atan2(m13, m11);\r\n } else {\r\n xRad = 0;\r\n yRad = Math.atan2(-m31, m33);\r\n }\r\n break;\r\n } case AxisOrder.XZY: {\r\n zRad = Math.asin(Math.max(-1, Math.min(1, m21))); // limit asin domain to [-1,1]\r\n\r\n if (Math.abs(m21) < 0.99999) {\r\n xRad = Math.atan2(-m23, m22);\r\n yRad = Math.atan2(-m31, m11);\r\n } else {\r\n xRad = Math.atan2(m32, m33);\r\n yRad = 0;\r\n }\r\n break;\r\n } default: {\r\n xRad = yRad = zRad = 0;\r\n }\r\n }\r\n const xyzRotationIsClockwise: [boolean, boolean, boolean] = [false, false, false];\r\n const angles = OrderedRotationAngles.createRadians(xRad, yRad, zRad, order, xyzRotationIsClockwise, result);\r\n // sanity check\r\n const matrix1 = angles.toMatrix3d();\r\n /**\r\n * Below tolerance loosened to allow sanity check to pass for\r\n *\r\n * OrderedRotationAngles.createFromMatrix3d(\r\n * OrderedRotationAngles.createDegrees(0, 89.999, 0.001, AxisOrder.XYZ).toMatrix3d(),\r\n * AxisOrder.XYZ\r\n * );\r\n *\r\n * with treatVectorsAsColumns = true.\r\n */\r\n return (matrix.maxDiff(matrix1) < 10 * Geometry.smallFraction) ? angles : undefined;\r\n }\r\n /**\r\n * Create a 3x3 rotational matrix from this OrderedRotationAngles.\r\n ** math details can be found at docs/learning/geometry/Angle.md\r\n **/\r\n public toMatrix3d(result?: Matrix3d): Matrix3d {\r\n const rot = (result !== undefined) ? result : new Matrix3d();\r\n const axisOrder = this.order;\r\n const x = this.xAngle, y = this.yAngle, z = this.zAngle;\r\n\r\n const cx = x.cos(), sx = x.sin();\r\n const cy = y.cos(), sy = y.sin();\r\n const cz = z.cos(), sz = z.sin();\r\n\r\n const cxcz = cx * cz, cxsz = cx * sz, cxcy = cx * cy, cxsy = cx * sy;\r\n const sxcz = sx * cz, sxsz = sx * sz, sxcy = sx * cy, sxsy = sx * sy;\r\n const cycz = cy * cz, cysz = cy * sz, sycz = sy * cz, sysz = sy * sz;\r\n\r\n // the rotation matrix we build below is created using column-based base rotation matrixes\r\n if (axisOrder === AxisOrder.XYZ) {\r\n rot.setRowValues(\r\n cy * cz, sxcz * sy - cxsz, cxcz * sy + sxsz,\r\n cy * sz, cxcz + sxsz * sy, cxsz * sy - sxcz,\r\n -sy, sx * cy, cx * cy,\r\n );\r\n } else if (axisOrder === AxisOrder.YXZ) {\r\n rot.setRowValues(\r\n cycz - sysz * sx, -cx * sz, cysz * sx + sycz,\r\n sycz * sx + cysz, cx * cz, sysz - cycz * sx,\r\n -cx * sy, sx, cx * cy,\r\n );\r\n } else if (axisOrder === AxisOrder.ZXY) {\r\n rot.setRowValues(\r\n cycz + sysz * sx, sycz * sx - cysz, cx * sy,\r\n cx * sz, cx * cz, -sx,\r\n cysz * sx - sycz, cycz * sx + sysz, cx * cy,\r\n );\r\n } else if (axisOrder === AxisOrder.ZYX) {\r\n rot.setRowValues(\r\n cy * cz, -cy * sz, sy,\r\n sxcz * sy + cxsz, cxcz - sxsz * sy, -sx * cy,\r\n sxsz - cxcz * sy, sxcz + cxsz * sy, cx * cy,\r\n );\r\n } else if (axisOrder === AxisOrder.YZX) {\r\n rot.setRowValues(\r\n cy * cz, -sz, sy * cz,\r\n sxsy + cxcy * sz, cx * cz, cxsy * sz - sxcy,\r\n sxcy * sz - cxsy, sx * cz, cxcy + sxsy * sz,\r\n );\r\n } else if (axisOrder === AxisOrder.XZY) {\r\n rot.setRowValues(\r\n cy * cz, sxsy - cxcy * sz, cxsy + sxcy * sz,\r\n sz, cx * cz, -sx * cz,\r\n -sy * cz, sxcy + cxsy * sz, cxcy - sxsy * sz,\r\n );\r\n } else {\r\n rot.setIdentity();\r\n }\r\n // if we need row-based rotation matrix, we transpose the rotation matrix\r\n if (!OrderedRotationAngles.treatVectorsAsColumns)\r\n rot.transposeInPlace();\r\n\r\n return rot;\r\n }\r\n}\r\n"]}
1
+ {"version":3,"file":"OrderedRotationAngles.js","sourceRoot":"","sources":["../../../src/geometry3d/OrderedRotationAngles.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;;;AAE/F;;GAEG;AACH,0CAAkD;AAClD,mCAAgC;AAChC,yCAAsC;AAEtC,wFAAwF;AAExF;;;;;;;;;;GAUG;AACH,MAAa,qBAAqB;IAChC,wBAAwB;IAChB,EAAE,CAAQ;IAClB,wBAAwB;IAChB,EAAE,CAAQ;IAClB,wBAAwB;IAChB,E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H,sDAwVC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n\n/** @packageDocumentation\n * @module CartesianGeometry\n */\nimport { AxisOrder, Geometry } from \"../Geometry\";\nimport { Angle } from \"./Angle\";\nimport { Matrix3d } from \"./Matrix3d\";\n\n/* cspell:word cxcz, cxsz, cxcy, cxsy, sxcz, sxsz, sxcy, sxsy, cycz, cysz, sycz, sysz */\n\n/**\n * Represents a non-trivial rotation using three simple axis rotation angles and an order in which to apply them.\n * * This class accommodates application-specific interpretation of \"multiplying 3 rotation matrices\" with regard to\n * * Whether a \"vector\" is a \"row\" or a \"column\"\n * * The order in which the X,Y,Z rotations are applied.\n * * This class bakes in angle rotation directions via create functions (i.e., createRadians, createDegrees, and\n * createAngles) so you can define each of the 3 rotations to be clockwise or counterclockwise. The default\n * rotation is counterclockwise.\n * * Within the imodel geometry library, the preferred rotation order is encapsulated in `YawPitchRollAngles`.\n * @alpha\n */\nexport class OrderedRotationAngles {\n /** rotation around x */\n private _x: Angle;\n /** rotation around y */\n private _y: Angle;\n /** rotation around z */\n private _z: Angle;\n /** rotation order. For example XYZ means to rotate around x axis first, then y axis, and finally Z axis */\n private _order: AxisOrder;\n /** treat vectors as matrix columns */\n private static _sTreatVectorsAsColumns: boolean = false;\n /** constructor */\n private constructor(x: Angle, y: Angle, z: Angle, axisOrder: AxisOrder) {\n this._x = x;\n this._y = y;\n this._z = z;\n this._order = axisOrder;\n }\n /** (Property accessor) Return the `AxisOrder` controlling matrix multiplication order. */\n public get order(): AxisOrder {\n return this._order;\n }\n /** (Property accessor) Return the strongly typed angle of rotation around x. */\n public get xAngle(): Angle {\n return this._x.clone();\n }\n /** (Property accessor) Return the strongly typed angle of rotation around y. */\n public get yAngle(): Angle {\n return this._y.clone();\n }\n /** (Property accessor) Return the strongly typed angle of rotation around z. */\n public get zAngle(): Angle {\n return this._z.clone();\n }\n /** (Property accessor) Return the angle of rotation around x, in degrees */\n public get xDegrees(): number {\n return this._x.degrees;\n }\n /** (Property accessor) Return the angle of rotation around y, in degrees */\n public get xRadians(): number {\n return this._x.radians;\n }\n /** (Property accessor) Return the angle of rotation around z, in degrees */\n public get yDegrees(): number {\n return this._y.degrees;\n }\n /** (Property accessor) Return the angle of rotation around x, in radians */\n public get yRadians(): number {\n return this._y.radians;\n }\n /** (Property accessor) Return the angle of rotation around y, in radians */\n public get zDegrees(): number {\n return this._z.degrees;\n }\n /** (Property accessor) Return the angle of rotation around z, in radians */\n public get zRadians(): number {\n return this._z.radians;\n }\n /** The flag controlling whether vectors are treated as rows or as columns */\n public static get treatVectorsAsColumns(): boolean {\n return OrderedRotationAngles._sTreatVectorsAsColumns;\n }\n public static set treatVectorsAsColumns(value: boolean) {\n OrderedRotationAngles._sTreatVectorsAsColumns = value;\n }\n /**\n * Create an OrderedRotationAngles from three angles (in radians), an ordering in which to apply them when\n * rotating, and a flag triple controlling whether direction of x,y,z is clockwise or counterclockwise.\n * @param xRadians rotation around x\n * @param yRadians rotation around y\n * @param zRadians rotation around z\n * @param order left to right order of axis names identifies the order that rotations are applied.\n * For example XYZ means to rotate around x axis first, then y axis, and finally Z axis.\n * * Note that rotation order is reverse of rotation matrix multiplication so for XYZ the rotation\n * matrix multiplication would be zRot*yRot*xRot\n * * Visualization can be found at https://www.itwinjs.org/sandbox/SaeedTorabi/CubeRotationAroundStandardAxes\n * @param xyzRotationIsClockwise the flags controlling whether direction of x,y,z is clockwise or counterclockwise.\n * rotation direction of x,y,z: true ---> clockwise - false ---> counterclockwise.\n * * if xyzRotationIsClockwise is undefined it's set to [false, false, false].\n * @param result caller-allocated OrderedRotationAngles\n */\n public static createRadians(xRadians: number, yRadians: number, zRadians: number, order: AxisOrder,\n xyzRotationIsClockwise?: [boolean, boolean, boolean], result?: OrderedRotationAngles): OrderedRotationAngles {\n if (!xyzRotationIsClockwise) {\n xyzRotationIsClockwise = [false, false, false];\n }\n const xRadian = xyzRotationIsClockwise[0] ? -xRadians : xRadians;\n const yRadian = xyzRotationIsClockwise[1] ? -yRadians : yRadians;\n const zRadian = xyzRotationIsClockwise[2] ? -zRadians : zRadians;\n if (result) {\n result._x.setRadians(xRadian);\n result._y.setRadians(yRadian);\n result._z.setRadians(zRadian);\n result._order = order;\n return result;\n }\n return new OrderedRotationAngles(\n Angle.createRadians(xRadian),\n Angle.createRadians(yRadian),\n Angle.createRadians(zRadian),\n order,\n );\n }\n /**\n * Create an OrderedRotationAngles from three angles (in degrees) and an ordering in which to apply\n * them when rotating.\n * @param xDegrees rotation around x\n * @param yDegrees rotation around y\n * @param zDegrees rotation around z\n * @param order left to right order of axis names identifies the order that rotations are applied.\n * For example XYZ means to rotate around x axis first, then y axis, and finally Z axis.\n * * Note that rotation order is reverse of rotation matrix multiplication so for XYZ the rotation\n * matrix multiplication would be zRot*yRot*xRot\n * @param xyzRotationIsClockwise the flags controlling whether direction of x,y,z is clockwise or counterclockwise.\n * rotation direction of x,y,z: true ---> clockwise - false ---> counterclockwise.\n * * if xyzRotationIsClockwise is undefined it's set to [false, false, false].\n * @param result caller-allocated OrderedRotationAngles\n */\n public static createDegrees(xDegrees: number, yDegrees: number, zDegrees: number, order: AxisOrder,\n xyzRotationIsClockwise?: [boolean, boolean, boolean], result?: OrderedRotationAngles): OrderedRotationAngles {\n return OrderedRotationAngles.createRadians(\n Angle.degreesToRadians(xDegrees),\n Angle.degreesToRadians(yDegrees),\n Angle.degreesToRadians(zDegrees),\n order,\n xyzRotationIsClockwise,\n result,\n );\n }\n /**\n * Create an OrderedRotationAngles from three angles, an ordering in which to apply them when rotating,\n * and a flag triple controlling whether direction of x,y,z is clockwise or counterclockwise.\n * @param xRotation rotation around x\n * @param yRotation rotation around y\n * @param zRotation rotation around z\n * @param order left to right order of axis names identifies the order that rotations are applied\n * For example XYZ means to rotate around x axis first, then y axis, and finally Z axis.\n * * Note that rotation order is reverse of rotation matrix multiplication so for XYZ the rotation\n * matrix multiplication would be zRot*yRot*xRot\n * @param xyzRotationIsClockwise the flags controlling whether direction of x,y,z is clockwise or counterclockwise.\n * rotation direction of x,y,z: true ---> clockwise - false ---> counterclockwise.\n * * if xyzRotationIsClockwise is undefined it's set to [false, false, false].\n * @param result caller-allocated OrderedRotationAngles\n */\n public static createAngles(xRotation: Angle, yRotation: Angle, zRotation: Angle, order: AxisOrder,\n xyzRotationIsClockwise?: [boolean, boolean, boolean], result?: OrderedRotationAngles): OrderedRotationAngles {\n return OrderedRotationAngles.createRadians(\n xRotation.radians,\n yRotation.radians,\n zRotation.radians,\n order,\n xyzRotationIsClockwise,\n result,\n );\n }\n /**\n * Create an OrderedRotationAngles from a 3x3 rotational matrix, given the ordering of axis rotations\n * that the matrix derives from.\n * * This function creates an OrderedRotationAngles with default angle rotation directions, i.e.,\n * it assumes all x, y, and z rotations are counterclockwise.\n * * In the failure case the method's return value is `undefined`.\n * * In the failure case, if the optional result was supplied, that result will nonetheless be filled with\n * a set of angles.\n */\n public static createFromMatrix3d(matrix: Matrix3d, order: AxisOrder, result?: OrderedRotationAngles):\n OrderedRotationAngles | undefined {\n // treat vector as columns\n let m11 = matrix.coffs[0], m12 = matrix.coffs[1], m13 = matrix.coffs[2];\n let m21 = matrix.coffs[3], m22 = matrix.coffs[4], m23 = matrix.coffs[5];\n let m31 = matrix.coffs[6], m32 = matrix.coffs[7], m33 = matrix.coffs[8];\n // treat vector as rows\n if (!OrderedRotationAngles.treatVectorsAsColumns) {\n m11 = matrix.coffs[0], m12 = matrix.coffs[3], m13 = matrix.coffs[6];\n m21 = matrix.coffs[1], m22 = matrix.coffs[4], m23 = matrix.coffs[7];\n m31 = matrix.coffs[2], m32 = matrix.coffs[5], m33 = matrix.coffs[8];\n }\n\n let xRad: number;\n let yRad: number;\n let zRad: number;\n\n switch (order) {\n case AxisOrder.XYZ: {\n yRad = Math.asin(Math.max(-1, Math.min(1, -m31))); // limit asin domain to [-1,1]\n\n if (Math.abs(m31) < 0.99999) {\n xRad = Math.atan2(m32, m33);\n zRad = Math.atan2(m21, m11);\n } else {\n /**\n * If Math.abs(m31) = 1 then yRad = +-90 degrees and therefore, we have a gimbal lock.\n * This means xRad and zRad can be anything as long as their sum xRad + zRad is constant.\n * so we can pick zRad = 0 and calculate xRad (or pick xRad = 0 and calculate zRad).\n * Therefore, rotation matrix becomes\n * Matrix3d.createRowValues(\n * 0, +-sx, +-cx,\n * 0, cx, -sx,\n * -+1, 0, 0\n * );\n * Math details can be found\n * https://en.wikipedia.org/wiki/Gimbal_lock#Loss_of_a_degree_of_freedom_with_Euler_angles\n */\n xRad = Math.atan2(-m23, m22);\n zRad = 0;\n }\n break;\n } case AxisOrder.YXZ: {\n xRad = Math.asin(Math.max(-1, Math.min(1, m32))); // limit asin domain to [-1,1]\n\n if (Math.abs(m32) < 0.99999) {\n yRad = Math.atan2(-m31, m33);\n zRad = Math.atan2(-m12, m22);\n } else {\n yRad = Math.atan2(m13, m11);\n zRad = 0;\n }\n break;\n } case AxisOrder.ZXY: {\n xRad = Math.asin(Math.max(-1, Math.min(1, -m23))); // limit asin domain to [-1,1]\n\n if (Math.abs(m23) < 0.99999) {\n yRad = Math.atan2(m13, m33);\n zRad = Math.atan2(m21, m22);\n } else {\n yRad = 0;\n zRad = Math.atan2(-m12, m11);\n }\n break;\n } case AxisOrder.ZYX: {\n yRad = Math.asin(Math.max(-1, Math.min(1, m13))); // limit asin domain to [-1,1]\n\n if (Math.abs(m13) < 0.99999) {\n xRad = Math.atan2(-m23, m33);\n zRad = Math.atan2(-m12, m11);\n } else {\n xRad = 0;\n zRad = Math.atan2(m21, m22);\n }\n break;\n } case AxisOrder.YZX: {\n zRad = Math.asin(Math.max(-1, Math.min(1, -m12))); // limit asin domain to [-1,1]\n\n if (Math.abs(m12) < 0.99999) {\n xRad = Math.atan2(m32, m22);\n yRad = Math.atan2(m13, m11);\n } else {\n xRad = 0;\n yRad = Math.atan2(-m31, m33);\n }\n break;\n } case AxisOrder.XZY: {\n zRad = Math.asin(Math.max(-1, Math.min(1, m21))); // limit asin domain to [-1,1]\n\n if (Math.abs(m21) < 0.99999) {\n xRad = Math.atan2(-m23, m22);\n yRad = Math.atan2(-m31, m11);\n } else {\n xRad = Math.atan2(m32, m33);\n yRad = 0;\n }\n break;\n } default: {\n xRad = yRad = zRad = 0;\n }\n }\n const xyzRotationIsClockwise: [boolean, boolean, boolean] = [false, false, false];\n const angles = OrderedRotationAngles.createRadians(xRad, yRad, zRad, order, xyzRotationIsClockwise, result);\n // sanity check\n const matrix1 = angles.toMatrix3d();\n /**\n * Below tolerance loosened to allow sanity check to pass for\n *\n * OrderedRotationAngles.createFromMatrix3d(\n * OrderedRotationAngles.createDegrees(0, 89.999, 0.001, AxisOrder.XYZ).toMatrix3d(),\n * AxisOrder.XYZ\n * );\n *\n * with treatVectorsAsColumns = true.\n */\n return (matrix.maxDiff(matrix1) < 10 * Geometry.smallFraction) ? angles : undefined;\n }\n /**\n * Create a 3x3 rotational matrix from this OrderedRotationAngles.\n ** math details can be found at docs/learning/geometry/Angle.md\n **/\n public toMatrix3d(result?: Matrix3d): Matrix3d {\n const rot = (result !== undefined) ? result : new Matrix3d();\n const axisOrder = this.order;\n const x = this.xAngle, y = this.yAngle, z = this.zAngle;\n\n const cx = x.cos(), sx = x.sin();\n const cy = y.cos(), sy = y.sin();\n const cz = z.cos(), sz = z.sin();\n\n const cxcz = cx * cz, cxsz = cx * sz, cxcy = cx * cy, cxsy = cx * sy;\n const sxcz = sx * cz, sxsz = sx * sz, sxcy = sx * cy, sxsy = sx * sy;\n const cycz = cy * cz, cysz = cy * sz, sycz = sy * cz, sysz = sy * sz;\n\n // the rotation matrix we build below is created using column-based base rotation matrixes\n if (axisOrder === AxisOrder.XYZ) {\n rot.setRowValues(\n cy * cz, sxcz * sy - cxsz, cxcz * sy + sxsz,\n cy * sz, cxcz + sxsz * sy, cxsz * sy - sxcz,\n -sy, sx * cy, cx * cy,\n );\n } else if (axisOrder === AxisOrder.YXZ) {\n rot.setRowValues(\n cycz - sysz * sx, -cx * sz, cysz * sx + sycz,\n sycz * sx + cysz, cx * cz, sysz - cycz * sx,\n -cx * sy, sx, cx * cy,\n );\n } else if (axisOrder === AxisOrder.ZXY) {\n rot.setRowValues(\n cycz + sysz * sx, sycz * sx - cysz, cx * sy,\n cx * sz, cx * cz, -sx,\n cysz * sx - sycz, cycz * sx + sysz, cx * cy,\n );\n } else if (axisOrder === AxisOrder.ZYX) {\n rot.setRowValues(\n cy * cz, -cy * sz, sy,\n sxcz * sy + cxsz, cxcz - sxsz * sy, -sx * cy,\n sxsz - cxcz * sy, sxcz + cxsz * sy, cx * cy,\n );\n } else if (axisOrder === AxisOrder.YZX) {\n rot.setRowValues(\n cy * cz, -sz, sy * cz,\n sxsy + cxcy * sz, cx * cz, cxsy * sz - sxcy,\n sxcy * sz - cxsy, sx * cz, cxcy + sxsy * sz,\n );\n } else if (axisOrder === AxisOrder.XZY) {\n rot.setRowValues(\n cy * cz, sxsy - cxcy * sz, cxsy + sxcy * sz,\n sz, cx * cz, -sx * cz,\n -sy * cz, sxcy + cxsy * sz, cxcy - sxsy * sz,\n );\n } else {\n rot.setIdentity();\n }\n // if we need row-based rotation matrix, we transpose the rotation matrix\n if (!OrderedRotationAngles.treatVectorsAsColumns)\n rot.transposeInPlace();\n\n return rot;\n }\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"Plane3d.js","sourceRoot":"","sources":["../../../src/geometry3d/Plane3d.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;;;AAE/F;;GAEG;AACH,0CAA+D;AAE/D,uDAAsD;AAEtD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA0CG;AACH,MAAsB,OAAO;IAM3B,4EAA4E;IACrE,cAAc,CAAC,UAAmB,EAAE,YAAoB,mBAAQ,CAAC,mBAAmB;QACzF,OAAO,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,QAAQ,CAAC,UAAU,CAAC,CAAC,IAAI,SAAS,CAAC;IAC1D,CAAC;IACD;;;;OAIG;IACI,gBAAgB,CAAC,KAAc,EAAE,YAAoB,mBAAQ,CAAC,mBAAmB;QACtF,OAAO,mBAAQ,CAAC,WAAW,CAAC,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,EAAE,SAAS,CAAC,CAAC;IAC/D,CAAC;IACD;;;;OAIG;IACI,mBAAmB,CACxB,CAAS,EAAE,CAAS,EAAE,CAAS,EAAE,YAAoB,mBAAQ,CAAC,mBAAmB;QAEjF,OAAO,mBAAQ,CAAC,WAAW,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,EAAE,SAAS,CAAC,CAAC;IACpE,CAAC;IAmBD;;;;;;OAMG;IACI,aAAa,CAAC,MAAiB;QACpC,OAAO,0BAAQ,CAAC,gBAAgB,CAAC,IAAI,CAAC,OAAO,EAAE,EAAE,IAAI,CAAC,OAAO,EAAE,EAAE,IAAI,CAAC,OAAO,EAAE,EAAE,MAAM,CAAC,CAAC;IAC3F,CAAC;IACD;;;;;OAKG;IACI,kBAAkB,CAAC,MAAgB;QACxC,OAAO,IAAI,CAAC,iBAAiB,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,MAAM,CAAC,CAAC;IACjD,CAAC;IAgCD,uDAAuD;IAChD,iBAAiB,CAAC,CAAS,EAAE,CAAS,EAAE,CAAS,EAAE,MAAgB;QACxE,MAAM,KAAK,GAAG,yBAAO,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,MAAM,CAAC,CAAC;QAC9C,OAAO,IAAI,CAAC,mBAAmB,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC;IAChD,CAAC;CACF;AArGD,0BAqGC","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\nimport { Geometry, PlaneAltitudeEvaluator } from \"../Geometry\";\r\nimport { Point4d } from \"../geometry4d/Point4d\";\r\nimport { Point3d, Vector3d } from \"./Point3dVector3d\";\r\n\r\n/**\r\n * Plane3d is the abstract base class for multiple 3d plane representations:\r\n * * [[Plane3dByOriginAndUnitNormal]] -- plane defined by origin and normal, with no preferred in-plane directions\r\n * * [[Plane3dByOriginAndVectors]] -- plane defined by origin and 2 vectors in the plane, with normal implied by the vectors' cross product\r\n * * [[Point4d]] -- homogeneous form of xyzw plane.\r\n * * [[ClipPlane]] -- implicit plane with additional markup as used by compound clip structures such as [[ConvexClipPlaneSet]] and [[UnionOfConvexClipPlaneSets]]\r\n *\r\n * As an abstract base class, Plane3d demands that its derived classes implement queries to answer questions\r\n * about the plane's normal and the altitude of points above or below the plane. (Altitude is measured perpendicular to the plane.)\r\n * These abstract methods are:\r\n * * altitude(Point3d), altitudeXYZ(x,y,z), and altitudeXYZW(Point4d) -- evaluate altitude\r\n * * normalX(), normalY(), normalZ() -- return components of the plane's normal vector.\r\n * * velocity(Vector3d), velocityXYZ(x,y,z) -- return dot product of the input vector with the plane normal.\r\n * * projectPointToPlane (spacePoint: Point3d) -- return projection of spacePoint into the plane.\r\n *\r\n * The Plane3d base class also provides implementations of several queries which it can implement by calling the abstract queries.\r\n * * Derived classes may choose to override these default implementations using private knowledge of what they have stored.\r\n * * isPointInPlane(spacePoint, tolerance?) -- test if spacePoint is in the plane with tolerance. Default tolerance is small metric distance\r\n * * classifyAltitude (spacePoint, tolerance?), classifyAltitudeXYZ (x,y,z,tolerance?) -- return -1,0,1 indicating if spacePoint's altitude\r\n * is negative, near zero, or positive.\r\n *\r\n * Notes about scaling and signs in methods that compute altitudes, normal components and velocities:\r\n * * The term \"altitude\" indicates a _signed_ distance from the plane.\r\n * * altitude zero is _on_ the plane\r\n * * positive altitudes are on one side\r\n * * negatives are on the other.\r\n * * Altitude values and normal components are not strictly required to be true cartesian distance. If the calling code happens to use \"distance scaled by 1000X\" it\r\n * understands that it can be OK for its plane implementation to have that scaling.\r\n * * By convention, derived classes whose definitions (normals and vectors in plane) are simple cartesian are expected\r\n * to return true distances. This applies to:\r\n * * [[Plane3dByOriginAndUnitNormal]] and [[ClipPlane]]\r\n * * These maintain a stored unit normal so the altitude calculations are inherently true cartesian distance.\r\n * * [[Plane3dByOriginAndVectors]] -- this is a bit expensive because\r\n * * the normal is the cross product of the defining vectors.\r\n * * that cross product is not typically unit\r\n * * normalization adds to the cost of computing off-plane distances\r\n * * Since a main purpose of using this class is often to navigate a skewed, non-unit grid, occasional off-plane queries are not likely to be important.\r\n * * \"4 dimensional\" (homogeneous coordinate planes) ([[Point4d]] and [[PlaneByOriginAndVectors4d]])\r\n * * typically do _not_ force their coefficients to any distance-based normalization\r\n * * are typically used for calculations in spaces with skewing effects do to perspective, and true distances are not required.\r\n * * In all classes, the `weightedAltitude` method is free to be scaled distance.\r\n * @public\r\n */\r\nexport abstract class Plane3d implements PlaneAltitudeEvaluator {\r\n /**\r\n * Return the altitude of spacePoint above or below the plane. (Below is negative)\r\n * * MUST BE IMPLEMENTED BY DERIVED CLASSES\r\n */\r\n public abstract altitude(spacePoint: Point3d): number;\r\n /** Returns true if spacePoint is within distance tolerance of the plane. */\r\n public isPointInPlane(spacePoint: Point3d, tolerance: number = Geometry.smallMetricDistance): boolean {\r\n return Math.abs(this.altitude(spacePoint)) <= tolerance;\r\n }\r\n /**\r\n * Return a value -1, 0, 1 giving a signed indicator of whether the toleranced altitude of the point is\r\n * negative, near zero, or positive.\r\n *\r\n */\r\n public classifyAltitude(point: Point3d, tolerance: number = Geometry.smallMetricDistance): -1 | 0 | 1 {\r\n return Geometry.split3Way01(this.altitude(point), tolerance);\r\n }\r\n /**\r\n * Return a value -1, 0, 1 giving a signed indicator of whether the toleranced altitude of x,y,z is\r\n * negative, near zero, or positive.\r\n *\r\n */\r\n public classifyAltitudeXYZ(\r\n x: number, y: number, z: number, tolerance: number = Geometry.smallMetricDistance,\r\n ): -1 | 0 | 1 {\r\n return Geometry.split3Way01(this.altitudeXYZ(x, y, z), tolerance);\r\n }\r\n /**\r\n * Return the x component of the normal used to evaluate altitude.\r\n * * MUST BE IMPLEMENTED BY DERIVED CLASSES\r\n * * See [[Plane3d]] note about scaling.\r\n */\r\n public abstract normalX(): number;\r\n /**\r\n * Return the y component of the normal used to evaluate altitude.\r\n * * MUST BE IMPLEMENTED BY DERIVED CLASSES\r\n * * See [[Plane3d]] note about scaling.\r\n */\r\n public abstract normalY(): number;\r\n /**\r\n * Return the z component of the normal used to evaluate altitude.\r\n * * MUST BE IMPLEMENTED BY DERIVED CLASSES\r\n * * See [[Plane3d]] note about scaling.\r\n */\r\n public abstract normalZ(): number;\r\n /**\r\n * Return the unit normal for the plane.\r\n * * The abstract base class implementation assembles the normal from normalX, normalY, normalZ calls.\r\n * * Derived classes should (but are not required to) override for maximum efficiency if the separate normal calls\r\n * cause repeated normalization.\r\n * @param result\r\n */\r\n public getUnitNormal(result?: Vector3d): Vector3d | undefined {\r\n return Vector3d.createNormalized(this.normalX(), this.normalY(), this.normalZ(), result);\r\n }\r\n /**\r\n * Return any point on the plane.\r\n * * Default implementation projects the origin (0,0,0) to the plane.\r\n * * Classes that have a preferred origin for their plane should override.\r\n * * Classes with a purely implicit equation of their plane can accept the default implementation\r\n */\r\n public getAnyPointOnPlane(result?: Point3d): Point3d {\r\n return this.projectXYZToPlane(0, 0, 0, result);\r\n }\r\n /**\r\n * Return the altitude of weighted spacePoint above or below the plane. (Below is negative)\r\n * * MUST BE IMPLEMENTED BY DERIVED CLASSES\r\n * * See [[Plane3d]] note about scaling.\r\n */\r\n public abstract weightedAltitude(spacePoint: Point4d): number;\r\n /**\r\n * Return the dot product of spaceVector (x,y,z) with the plane's unit normal. This tells the rate of change of\r\n * altitude for a point moving at speed one along the spaceVector.\r\n * * MUST BE IMPLEMENTED BY DERIVED CLASSES\r\n * * See [[Plane3d]] note about scaling.\r\n */\r\n public abstract velocityXYZ(x: number, y: number, z: number): number;\r\n /**\r\n * Return the dot product of spaceVector with the plane's unit normal. This tells the rate of change of altitude\r\n * for a point moving at speed one along the spaceVector.\r\n * * MUST BE IMPLEMENTED BY DERIVED CLASSES\r\n * * See [[Plane3d]] note about scaling.\r\n */\r\n public abstract velocity(spaceVector: Vector3d): number;\r\n /**\r\n * Return the altitude of a point given as separate x,y,z components.\r\n * * MUST BE IMPLEMENTED BY DERIVED CLASSES\r\n * * See [[Plane3d]] note about scaling.\r\n */\r\n public abstract altitudeXYZ(x: number, y: number, z: number): number;\r\n /**\r\n * Return the projection of spacePoint onto the plane.\r\n * * MUST BE IMPLEMENTED BY DERIVED CLASSES\r\n */\r\n public abstract projectPointToPlane(spacePoint: Point3d, result?: Point3d): Point3d;\r\n /** Return the projection of (x,y,z) onto the plane. */\r\n public projectXYZToPlane(x: number, y: number, z: number, result?: Point3d): Point3d {\r\n const point = Point3d.create(x, y, z, result);\r\n return this.projectPointToPlane(point, point);\r\n }\r\n}\r\n"]}
1
+ {"version":3,"file":"Plane3d.js","sourceRoot":"","sources":["../../../src/geometry3d/Plane3d.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;;;AAE/F;;GAEG;AACH,0CAA+D;AAE/D,uDAAsD;AAEtD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA0CG;AACH,MAAsB,OAAO;IAM3B,4EAA4E;IACrE,cAAc,CAAC,UAAmB,EAAE,YAAoB,mBAAQ,CAAC,mBAAmB;QACzF,OAAO,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,QAAQ,CAAC,UAAU,CAAC,CAAC,IAAI,SAAS,CAAC;IAC1D,CAAC;IACD;;;;OAIG;IACI,gBAAgB,CAAC,KAAc,EAAE,YAAoB,mBAAQ,CAAC,mBAAmB;QACtF,OAAO,mBAAQ,CAAC,WAAW,CAAC,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,EAAE,SAAS,CAAC,CAAC;IAC/D,CAAC;IACD;;;;OAIG;IACI,mBAAmB,CACxB,CAAS,EAAE,CAAS,EAAE,CAAS,EAAE,YAAoB,mBAAQ,CAAC,mBAAmB;QAEjF,OAAO,mBAAQ,CAAC,WAAW,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,EAAE,SAAS,CAAC,CAAC;IACpE,CAAC;IAmBD;;;;;;OAMG;IACI,aAAa,CAAC,MAAiB;QACpC,OAAO,0BAAQ,CAAC,gBAAgB,CAAC,IAAI,CAAC,OAAO,EAAE,EAAE,IAAI,CAAC,OAAO,EAAE,EAAE,IAAI,CAAC,OAAO,EAAE,EAAE,MAAM,CAAC,CAAC;IAC3F,CAAC;IACD;;;;;OAKG;IACI,kBAAkB,CAAC,MAAgB;QACxC,OAAO,IAAI,CAAC,iBAAiB,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,MAAM,CAAC,CAAC;IACjD,CAAC;IAgCD,uDAAuD;IAChD,iBAAiB,CAAC,CAAS,EAAE,CAAS,EAAE,CAAS,EAAE,MAAgB;QACxE,MAAM,KAAK,GAAG,yBAAO,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,MAAM,CAAC,CAAC;QAC9C,OAAO,IAAI,CAAC,mBAAmB,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC;IAChD,CAAC;CACF;AArGD,0BAqGC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n\n/** @packageDocumentation\n * @module CartesianGeometry\n */\nimport { Geometry, PlaneAltitudeEvaluator } from \"../Geometry\";\nimport { Point4d } from \"../geometry4d/Point4d\";\nimport { Point3d, Vector3d } from \"./Point3dVector3d\";\n\n/**\n * Plane3d is the abstract base class for multiple 3d plane representations:\n * * [[Plane3dByOriginAndUnitNormal]] -- plane defined by origin and normal, with no preferred in-plane directions\n * * [[Plane3dByOriginAndVectors]] -- plane defined by origin and 2 vectors in the plane, with normal implied by the vectors' cross product\n * * [[Point4d]] -- homogeneous form of xyzw plane.\n * * [[ClipPlane]] -- implicit plane with additional markup as used by compound clip structures such as [[ConvexClipPlaneSet]] and [[UnionOfConvexClipPlaneSets]]\n *\n * As an abstract base class, Plane3d demands that its derived classes implement queries to answer questions\n * about the plane's normal and the altitude of points above or below the plane. (Altitude is measured perpendicular to the plane.)\n * These abstract methods are:\n * * altitude(Point3d), altitudeXYZ(x,y,z), and altitudeXYZW(Point4d) -- evaluate altitude\n * * normalX(), normalY(), normalZ() -- return components of the plane's normal vector.\n * * velocity(Vector3d), velocityXYZ(x,y,z) -- return dot product of the input vector with the plane normal.\n * * projectPointToPlane (spacePoint: Point3d) -- return projection of spacePoint into the plane.\n *\n * The Plane3d base class also provides implementations of several queries which it can implement by calling the abstract queries.\n * * Derived classes may choose to override these default implementations using private knowledge of what they have stored.\n * * isPointInPlane(spacePoint, tolerance?) -- test if spacePoint is in the plane with tolerance. Default tolerance is small metric distance\n * * classifyAltitude (spacePoint, tolerance?), classifyAltitudeXYZ (x,y,z,tolerance?) -- return -1,0,1 indicating if spacePoint's altitude\n * is negative, near zero, or positive.\n *\n * Notes about scaling and signs in methods that compute altitudes, normal components and velocities:\n * * The term \"altitude\" indicates a _signed_ distance from the plane.\n * * altitude zero is _on_ the plane\n * * positive altitudes are on one side\n * * negatives are on the other.\n * * Altitude values and normal components are not strictly required to be true cartesian distance. If the calling code happens to use \"distance scaled by 1000X\" it\n * understands that it can be OK for its plane implementation to have that scaling.\n * * By convention, derived classes whose definitions (normals and vectors in plane) are simple cartesian are expected\n * to return true distances. This applies to:\n * * [[Plane3dByOriginAndUnitNormal]] and [[ClipPlane]]\n * * These maintain a stored unit normal so the altitude calculations are inherently true cartesian distance.\n * * [[Plane3dByOriginAndVectors]] -- this is a bit expensive because\n * * the normal is the cross product of the defining vectors.\n * * that cross product is not typically unit\n * * normalization adds to the cost of computing off-plane distances\n * * Since a main purpose of using this class is often to navigate a skewed, non-unit grid, occasional off-plane queries are not likely to be important.\n * * \"4 dimensional\" (homogeneous coordinate planes) ([[Point4d]] and [[PlaneByOriginAndVectors4d]])\n * * typically do _not_ force their coefficients to any distance-based normalization\n * * are typically used for calculations in spaces with skewing effects do to perspective, and true distances are not required.\n * * In all classes, the `weightedAltitude` method is free to be scaled distance.\n * @public\n */\nexport abstract class Plane3d implements PlaneAltitudeEvaluator {\n /**\n * Return the altitude of spacePoint above or below the plane. (Below is negative)\n * * MUST BE IMPLEMENTED BY DERIVED CLASSES\n */\n public abstract altitude(spacePoint: Point3d): number;\n /** Returns true if spacePoint is within distance tolerance of the plane. */\n public isPointInPlane(spacePoint: Point3d, tolerance: number = Geometry.smallMetricDistance): boolean {\n return Math.abs(this.altitude(spacePoint)) <= tolerance;\n }\n /**\n * Return a value -1, 0, 1 giving a signed indicator of whether the toleranced altitude of the point is\n * negative, near zero, or positive.\n *\n */\n public classifyAltitude(point: Point3d, tolerance: number = Geometry.smallMetricDistance): -1 | 0 | 1 {\n return Geometry.split3Way01(this.altitude(point), tolerance);\n }\n /**\n * Return a value -1, 0, 1 giving a signed indicator of whether the toleranced altitude of x,y,z is\n * negative, near zero, or positive.\n *\n */\n public classifyAltitudeXYZ(\n x: number, y: number, z: number, tolerance: number = Geometry.smallMetricDistance,\n ): -1 | 0 | 1 {\n return Geometry.split3Way01(this.altitudeXYZ(x, y, z), tolerance);\n }\n /**\n * Return the x component of the normal used to evaluate altitude.\n * * MUST BE IMPLEMENTED BY DERIVED CLASSES\n * * See [[Plane3d]] note about scaling.\n */\n public abstract normalX(): number;\n /**\n * Return the y component of the normal used to evaluate altitude.\n * * MUST BE IMPLEMENTED BY DERIVED CLASSES\n * * See [[Plane3d]] note about scaling.\n */\n public abstract normalY(): number;\n /**\n * Return the z component of the normal used to evaluate altitude.\n * * MUST BE IMPLEMENTED BY DERIVED CLASSES\n * * See [[Plane3d]] note about scaling.\n */\n public abstract normalZ(): number;\n /**\n * Return the unit normal for the plane.\n * * The abstract base class implementation assembles the normal from normalX, normalY, normalZ calls.\n * * Derived classes should (but are not required to) override for maximum efficiency if the separate normal calls\n * cause repeated normalization.\n * @param result\n */\n public getUnitNormal(result?: Vector3d): Vector3d | undefined {\n return Vector3d.createNormalized(this.normalX(), this.normalY(), this.normalZ(), result);\n }\n /**\n * Return any point on the plane.\n * * Default implementation projects the origin (0,0,0) to the plane.\n * * Classes that have a preferred origin for their plane should override.\n * * Classes with a purely implicit equation of their plane can accept the default implementation\n */\n public getAnyPointOnPlane(result?: Point3d): Point3d {\n return this.projectXYZToPlane(0, 0, 0, result);\n }\n /**\n * Return the altitude of weighted spacePoint above or below the plane. (Below is negative)\n * * MUST BE IMPLEMENTED BY DERIVED CLASSES\n * * See [[Plane3d]] note about scaling.\n */\n public abstract weightedAltitude(spacePoint: Point4d): number;\n /**\n * Return the dot product of spaceVector (x,y,z) with the plane's unit normal. This tells the rate of change of\n * altitude for a point moving at speed one along the spaceVector.\n * * MUST BE IMPLEMENTED BY DERIVED CLASSES\n * * See [[Plane3d]] note about scaling.\n */\n public abstract velocityXYZ(x: number, y: number, z: number): number;\n /**\n * Return the dot product of spaceVector with the plane's unit normal. This tells the rate of change of altitude\n * for a point moving at speed one along the spaceVector.\n * * MUST BE IMPLEMENTED BY DERIVED CLASSES\n * * See [[Plane3d]] note about scaling.\n */\n public abstract velocity(spaceVector: Vector3d): number;\n /**\n * Return the altitude of a point given as separate x,y,z components.\n * * MUST BE IMPLEMENTED BY DERIVED CLASSES\n * * See [[Plane3d]] note about scaling.\n */\n public abstract altitudeXYZ(x: number, y: number, z: number): number;\n /**\n * Return the projection of spacePoint onto the plane.\n * * MUST BE IMPLEMENTED BY DERIVED CLASSES\n */\n public abstract projectPointToPlane(spacePoint: Point3d, result?: Point3d): Point3d;\n /** Return the projection of (x,y,z) onto the plane. */\n public projectXYZToPlane(x: number, y: number, z: number, result?: Point3d): Point3d {\n const point = Point3d.create(x, y, z, result);\n return this.projectPointToPlane(point, point);\n }\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"Plane3dByOriginAndUnitNormal.js","sourceRoot":"","sources":["../../../src/geometry3d/Plane3dByOriginAndUnitNormal.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;;;AAE/F;;GAEG;AACH,0CAAmE;AACnE,uCAAoC;AAGpC,yCAAsC;AACtC,uDAAsD;AACtD,2CAAwC;AAGxC;;;;;GAKG;AACH,MAAa,4BAA6B,SAAQ,iBAAO;IAC/C,OAAO,CAAU;IACjB,OAAO,CAAW;IAC1B,sCAAsC;IACtC,YAAoB,MAAe,EAAE,MAAgB;QACnD,KAAK,EAAE,CAAC;QACR,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC;QACtB,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC;IACxB,CAAC;IACD,yEAAyE;IACjE,MAAM,CAAC,OAAO,CAAC,CAAS,EAAE,CAAS,EAAE,CAAS,EAAE,CAAS,EAAE,CAAS,EAAE,CAAS;QACrF,OAAO,IAAI,4BAA4B,CAAC,yBAAO,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,EAAE,0BAAQ,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;IAC7F,CAAC;IACD;;;OAGG;IACI,MAAM,CAAC,aAAa,CAAC,MAAgB;QAC1C,IAAI,MAAM;YACR,OAAO,4BAA4B,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;QACrF,OAAO,4BAA4B,CAAC,OAAO,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;IAChE,CAAC;IACD;;;OAGG;IACI,M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AAC,CAAC;QACzE,OAAO,yBAAO,CAAC,MAAM,CAAC,CAAC,GAAG,KAAK,GAAG,IAAI,CAAC,OAAO,CAAC,CAAC,EAAE,CAAC,GAAG,KAAK,GAAG,IAAI,CAAC,OAAO,CAAC,CAAC,EAAE,CAAC,GAAG,KAAK,GAAG,IAAI,CAAC,OAAO,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC;IACpH,CAAC;IACD;;;OAGG;IACa,cAAc,CAAC,UAAmB,EAAE,YAAoB,mBAAQ,CAAC,mBAAmB;QAClG,MAAM,QAAQ,GAAG,IAAI,CAAC,OAAO,CAAC,kBAAkB,CAAC,IAAI,CAAC,OAAO,EAAE,UAAU,CAAC,CAAC;QAC3E,OAAO,IAAI,CAAC,GAAG,CAAC,QAAQ,CAAC,IAAI,SAAS,CAAC;IACzC,CAAC;CACF;AA/UD,oEA+UC","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\nimport { AxisOrder, BeJSONFunctions, Geometry } from \"../Geometry\";\r\nimport { Plane3d } from \"./Plane3d\";\r\nimport { Point4d } from \"../geometry4d/Point4d\";\r\nimport { Angle } from \"./Angle\";\r\nimport { Matrix3d } from \"./Matrix3d\";\r\nimport { Point3d, Vector3d } from \"./Point3dVector3d\";\r\nimport { Transform } from \"./Transform\";\r\nimport { XAndY } from \"./XYZProps\";\r\n\r\n/**\r\n * A plane defined by\r\n * * Any point on the plane.\r\n * * a unit normal.\r\n * @public\r\n */\r\nexport class Plane3dByOriginAndUnitNormal extends Plane3d implements BeJSONFunctions {\r\n private _origin: Point3d;\r\n private _normal: Vector3d;\r\n // constructor captures references !!!\r\n private constructor(origin: Point3d, normal: Vector3d) {\r\n super();\r\n this._origin = origin;\r\n this._normal = normal;\r\n }\r\n // This is private because it does not check validity of the unit vector.\r\n private static _create(x: number, y: number, z: number, u: number, v: number, w: number) {\r\n return new Plane3dByOriginAndUnitNormal(Point3d.create(x, y, z), Vector3d.create(u, v, w));\r\n }\r\n /**\r\n * Create a plane parallel to the XY plane\r\n * @param origin optional plane origin. If omitted, the origin is placed at 000\r\n */\r\n public static createXYPlane(origin?: Point3d): Plane3dByOriginAndUnitNormal {\r\n if (origin)\r\n return Plane3dByOriginAndUnitNormal._create(origin.x, origin.y, origin.z, 0, 0, 1);\r\n return Plane3dByOriginAndUnitNormal._create(0, 0, 0, 0, 0, 1);\r\n }\r\n /**\r\n * Create a plane parallel to the YZ plane\r\n * @param origin optional plane origin. If omitted, the origin is placed at 000\r\n */\r\n public static createYZPlane(origin?: Point3d): Plane3dByOriginAndUnitNormal {\r\n if (origin)\r\n return Plane3dByOriginAndUnitNormal._create(origin.x, origin.y, origin.z, 1, 0, 0);\r\n return Plane3dByOriginAndUnitNormal._create(0, 0, 0, 1, 0, 0);\r\n }\r\n /**\r\n * Create a plane parallel to the ZX plane\r\n * @param origin optional plane origin. If omitted, the origin is placed at 000\r\n */\r\n public static createZXPlane(origin?: Point3d): Plane3dByOriginAndUnitNormal {\r\n if (origin)\r\n return Plane3dByOriginAndUnitNormal._create(origin.x, origin.y, origin.z, 0, 1, 0);\r\n return Plane3dByOriginAndUnitNormal._create(0, 0, 0, 0, 1, 0);\r\n }\r\n /**\r\n * Create a new Plane3dByOriginAndUnitNormal with given origin and normal.\r\n * * The inputs are NOT captured.\r\n * * Returns undefined if `normal.normalize()` returns undefined.\r\n */\r\n public static create(\r\n origin: Point3d, normal: Vector3d, result?: Plane3dByOriginAndUnitNormal,\r\n ): Plane3dByOriginAndUnitNormal | undefined {\r\n if (result) {\r\n if (normal.normalize(result._normal) === undefined)\r\n return undefined;\r\n origin.clone(result._origin);\r\n return result;\r\n }\r\n const normalized = normal.normalize();\r\n if (normalized === undefined)\r\n return undefined;\r\n return new Plane3dByOriginAndUnitNormal(origin.clone(), normalized);\r\n }\r\n /**\r\n * Create a new Plane3dByOriginAndUnitNormal from a variety of plane types.\r\n * * The inputs are NOT captured.\r\n * * Returns undefined if `source.getUnitNormal()` returns undefined.\r\n */\r\n public static createFrom(\r\n source: Plane3d, result?: Plane3dByOriginAndUnitNormal,\r\n ): Plane3dByOriginAndUnitNormal | undefined {\r\n if (source instanceof Plane3dByOriginAndUnitNormal)\r\n return source.clone(result);\r\n if (result) {\r\n if (source.getUnitNormal(result._normal) === undefined)\r\n return undefined;\r\n source.getAnyPointOnPlane(result._origin);\r\n return result;\r\n }\r\n const normal = source.getUnitNormal();\r\n if (normal === undefined)\r\n return undefined;\r\n const origin = source.getAnyPointOnPlane();\r\n return new Plane3dByOriginAndUnitNormal(origin, normal);\r\n }\r\n /**\r\n * Create a new Plane3dByOriginAndUnitNormal with direct coordinates of origin and normal.\r\n * * Returns undefined if the normal vector is all zeros.\r\n * * If unable to normalize return undefined. (And if result is given it is left unchanged)\r\n */\r\n public static createXYZUVW(\r\n ax: number, ay: number, az: number, ux: number, uy: number, uz: number, result?: Plane3dByOriginAndUnitNormal,\r\n ): Plane3dByOriginAndUnitNormal | undefined {\r\n const magU = Geometry.hypotenuseXYZ(ux, uy, uz);\r\n if (magU < Geometry.smallMetricDistance)\r\n return undefined;\r\n if (result) {\r\n result._origin.set(ax, ay, az);\r\n result._normal.set(ux / magU, uy / magU, uz / magU);\r\n return result;\r\n }\r\n return new Plane3dByOriginAndUnitNormal(Point3d.create(ax, ay, az), Vector3d.create(ux / magU, uy / magU, uz / magU));\r\n }\r\n /**\r\n * Create a new Plane3dByOriginAndUnitNormal with unit normal (a) in the xy plane (b) perpendicular to the line\r\n * defined by xy parts of origin to target.\r\n * * origin and normal both have z = 0.\r\n * * The inputs are NOT captured.\r\n * * Returns undefined if the normal vector is all zeros.\r\n */\r\n public static createOriginAndTargetXY(\r\n origin: XAndY, target: XAndY, result?: Plane3dByOriginAndUnitNormal,\r\n ): Plane3dByOriginAndUnitNormal | undefined {\r\n const ux = target.x - origin.x;\r\n const uy = target.y - origin.y;\r\n return this.createXYZUVW(origin.x, origin.y, 0.0, uy, -ux, 0.0, result);\r\n }\r\n /**\r\n * Create a new Plane3dByOriginAndUnitNormal with xy origin (at z=0) and normal angle in xy plane.\r\n * * Returns undefined if the normal vector is all zeros.\r\n */\r\n public static createXYAngle(\r\n x: number, y: number, normalAngleFromX: Angle, result?: Plane3dByOriginAndUnitNormal,\r\n ): Plane3dByOriginAndUnitNormal {\r\n if (result) {\r\n result._origin.set(x, y, 0.0);\r\n result._normal.set(normalAngleFromX.cos(), normalAngleFromX.sin(), 0.0);\r\n return result;\r\n }\r\n return new Plane3dByOriginAndUnitNormal(\r\n Point3d.create(x, y, 0), Vector3d.create(normalAngleFromX.cos(), normalAngleFromX.sin()),\r\n );\r\n }\r\n /**\r\n * Create a plane defined by two points and an in-plane vector.\r\n * @param pointA any point in the plane\r\n * @param pointB any other point in the plane\r\n * @param vector any vector in the plane but not parallel to the vector from pointA to pointB\r\n */\r\n public static createPointPointVectorInPlane(\r\n pointA: Point3d, pointB: Point3d, vector: Vector3d,\r\n ): Plane3dByOriginAndUnitNormal | undefined {\r\n const cross = vector.crossProductStartEnd(pointA, pointB);\r\n if (cross.tryNormalizeInPlace())\r\n return new Plane3dByOriginAndUnitNormal(pointA, cross);\r\n return undefined;\r\n }\r\n /**\r\n * Create a plane defined by three points.\r\n * @param pointA any point in the plane. This will be the origin.\r\n * @param pointB any other point in the plane\r\n * @param pointC any third point in the plane but not on the line of pointA and pointB\r\n */\r\n public static createOriginAndTargets(\r\n pointA: Point3d, pointB: Point3d, pointC: Point3d,\r\n ): Plane3dByOriginAndUnitNormal | undefined {\r\n const cross = pointA.crossProductToPoints(pointB, pointC);\r\n if (cross.tryNormalizeInPlace())\r\n return new Plane3dByOriginAndUnitNormal(pointA, cross);\r\n return undefined;\r\n }\r\n /**\r\n * Create a plane defined by a point and two vectors in the plane\r\n * @param pointA any point in the plane\r\n * @param vectorB any vector in the plane\r\n * @param vectorC any vector in the plane but not parallel to vectorB\r\n */\r\n public static createOriginAndVectors(\r\n pointA: Point3d, vectorB: Vector3d, vectorC: Vector3d,\r\n ): Plane3dByOriginAndUnitNormal | undefined {\r\n const cross = vectorB.crossProduct(vectorC);\r\n if (cross.tryNormalizeInPlace())\r\n return new Plane3dByOriginAndUnitNormal(pointA, cross);\r\n return undefined;\r\n }\r\n /** Test for (toleranced) equality with `other` */\r\n public isAlmostEqual(other: Plane3dByOriginAndUnitNormal): boolean {\r\n return this._origin.isAlmostEqual(other._origin) && this._normal.isAlmostEqual(other._normal);\r\n }\r\n /** Parse a json fragment `{origin: [x,y,z], normal: [ux,uy,uz]}` */\r\n public setFromJSON(json?: any): void {\r\n if (!json) {\r\n this._origin.set(0, 0, 0);\r\n this._normal.set(0, 0, 1);\r\n } else {\r\n this._origin.setFromJSON(json.origin);\r\n this._normal.setFromJSON(json.normal);\r\n }\r\n }\r\n /**\r\n * Convert to a JSON object.\r\n * @return {*} [origin,normal]\r\n */\r\n public toJSON(): any {\r\n return { origin: this._origin.toJSON(), normal: this._normal.toJSON() };\r\n }\r\n /**\r\n * Create a new Plane3dByOriginAndUnitNormal from json fragment.\r\n * * See `Plane3dByOriginAndUnitNormal.setFromJSON`\r\n */\r\n public static fromJSON(json?: any): Plane3dByOriginAndUnitNormal {\r\n const result = Plane3dByOriginAndUnitNormal.createXYPlane();\r\n result.setFromJSON(json);\r\n return result;\r\n }\r\n /** Return a reference to the origin. */\r\n public getOriginRef(): Point3d {\r\n return this._origin;\r\n }\r\n /** Return a reference to the unit normal. */\r\n public getNormalRef(): Vector3d {\r\n return this._normal;\r\n }\r\n /**\r\n * Return coordinate axes (as a transform) with\r\n * * origin at plane origin\r\n * * z axis in direction of plane normal.\r\n * * x,y axes in plane.\r\n */\r\n public getLocalToWorld(): Transform {\r\n const axes = Matrix3d.createRigidHeadsUp(this._normal, AxisOrder.ZXY);\r\n return Transform.createRefs(this._origin.clone(), axes);\r\n }\r\n /** Return a (singular) transform which projects points to this plane. */\r\n public getProjectionToPlane(): Transform {\r\n const axes = Matrix3d.createIdentity();\r\n axes.addScaledOuterProductInPlace(this._normal, this._normal, -1.0);\r\n axes.markSingular();\r\n return Transform.createFixedPointAndMatrix(this._origin, axes);\r\n }\r\n /** Copy coordinates from the given origin and normal. */\r\n public set(origin: Point3d, normal: Vector3d): void {\r\n this._origin.setFrom(origin);\r\n this._normal.setFrom(normal);\r\n }\r\n /** Return a deep clone (point and normal cloned) */\r\n public clone(result?: Plane3dByOriginAndUnitNormal): Plane3dByOriginAndUnitNormal {\r\n if (result) {\r\n result.set(this._origin, this._normal);\r\n return result;\r\n }\r\n return new Plane3dByOriginAndUnitNormal(this._origin.clone(), this._normal.clone());\r\n }\r\n /** Create a clone and return the transform of the clone. */\r\n public cloneTransformed(transform: Transform, inverse: boolean = false): Plane3dByOriginAndUnitNormal | undefined {\r\n const result = this.clone();\r\n if (inverse) {\r\n transform.multiplyInversePoint3d(result._origin, result._origin);\r\n if (transform.matrix.multiplyTransposeVector(result._normal, result._normal) !== undefined\r\n && result._normal.normalizeInPlace())\r\n return result;\r\n } else {\r\n transform.multiplyPoint3d(result._origin, result._origin);\r\n if (transform.matrix.multiplyInverseTranspose(result._normal, result._normal) !== undefined\r\n && result._normal.normalizeInPlace())\r\n return result;\r\n }\r\n return undefined;\r\n }\r\n /** Copy data from the given plane. */\r\n public setFrom(source: Plane3dByOriginAndUnitNormal): void {\r\n this.set(source._origin, source._normal);\r\n }\r\n /** Return the altitude of spacePoint above or below the plane. (Below is negative) */\r\n public altitude(spacePoint: Point3d): number {\r\n return this._normal.dotProductStartEnd(this._origin, spacePoint);\r\n }\r\n /** Return the altitude of point (x,y) given xy parts using only the xy parts of origin and unit normal */\r\n public altitudeXY(x: number, y: number): number {\r\n return (x - this._origin.x) * this._normal.x + (y - this._origin.y) * this._normal.y;\r\n }\r\n /** Return the x component of the normal used to evaluate altitude. */\r\n public normalX(): number {\r\n return this._normal.x;\r\n }\r\n /** Return the x component of the normal used to evaluate altitude. */\r\n public normalY(): number {\r\n return this._normal.y;\r\n }\r\n /** Return the z component of the normal used to evaluate altitude. */\r\n public normalZ(): number {\r\n return this._normal.z;\r\n }\r\n /** Return (a clone of) the unit normal. */\r\n public override getUnitNormal(result?: Vector3d): Vector3d | undefined {\r\n return this._normal.clone(result);\r\n }\r\n /** Return (a clone of) the origin. */\r\n public override getAnyPointOnPlane(result?: Point3d): Point3d {\r\n // This function returns the plane origin. In general, a point x is on the plane if and only if (x-o).n = 0.\r\n return this._origin.clone(result);\r\n }\r\n /** Return the signed altitude of weighted spacePoint above or below the plane. (Below is negative) */\r\n public weightedAltitude(spacePoint: Point4d): number {\r\n return this._normal.dotProductStart3dEnd4d(this._origin, spacePoint);\r\n }\r\n /** Return any point at specified (signed) altitude. */\r\n public altitudeToPoint(altitude: number, result?: Point3d): Point3d {\r\n return this._origin.plusScaled(this._normal, altitude, result);\r\n }\r\n /**\r\n * Return the dot product of spaceVector with the plane's unit normal. This tells the rate of change of altitude\r\n * for a point moving at speed one along the spaceVector.\r\n */\r\n public velocityXYZ(x: number, y: number, z: number): number {\r\n return this._normal.dotProductXYZ(x, y, z);\r\n }\r\n /**\r\n * Return the dot product of spaceVector with the plane's unit normal. This tells the rate of change of altitude\r\n * for a point moving at speed one along the spaceVector.\r\n */\r\n public velocity(spaceVector: Vector3d): number {\r\n return this._normal.dotProduct(spaceVector);\r\n }\r\n /** Return the altitude of a point given as separate x,y,z components. */\r\n public altitudeXYZ(x: number, y: number, z: number): number {\r\n return this._normal.dotProductStartEndXYZ(this._origin, x, y, z);\r\n }\r\n /** Return the altitude of a point given as separate x,y,z,w components. */\r\n public altitudeXYZW(x: number, y: number, z: number, w: number): number {\r\n return this._normal.dotProductStartEndXYZW(this._origin, x, y, z, w);\r\n }\r\n /** Return the projection of spacePoint onto the plane. */\r\n public projectPointToPlane(spacePoint: Point3d, result?: Point3d): Point3d {\r\n return this.projectXYZToPlane(spacePoint.x, spacePoint.y, spacePoint.z, result);\r\n }\r\n /** Return the projection of (x,y,z) onto the plane. */\r\n public override projectXYZToPlane(x: number, y: number, z: number, result?: Point3d): Point3d {\r\n const scale = -this._normal.dotProductStartEndXYZ(this._origin, x, y, z);\r\n return Point3d.create(x + scale * this._normal.x, y + scale * this._normal.y, z + scale * this._normal.z, result);\r\n }\r\n /**\r\n * Returns true if spacePoint is within distance tolerance of the plane.\r\n * * This logic is identical to the [[Plane3d]] method but avoids a level of function call.\r\n */\r\n public override isPointInPlane(spacePoint: Point3d, tolerance: number = Geometry.smallMetricDistance): boolean {\r\n const altitude = this._normal.dotProductStartEnd(this._origin, spacePoint);\r\n return Math.abs(altitude) <= tolerance;\r\n }\r\n}\r\n"]}
1
+ {"version":3,"file":"Plane3dByOriginAndUnitNormal.js","sourceRoot":"","sources":["../../../src/geometry3d/Plane3dByOriginAndUnitNormal.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;;;AAE/F;;GAEG;AACH,0CAAmE;AACnE,uCAAoC;AAGpC,yCAAsC;AACtC,uDAAsD;AACtD,2CAAwC;AAGxC;;;;;GAKG;AACH,MAAa,4BAA6B,SAAQ,iBAAO;IAC/C,OAAO,CAAU;IACjB,OAAO,CAAW;IAC1B,sCAAsC;IACtC,YAAoB,MAAe,EAAE,MAAgB;QACnD,KAAK,EAAE,CAAC;QACR,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC;QACtB,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC;IACxB,CAAC;IACD,yEAAyE;IACjE,MAAM,CAAC,OAAO,CAAC,CAAS,EAAE,CAAS,EAAE,CAAS,EAAE,CAAS,EAAE,CAAS,EAAE,CAAS;QACrF,OAAO,IAAI,4BAA4B,CAAC,yBAAO,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,EAAE,0BAAQ,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;IAC7F,CAAC;IACD;;;OA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B,EAAE,MAAgB;QAC9D,OAAO,IAAI,CAAC,iBAAiB,CAAC,UAAU,CAAC,CAAC,EAAE,UAAU,CAAC,CAAC,EAAE,UAAU,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC;IAClF,CAAC;IACD,uDAAuD;IACvC,iBAAiB,CAAC,CAAS,EAAE,CAAS,EAAE,CAAS,EAAE,MAAgB;QACjF,MAAM,KAAK,GAAG,CAAC,IAAI,CAAC,OAAO,CAAC,qBAAqB,CAAC,IAAI,CAAC,OAAO,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;QACzE,OAAO,yBAAO,CAAC,MAAM,CAAC,CAAC,GAAG,KAAK,GAAG,IAAI,CAAC,OAAO,CAAC,CAAC,EAAE,CAAC,GAAG,KAAK,GAAG,IAAI,CAAC,OAAO,CAAC,CAAC,EAAE,CAAC,GAAG,KAAK,GAAG,IAAI,CAAC,OAAO,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC;IACpH,CAAC;IACD;;;OAGG;IACa,cAAc,CAAC,UAAmB,EAAE,YAAoB,mBAAQ,CAAC,mBAAmB;QAClG,MAAM,QAAQ,GAAG,IAAI,CAAC,OAAO,CAAC,kBAAkB,CAAC,IAAI,CAAC,OAAO,EAAE,UAAU,CAAC,CAAC;QAC3E,OAAO,IAAI,CAAC,GAAG,CAAC,QAAQ,CAAC,IAAI,SAAS,CAAC;IACzC,CAAC;CACF;AA/UD,oEA+UC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n\n/** @packageDocumentation\n * @module CartesianGeometry\n */\nimport { AxisOrder, BeJSONFunctions, Geometry } from \"../Geometry\";\nimport { Plane3d } from \"./Plane3d\";\nimport { Point4d } from \"../geometry4d/Point4d\";\nimport { Angle } from \"./Angle\";\nimport { Matrix3d } from \"./Matrix3d\";\nimport { Point3d, Vector3d } from \"./Point3dVector3d\";\nimport { Transform } from \"./Transform\";\nimport { XAndY } from \"./XYZProps\";\n\n/**\n * A plane defined by\n * * Any point on the plane.\n * * a unit normal.\n * @public\n */\nexport class Plane3dByOriginAndUnitNormal extends Plane3d implements BeJSONFunctions {\n private _origin: Point3d;\n private _normal: Vector3d;\n // constructor captures references !!!\n private constructor(origin: Point3d, normal: Vector3d) {\n super();\n this._origin = origin;\n this._normal = normal;\n }\n // This is private because it does not check validity of the unit vector.\n private static _create(x: number, y: number, z: number, u: number, v: number, w: number) {\n return new Plane3dByOriginAndUnitNormal(Point3d.create(x, y, z), Vector3d.create(u, v, w));\n }\n /**\n * Create a plane parallel to the XY plane\n * @param origin optional plane origin. If omitted, the origin is placed at 000\n */\n public static createXYPlane(origin?: Point3d): Plane3dByOriginAndUnitNormal {\n if (origin)\n return Plane3dByOriginAndUnitNormal._create(origin.x, origin.y, origin.z, 0, 0, 1);\n return Plane3dByOriginAndUnitNormal._create(0, 0, 0, 0, 0, 1);\n }\n /**\n * Create a plane parallel to the YZ plane\n * @param origin optional plane origin. If omitted, the origin is placed at 000\n */\n public static createYZPlane(origin?: Point3d): Plane3dByOriginAndUnitNormal {\n if (origin)\n return Plane3dByOriginAndUnitNormal._create(origin.x, origin.y, origin.z, 1, 0, 0);\n return Plane3dByOriginAndUnitNormal._create(0, 0, 0, 1, 0, 0);\n }\n /**\n * Create a plane parallel to the ZX plane\n * @param origin optional plane origin. If omitted, the origin is placed at 000\n */\n public static createZXPlane(origin?: Point3d): Plane3dByOriginAndUnitNormal {\n if (origin)\n return Plane3dByOriginAndUnitNormal._create(origin.x, origin.y, origin.z, 0, 1, 0);\n return Plane3dByOriginAndUnitNormal._create(0, 0, 0, 0, 1, 0);\n }\n /**\n * Create a new Plane3dByOriginAndUnitNormal with given origin and normal.\n * * The inputs are NOT captured.\n * * Returns undefined if `normal.normalize()` returns undefined.\n */\n public static create(\n origin: Point3d, normal: Vector3d, result?: Plane3dByOriginAndUnitNormal,\n ): Plane3dByOriginAndUnitNormal | undefined {\n if (result) {\n if (normal.normalize(result._normal) === undefined)\n return undefined;\n origin.clone(result._origin);\n return result;\n }\n const normalized = normal.normalize();\n if (normalized === undefined)\n return undefined;\n return new Plane3dByOriginAndUnitNormal(origin.clone(), normalized);\n }\n /**\n * Create a new Plane3dByOriginAndUnitNormal from a variety of plane types.\n * * The inputs are NOT captured.\n * * Returns undefined if `source.getUnitNormal()` returns undefined.\n */\n public static createFrom(\n source: Plane3d, result?: Plane3dByOriginAndUnitNormal,\n ): Plane3dByOriginAndUnitNormal | undefined {\n if (source instanceof Plane3dByOriginAndUnitNormal)\n return source.clone(result);\n if (result) {\n if (source.getUnitNormal(result._normal) === undefined)\n return undefined;\n source.getAnyPointOnPlane(result._origin);\n return result;\n }\n const normal = source.getUnitNormal();\n if (normal === undefined)\n return undefined;\n const origin = source.getAnyPointOnPlane();\n return new Plane3dByOriginAndUnitNormal(origin, normal);\n }\n /**\n * Create a new Plane3dByOriginAndUnitNormal with direct coordinates of origin and normal.\n * * Returns undefined if the normal vector is all zeros.\n * * If unable to normalize return undefined. (And if result is given it is left unchanged)\n */\n public static createXYZUVW(\n ax: number, ay: number, az: number, ux: number, uy: number, uz: number, result?: Plane3dByOriginAndUnitNormal,\n ): Plane3dByOriginAndUnitNormal | undefined {\n const magU = Geometry.hypotenuseXYZ(ux, uy, uz);\n if (magU < Geometry.smallMetricDistance)\n return undefined;\n if (result) {\n result._origin.set(ax, ay, az);\n result._normal.set(ux / magU, uy / magU, uz / magU);\n return result;\n }\n return new Plane3dByOriginAndUnitNormal(Point3d.create(ax, ay, az), Vector3d.create(ux / magU, uy / magU, uz / magU));\n }\n /**\n * Create a new Plane3dByOriginAndUnitNormal with unit normal (a) in the xy plane (b) perpendicular to the line\n * defined by xy parts of origin to target.\n * * origin and normal both have z = 0.\n * * The inputs are NOT captured.\n * * Returns undefined if the normal vector is all zeros.\n */\n public static createOriginAndTargetXY(\n origin: XAndY, target: XAndY, result?: Plane3dByOriginAndUnitNormal,\n ): Plane3dByOriginAndUnitNormal | undefined {\n const ux = target.x - origin.x;\n const uy = target.y - origin.y;\n return this.createXYZUVW(origin.x, origin.y, 0.0, uy, -ux, 0.0, result);\n }\n /**\n * Create a new Plane3dByOriginAndUnitNormal with xy origin (at z=0) and normal angle in xy plane.\n * * Returns undefined if the normal vector is all zeros.\n */\n public static createXYAngle(\n x: number, y: number, normalAngleFromX: Angle, result?: Plane3dByOriginAndUnitNormal,\n ): Plane3dByOriginAndUnitNormal {\n if (result) {\n result._origin.set(x, y, 0.0);\n result._normal.set(normalAngleFromX.cos(), normalAngleFromX.sin(), 0.0);\n return result;\n }\n return new Plane3dByOriginAndUnitNormal(\n Point3d.create(x, y, 0), Vector3d.create(normalAngleFromX.cos(), normalAngleFromX.sin()),\n );\n }\n /**\n * Create a plane defined by two points and an in-plane vector.\n * @param pointA any point in the plane\n * @param pointB any other point in the plane\n * @param vector any vector in the plane but not parallel to the vector from pointA to pointB\n */\n public static createPointPointVectorInPlane(\n pointA: Point3d, pointB: Point3d, vector: Vector3d,\n ): Plane3dByOriginAndUnitNormal | undefined {\n const cross = vector.crossProductStartEnd(pointA, pointB);\n if (cross.tryNormalizeInPlace())\n return new Plane3dByOriginAndUnitNormal(pointA, cross);\n return undefined;\n }\n /**\n * Create a plane defined by three points.\n * @param pointA any point in the plane. This will be the origin.\n * @param pointB any other point in the plane\n * @param pointC any third point in the plane but not on the line of pointA and pointB\n */\n public static createOriginAndTargets(\n pointA: Point3d, pointB: Point3d, pointC: Point3d,\n ): Plane3dByOriginAndUnitNormal | undefined {\n const cross = pointA.crossProductToPoints(pointB, pointC);\n if (cross.tryNormalizeInPlace())\n return new Plane3dByOriginAndUnitNormal(pointA, cross);\n return undefined;\n }\n /**\n * Create a plane defined by a point and two vectors in the plane\n * @param pointA any point in the plane\n * @param vectorB any vector in the plane\n * @param vectorC any vector in the plane but not parallel to vectorB\n */\n public static createOriginAndVectors(\n pointA: Point3d, vectorB: Vector3d, vectorC: Vector3d,\n ): Plane3dByOriginAndUnitNormal | undefined {\n const cross = vectorB.crossProduct(vectorC);\n if (cross.tryNormalizeInPlace())\n return new Plane3dByOriginAndUnitNormal(pointA, cross);\n return undefined;\n }\n /** Test for (toleranced) equality with `other` */\n public isAlmostEqual(other: Plane3dByOriginAndUnitNormal): boolean {\n return this._origin.isAlmostEqual(other._origin) && this._normal.isAlmostEqual(other._normal);\n }\n /** Parse a json fragment `{origin: [x,y,z], normal: [ux,uy,uz]}` */\n public setFromJSON(json?: any): void {\n if (!json) {\n this._origin.set(0, 0, 0);\n this._normal.set(0, 0, 1);\n } else {\n this._origin.setFromJSON(json.origin);\n this._normal.setFromJSON(json.normal);\n }\n }\n /**\n * Convert to a JSON object.\n * @return {*} [origin,normal]\n */\n public toJSON(): any {\n return { origin: this._origin.toJSON(), normal: this._normal.toJSON() };\n }\n /**\n * Create a new Plane3dByOriginAndUnitNormal from json fragment.\n * * See `Plane3dByOriginAndUnitNormal.setFromJSON`\n */\n public static fromJSON(json?: any): Plane3dByOriginAndUnitNormal {\n const result = Plane3dByOriginAndUnitNormal.createXYPlane();\n result.setFromJSON(json);\n return result;\n }\n /** Return a reference to the origin. */\n public getOriginRef(): Point3d {\n return this._origin;\n }\n /** Return a reference to the unit normal. */\n public getNormalRef(): Vector3d {\n return this._normal;\n }\n /**\n * Return coordinate axes (as a transform) with\n * * origin at plane origin\n * * z axis in direction of plane normal.\n * * x,y axes in plane.\n */\n public getLocalToWorld(): Transform {\n const axes = Matrix3d.createRigidHeadsUp(this._normal, AxisOrder.ZXY);\n return Transform.createRefs(this._origin.clone(), axes);\n }\n /** Return a (singular) transform which projects points to this plane. */\n public getProjectionToPlane(): Transform {\n const axes = Matrix3d.createIdentity();\n axes.addScaledOuterProductInPlace(this._normal, this._normal, -1.0);\n axes.markSingular();\n return Transform.createFixedPointAndMatrix(this._origin, axes);\n }\n /** Copy coordinates from the given origin and normal. */\n public set(origin: Point3d, normal: Vector3d): void {\n this._origin.setFrom(origin);\n this._normal.setFrom(normal);\n }\n /** Return a deep clone (point and normal cloned) */\n public clone(result?: Plane3dByOriginAndUnitNormal): Plane3dByOriginAndUnitNormal {\n if (result) {\n result.set(this._origin, this._normal);\n return result;\n }\n return new Plane3dByOriginAndUnitNormal(this._origin.clone(), this._normal.clone());\n }\n /** Create a clone and return the transform of the clone. */\n public cloneTransformed(transform: Transform, inverse: boolean = false): Plane3dByOriginAndUnitNormal | undefined {\n const result = this.clone();\n if (inverse) {\n transform.multiplyInversePoint3d(result._origin, result._origin);\n if (transform.matrix.multiplyTransposeVector(result._normal, result._normal) !== undefined\n && result._normal.normalizeInPlace())\n return result;\n } else {\n transform.multiplyPoint3d(result._origin, result._origin);\n if (transform.matrix.multiplyInverseTranspose(result._normal, result._normal) !== undefined\n && result._normal.normalizeInPlace())\n return result;\n }\n return undefined;\n }\n /** Copy data from the given plane. */\n public setFrom(source: Plane3dByOriginAndUnitNormal): void {\n this.set(source._origin, source._normal);\n }\n /** Return the altitude of spacePoint above or below the plane. (Below is negative) */\n public altitude(spacePoint: Point3d): number {\n return this._normal.dotProductStartEnd(this._origin, spacePoint);\n }\n /** Return the altitude of point (x,y) given xy parts using only the xy parts of origin and unit normal */\n public altitudeXY(x: number, y: number): number {\n return (x - this._origin.x) * this._normal.x + (y - this._origin.y) * this._normal.y;\n }\n /** Return the x component of the normal used to evaluate altitude. */\n public normalX(): number {\n return this._normal.x;\n }\n /** Return the x component of the normal used to evaluate altitude. */\n public normalY(): number {\n return this._normal.y;\n }\n /** Return the z component of the normal used to evaluate altitude. */\n public normalZ(): number {\n return this._normal.z;\n }\n /** Return (a clone of) the unit normal. */\n public override getUnitNormal(result?: Vector3d): Vector3d | undefined {\n return this._normal.clone(result);\n }\n /** Return (a clone of) the origin. */\n public override getAnyPointOnPlane(result?: Point3d): Point3d {\n // This function returns the plane origin. In general, a point x is on the plane if and only if (x-o).n = 0.\n return this._origin.clone(result);\n }\n /** Return the signed altitude of weighted spacePoint above or below the plane. (Below is negative) */\n public weightedAltitude(spacePoint: Point4d): number {\n return this._normal.dotProductStart3dEnd4d(this._origin, spacePoint);\n }\n /** Return any point at specified (signed) altitude. */\n public altitudeToPoint(altitude: number, result?: Point3d): Point3d {\n return this._origin.plusScaled(this._normal, altitude, result);\n }\n /**\n * Return the dot product of spaceVector with the plane's unit normal. This tells the rate of change of altitude\n * for a point moving at speed one along the spaceVector.\n */\n public velocityXYZ(x: number, y: number, z: number): number {\n return this._normal.dotProductXYZ(x, y, z);\n }\n /**\n * Return the dot product of spaceVector with the plane's unit normal. This tells the rate of change of altitude\n * for a point moving at speed one along the spaceVector.\n */\n public velocity(spaceVector: Vector3d): number {\n return this._normal.dotProduct(spaceVector);\n }\n /** Return the altitude of a point given as separate x,y,z components. */\n public altitudeXYZ(x: number, y: number, z: number): number {\n return this._normal.dotProductStartEndXYZ(this._origin, x, y, z);\n }\n /** Return the altitude of a point given as separate x,y,z,w components. */\n public altitudeXYZW(x: number, y: number, z: number, w: number): number {\n return this._normal.dotProductStartEndXYZW(this._origin, x, y, z, w);\n }\n /** Return the projection of spacePoint onto the plane. */\n public projectPointToPlane(spacePoint: Point3d, result?: Point3d): Point3d {\n return this.projectXYZToPlane(spacePoint.x, spacePoint.y, spacePoint.z, result);\n }\n /** Return the projection of (x,y,z) onto the plane. */\n public override projectXYZToPlane(x: number, y: number, z: number, result?: Point3d): Point3d {\n const scale = -this._normal.dotProductStartEndXYZ(this._origin, x, y, z);\n return Point3d.create(x + scale * this._normal.x, y + scale * this._normal.y, z + scale * this._normal.z, result);\n }\n /**\n * Returns true if spacePoint is within distance tolerance of the plane.\n * * This logic is identical to the [[Plane3d]] method but avoids a level of function call.\n */\n public override isPointInPlane(spacePoint: Point3d, tolerance: number = Geometry.smallMetricDistance): boolean {\n const altitude = this._normal.dotProductStartEnd(this._origin, spacePoint);\n return Math.abs(altitude) <= tolerance;\n }\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"Plane3dByOriginAndVectors.js","s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KAAK,SAAS;gBACjB,OAAO,yBAAO,CAAC,MAAM,CAAC,CAAC,GAAG,CAAC,GAAG,IAAI,CAAC,OAAO,CAAC,CAAC,EAAE,CAAC,GAAG,CAAC,GAAG,IAAI,CAAC,OAAO,CAAC,CAAC,EAAE,CAAC,GAAG,CAAC,GAAG,IAAI,CAAC,OAAO,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC;QAC1G,CAAC;aAAM,CAAC;YACN,MAAM,KAAK,GAAG,IAAI,CAAC,OAAO,CAAC,qBAAqB,CAAC,IAAI,CAAC,MAAM,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;YACvE,MAAM,CAAC,GAAG,mBAAQ,CAAC,2BAA2B,CAAC,KAAK,EAAE,KAAK,EAAE,GAAG,CAAC,CAAC;YAClE,IAAI,CAAC,KAAK,SAAS;gBACjB,OAAO,yBAAO,CAAC,MAAM,CAAC,CAAC,GAAG,CAAC,GAAG,IAAI,CAAC,OAAO,CAAC,CAAC,EAAE,CAAC,GAAG,CAAC,GAAG,IAAI,CAAC,OAAO,CAAC,CAAC,EAAE,CAAC,GAAG,CAAC,GAAG,IAAI,CAAC,OAAO,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC;QAC1G,CAAC;QACD,OAAO,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;IACnC,CAAC;CACF;AAtZD,8DAsZC","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\nimport { AxisOrder, BeJSONFunctions, Geometry } from \"../Geometry\";\r\nimport { Plane3d } from \"./Plane3d\";\r\nimport { Point4d } from \"../geometry4d/Point4d\";\r\nimport { Point3d, Vector3d } from \"./Point3dVector3d\";\r\nimport { Ray3d } from \"./Ray3d\";\r\nimport { Transform } from \"./Transform\";\r\nimport { XYAndZ } from \"./XYZProps\";\r\nimport { Matrix3d } from \"./Matrix3d\";\r\n\r\n/**\r\n * A Plane3dByOriginAndVectors is an origin and a pair of vectors.\r\n * This defines a plane with a (possibly skewed) uv coordinate grid\r\n * * The grid directions (`vectorU` and `vectorV`)\r\n * * are NOT required to be unit vectors.\r\n * * are NOT required to be perpendicular vectors.\r\n * * The skewed, non-uniform scaling of the grid directions is the primary focus of this class.\r\n * * Queries of altitude, velocity, normalX, normalY, and normalZ use the NORMALIZED cross product of vectorU\r\n * and vectorV as plane normal.\r\n * * Hence these are cartesian distances.\r\n * * If numerous calls to these are expected, the repeated normalization may be a performance issue.\r\n * * Using a [[Plane3dByOriginAndUnitNormal]] or the rigid transform returned by [[toRigidFrame]] would provide\r\n * better performance.\r\n * @public\r\n */\r\nexport class Plane3dByOriginAndVectors extends Plane3d implements BeJSONFunctions {\r\n /** Origin of plane grid */\r\n public origin: Point3d;\r\n /** u direction in plane grid */\r\n public vectorU: Vector3d;\r\n /** v direction in plane grid */\r\n public vectorV: Vector3d;\r\n private constructor(origin: Point3d, vectorU: Vector3d, vectorV: Vector3d) {\r\n super();\r\n this.origin = origin;\r\n this.vectorU = vectorU;\r\n this.vectorV = vectorV;\r\n }\r\n /** Create a new plane from origin and 2 in-plane vectors. */\r\n public static createOriginAndVectors(\r\n origin: Point3d, vectorU: Vector3d, vectorV: Vector3d, result?: Plane3dByOriginAndVectors,\r\n ): Plane3dByOriginAndVectors {\r\n if (result) {\r\n result.origin.setFrom(origin);\r\n result.vectorU.setFrom(vectorU);\r\n result.vectorV.setFrom(vectorV);\r\n return result;\r\n }\r\n return new Plane3dByOriginAndVectors(origin.clone(), vectorU.clone(), vectorV.clone());\r\n }\r\n /** Clone to a new plane. */\r\n public clone(result?: Plane3dByOriginAndVectors): Plane3dByOriginAndVectors {\r\n if (result !== undefined)\r\n result.setOriginAndVectors(this.origin, this.vectorU, this.vectorV);\r\n return new Plane3dByOriginAndVectors(this.origin.clone(), this.vectorU.clone(), this.vectorV.clone());\r\n }\r\n /**\r\n * Create a new Plane3dByOriginAndVectors from a variety of plane types.\r\n * * The input is NOT captured.\r\n */\r\n public static createFrom(source: Plane3d, result?: Plane3dByOriginAndVectors): Plane3dByOriginAndVectors | undefined {\r\n if (source instanceof Plane3dByOriginAndVectors)\r\n return source.clone(result);\r\n const normal = source.getUnitNormal();\r\n if (normal === undefined)\r\n return undefined;\r\n const origin = source.getAnyPointOnPlane();\r\n const vectorU = Matrix3d.createPerpendicularVectorFavorXYPlane(normal);\r\n if (vectorU.tryNormalizeInPlace()) {\r\n const vectorV = normal.unitCrossProduct(vectorU);\r\n if (vectorV !== undefined)\r\n return new Plane3dByOriginAndVectors(origin, vectorU, vectorV);\r\n }\r\n return undefined;\r\n }\r\n\r\n /**\r\n * Return a Plane3dByOriginAndVectors, with\r\n * * origin is the translation (aka origin) from the Transform\r\n * * vectorU is the X column of the transform\r\n * * vectorV is the Y column of the transform.\r\n * @param transform source transform\r\n * @param xLength optional length to impose on vectorU.\r\n * @param yLength optional length to impose on vectorV.\r\n * @param result optional preexisting result\r\n */\r\n public static createFromTransformColumnsXYAndLengths(\r\n transform: Transform, xLength: number | undefined, yLength: number | undefined, result?: Plane3dByOriginAndVectors,\r\n ): Plane3dByOriginAndVectors {\r\n if (result) {\r\n result.origin.setFrom(transform.getOrigin());\r\n transform.matrix.columnX(result.vectorU);\r\n transform.matrix.columnY(result.vectorV);\r\n } else {\r\n result = new Plane3dByOriginAndVectors(\r\n transform.getOrigin(),\r\n transform.matrix.columnX(),\r\n transform.matrix.columnY());\r\n }\r\n if (xLength !== undefined)\r\n result.vectorU.scaleToLength(xLength, result.vectorU);\r\n if (yLength !== undefined)\r\n result.vectorV.scaleToLength(yLength, result.vectorV);\r\n return result;\r\n }\r\n /** Capture origin and directions in a new plane. */\r\n public static createCapture(\r\n origin: Point3d, vectorU: Vector3d, vectorV: Vector3d, result?: Plane3dByOriginAndVectors,\r\n ): Plane3dByOriginAndVectors {\r\n if (!result)\r\n return new Plane3dByOriginAndVectors(origin, vectorU, vectorV);\r\n result.origin = origin;\r\n result.vectorU = vectorU;\r\n result.vectorV = vectorV;\r\n return result;\r\n }\r\n\r\n /** Set all origin and both vectors from direct numeric parameters */\r\n public setOriginAndVectorsXYZ(\r\n x0: number, y0: number, z0: number, ux: number, uy: number, uz: number, vx: number, vy: number, vz: number,\r\n ): Plane3dByOriginAndVectors {\r\n this.origin.set(x0, y0, z0);\r\n this.vectorU.set(ux, uy, uz);\r\n this.vectorV.set(vx, vy, vz);\r\n return this;\r\n }\r\n /**\r\n * Set all origin and both vectors from coordinates in given origin and vectors.\r\n * * Note that coordinates are copied out of the parameters -- the given parameters are NOT retained by reference.\r\n */\r\n public setOriginAndVectors(origin: Point3d, vectorU: Vector3d, vectorV: Vector3d): Plane3dByOriginAndVectors {\r\n this.origin.setFrom(origin);\r\n this.vectorU.setFrom(vectorU);\r\n this.vectorV.setFrom(vectorV);\r\n return this;\r\n }\r\n /** Create a new plane from direct numeric parameters */\r\n public static createOriginAndVectorsXYZ(\r\n x0: number, y0: number, z0: number,\r\n ux: number, uy: number, uz: number,\r\n vx: number, vy: number, vz: number,\r\n result?: Plane3dByOriginAndVectors,\r\n ): Plane3dByOriginAndVectors {\r\n if (result)\r\n return result.setOriginAndVectorsXYZ(x0, y0, z0, ux, uy, uz, vx, vy, vz);\r\n return new Plane3dByOriginAndVectors(\r\n Point3d.create(x0, y0, z0), Vector3d.create(ux, uy, uz), Vector3d.create(vx, vy, vz),\r\n );\r\n }\r\n /**\r\n * Define a plane by three points in the plane.\r\n * @param origin origin for the parameterization.\r\n * @param targetU target point for the vectorU starting at the origin.\r\n * @param targetV target point for the vectorV originating at the origin.\r\n * @param result optional result.\r\n */\r\n public static createOriginAndTargets(\r\n origin: Point3d, targetU: Point3d, targetV: Point3d, result?: Plane3dByOriginAndVectors,\r\n ): Plane3dByOriginAndVectors {\r\n return Plane3dByOriginAndVectors.createOriginAndVectorsXYZ(\r\n origin.x, origin.y, origin.z,\r\n targetU.x - origin.x, targetU.y - origin.y, targetU.z - origin.z,\r\n targetV.x - origin.x, targetV.y - origin.y, targetV.z - origin.z,\r\n result,\r\n );\r\n }\r\n /** Create a plane with origin at 000, unit vectorU in x direction, and unit vectorV in the y direction. */\r\n public static createXYPlane(result?: Plane3dByOriginAndVectors): Plane3dByOriginAndVectors {\r\n return Plane3dByOriginAndVectors.createOriginAndVectorsXYZ(0, 0, 0, 1, 0, 0, 0, 1, 0, result);\r\n }\r\n /**\r\n * Create a plane from data presented as Float64Arrays.\r\n * @param origin x,y,z of origin.\r\n * @param vectorU x,y,z of vectorU\r\n * @param vectorV x,y,z of vectorV\r\n */\r\n public static createOriginAndVectorsArrays(\r\n origin: Float64Array, vectorU: Float64Array, vectorV: Float64Array, result?: Plane3dByOriginAndVectors,\r\n ): Plane3dByOriginAndVectors {\r\n return Plane3dByOriginAndVectors.createOriginAndVectorsXYZ(\r\n origin[0], origin[1], origin[2],\r\n vectorU[0], vectorU[1], vectorU[2],\r\n vectorV[0], vectorV[1], vectorV[2],\r\n result,\r\n );\r\n }\r\n /**\r\n * Create a plane from data presented as Float64Array with weights\r\n * @param origin x,y,z,w of origin.\r\n * @param vectorU x,y,z,w of vectorU\r\n * @param vectorV x,y,z,w of vectorV\r\n */\r\n public static createOriginAndVectorsWeightedArrays(\r\n originW: Float64Array, vectorUw: Float64Array, vectorVw: Float64Array, result?: Plane3dByOriginAndVectors,\r\n ): Plane3dByOriginAndVectors {\r\n const w = originW[3];\r\n result = Plane3dByOriginAndVectors.createXYPlane(result);\r\n if (Geometry.isSmallMetricDistance(w))\r\n return result;\r\n const dw = 1.0 / w;\r\n const au = vectorUw[3] * dw * dw;\r\n const av = vectorVw[3] * dw * dw;\r\n // for homogeneous function X, with w its weight:\r\n // (X/w) is the cartesian point.\r\n // (X/w)' = (X' w - X w')/(w*w)\r\n // = X'/w - (X/w)(w'/w)\r\n // = X'/w - X w'/w^2)\r\n // The w parts of the formal xyzw sums are identically 0.\r\n // Here the X' and its w' are taken from each vectorUw and vectorVw\r\n result.origin.set(originW[0] * dw, originW[1] * dw, originW[2] * dw);\r\n Vector3d.createAdd2ScaledXYZ(\r\n vectorUw[0], vectorUw[1], vectorUw[2], dw, originW[0], originW[1], originW[2], -au, result.vectorU,\r\n );\r\n Vector3d.createAdd2ScaledXYZ(\r\n vectorVw[0], vectorVw[1], vectorVw[2], dw, originW[0], originW[1], originW[2], -av, result.vectorV,\r\n );\r\n return result;\r\n }\r\n /**\r\n * Evaluate a point a grid coordinates on the plane.\r\n * * The computed point is `origin + vectorU * u + vectorV * v`\r\n * @param u coordinate along vectorU\r\n * @param v coordinate along vectorV\r\n * @param result optional result destination.\r\n * @returns Return the computed coordinate.\r\n */\r\n public fractionToPoint(u: number, v: number, result?: Point3d): Point3d {\r\n return this.origin.plus2Scaled(this.vectorU, u, this.vectorV, v, result);\r\n }\r\n /** Return the vector from the plane origin to parametric coordinate (u.v) */\r\n public fractionToVector(u: number, v: number, result?: Vector3d): Vector3d {\r\n return Vector3d.createAdd2Scaled(this.vectorU, u, this.vectorV, v, result);\r\n }\r\n /** Set coordinates from a json object such as `{origin: [1,2,3], vectorU:[4,5,6], vectorV[3,2,1]}` */\r\n public setFromJSON(json?: any) {\r\n if (!json || !json.origin || !json.vectorV) {\r\n this.origin.set(0, 0, 0);\r\n this.vectorU.set(1, 0, 0);\r\n this.vectorV.set(0, 1, 0);\r\n } else {\r\n this.origin.setFromJSON(json.origin);\r\n this.vectorU.setFromJSON(json.vectorU);\r\n this.vectorV.setFromJSON(json.vectorV);\r\n }\r\n }\r\n /**\r\n * Convert an Angle to a JSON object.\r\n * @return {*} [origin,normal]\r\n */\r\n public toJSON(): any {\r\n return {\r\n origin: this.origin.toJSON(),\r\n vectorU: this.vectorU.toJSON(),\r\n vectorV: this.vectorV.toJSON(),\r\n };\r\n }\r\n /** Create a new plane. See `setFromJSON` for layout example. */\r\n public static fromJSON(json?: any): Plane3dByOriginAndVectors {\r\n const result = Plane3dByOriginAndVectors.createXYPlane();\r\n result.setFromJSON(json);\r\n return result;\r\n }\r\n /** Test origin and vectors for isAlmostEqual with `other` */\r\n public isAlmostEqual(other: Plane3dByOriginAndVectors): boolean {\r\n return this.origin.isAlmostEqual(other.origin)\r\n && this.vectorU.isAlmostEqual(other.vectorU)\r\n && this.vectorV.isAlmostEqual(other.vectorV);\r\n }\r\n /**\r\n * Normalize both `vectorU` and `vectorV` in place. This does NOT make them perpendicular.\r\n * * Return true if both succeeded.\r\n */\r\n public normalizeInPlace(): boolean {\r\n const okU = this.vectorU.normalizeInPlace();\r\n const okV = this.vectorV.normalizeInPlace();\r\n return okU && okV;\r\n }\r\n /** Return (if possible) a unit normal to the plane */\r\n public override getUnitNormal(result?: Vector3d): Vector3d | undefined {\r\n return this.vectorU.unitCrossProduct(this.vectorV, result);\r\n }\r\n /**\r\n * Return (if possible) a unit normal to the plane.\r\n * * This method is the same as getUnitNormal, which was created later as part of the abstract base class Plane3d.\r\n */\r\n public unitNormal(result?: Vector3d): Vector3d | undefined {\r\n return this.vectorU.unitCrossProduct(this.vectorV, result);\r\n }\r\n /**\r\n * Return some point on the plane.\r\n */\r\n public override getAnyPointOnPlane(result?: Point3d): Point3d {\r\n // This function returns the plane origin. In general, a point x is on the plane if\r\n // and only if x = o + a*u + b*v, where a and b are scalars.\r\n return this.origin.clone(result);\r\n }\r\n private static _workVector: Vector3d;\r\n /** Return (if possible) a ray with origin at plane origin, direction as unit normal to the plane */\r\n public unitNormalRay(result?: Ray3d): Ray3d | undefined {\r\n if (!Plane3dByOriginAndVectors._workVector)\r\n Plane3dByOriginAndVectors._workVector = Vector3d.create();\r\n const unitNormal = this.vectorU.unitCrossProduct(this.vectorV, Plane3dByOriginAndVectors._workVector);\r\n if (unitNormal === undefined)\r\n return undefined;\r\n return Ray3d.create(this.origin, unitNormal, result);\r\n }\r\n /**\r\n * Create a rigid frame (i.e. frenet frame) with\r\n * * origin at the plane origin\r\n * * x axis along the (normalized) vectorU\r\n * * y axis normalized vectorU to vectorV plane, and perpendicular to x axis\r\n * * z axis perpendicular to both.\r\n * @param result optional result\r\n */\r\n public toRigidFrame(result?: Transform): Transform | undefined {\r\n return Transform.createRigidFromOriginAndColumns(this.origin, this.vectorU, this.vectorV, AxisOrder.XYZ, result);\r\n }\r\n /** Apply the transform to the origin and vectors in place */\r\n public transformInPlace(transform: Transform) {\r\n transform.multiplyPoint3d(this.origin, this.origin);\r\n transform.multiplyVector(this.vectorU, this.vectorU);\r\n transform.multiplyVector(this.vectorV, this.vectorV);\r\n }\r\n /**\r\n * Return x component of the (normalized!) {vectorU CROSS vectorV}.\r\n * Return 0 if the cross product is zero.\r\n */\r\n public normalX(): number {\r\n const unitNormal = this.vectorU.unitCrossProduct(this.vectorV);\r\n return unitNormal !== undefined ? unitNormal.x : 0.0;\r\n }\r\n /**\r\n * Return y component of the (normalized!) {vectorU CROSS vectorV}.\r\n * Return 0 if the cross product is zero.\r\n */\r\n public normalY(): number {\r\n const unitNormal = this.vectorU.unitCrossProduct(this.vectorV);\r\n return unitNormal !== undefined ? unitNormal.y : 0.0;\r\n }\r\n /**\r\n * Return z component of the (normalized!) {vectorU CROSS vectorV}.\r\n * Return 0 if the cross product is zero.\r\n */\r\n public normalZ(): number {\r\n const unitNormal = this.vectorU.unitCrossProduct(this.vectorV);\r\n return unitNormal !== undefined ? unitNormal.z : 0.0;\r\n }\r\n /** Return signed cartesian altitude perpendicular to the plane. This uses the normalized cross product as normal. */\r\n public altitude(xyz: XYAndZ): number {\r\n const unitNormal = this.vectorU.unitCrossProduct(this.vectorV);\r\n if (unitNormal === undefined)\r\n return 0.0;\r\n return Geometry.dotProductXYZXYZ(\r\n (xyz.x - this.origin.x), (xyz.y - this.origin.y), (xyz.z - this.origin.z),\r\n unitNormal.x, unitNormal.y, unitNormal.z);\r\n }\r\n /** Return signed cartesian altitude perpendicular to the plane. This uses the normalized cross product as normal. */\r\n public altitudeXYZ(x: number, y: number, z: number): number {\r\n const unitNormal = this.vectorU.unitCrossProduct(this.vectorV);\r\n if (unitNormal === undefined)\r\n return 0.0;\r\n return Geometry.dotProductXYZXYZ(\r\n (x - this.origin.x), (y - this.origin.y), (z - this.origin.z),\r\n unitNormal.x, unitNormal.y, unitNormal.z);\r\n }\r\n /** Return signed projection of the input vector to the plane normal. This uses the normalized cross product as normal. */\r\n public velocity(xyzVector: XYAndZ): number {\r\n const unitNormal = this.vectorU.unitCrossProduct(this.vectorV);\r\n if (unitNormal === undefined)\r\n return 0.0;\r\n return Geometry.dotProductXYZXYZ(\r\n xyzVector.x, xyzVector.y, xyzVector.z,\r\n unitNormal.x, unitNormal.y, unitNormal.z);\r\n }\r\n /** Return signed projection of the input vector to the plane normal. This uses the normalized cross product as normal. */\r\n public velocityXYZ(x: number, y: number, z: number): number {\r\n const unitNormal = this.vectorU.unitCrossProduct(this.vectorV);\r\n if (unitNormal === undefined)\r\n return 0.0;\r\n return Geometry.dotProductXYZXYZ(\r\n x, y, z,\r\n unitNormal.x, unitNormal.y, unitNormal.z);\r\n }\r\n /**\r\n * Return triple product of homogeneous difference {(xyzw - w * origin)} with vectorU and vectorV.\r\n * * In the usual manner of homogeneous calculations, this is proportional to true cartesian distance from the\r\n * plane but is not a physical distance.\r\n */\r\n public weightedAltitude(xyzw: Point4d) {\r\n const w = xyzw.w;\r\n return Geometry.tripleProduct(\r\n (xyzw.x - this.origin.x * w), (xyzw.y - this.origin.y * w), (xyzw.z - this.origin.z * w),\r\n this.vectorU.x, this.vectorU.y, this.vectorU.z,\r\n this.vectorV.x, this.vectorV.y, this.vectorV.z);\r\n }\r\n /**\r\n * Return the projection of spacePoint onto the plane.\r\n * * If the plane is degenerate to a ray, project to the ray.\r\n * * If the plane is degenerate to its origin, return the point.\r\n */\r\n public projectPointToPlane(spacePoint: Point3d, result?: Point3d): Point3d {\r\n return this.projectXYZToPlane(spacePoint.x, spacePoint.y, spacePoint.z, result);\r\n }\r\n /**\r\n * Return the projection of (x,y,z) onto the plane.\r\n * * If the plane is degenerate to a ray, project to the ray.\r\n * * If the plane is degenerate to its origin, return the point.\r\n */\r\n public override projectXYZToPlane(x: number, y: number, z: number, result?: Point3d): Point3d {\r\n const unitNormal = this.vectorU.unitCrossProduct(this.vectorV);\r\n if (unitNormal !== undefined) {\r\n const scale = -unitNormal.dotProductStartEndXYZ(this.origin, x, y, z);\r\n return Point3d.create(x + scale * unitNormal.x, y + scale * unitNormal.y, z + scale * unitNormal.z, result);\r\n }\r\n // vectorU and vectorV are colinear or zero.\r\n // Project to ray defined by the longer one, or just to origin.\r\n const dotUU = this.vectorU.magnitudeSquared();\r\n const dotVV = this.vectorV.magnitudeSquared();\r\n if (dotUU >= dotVV) {\r\n const dotUW = this.vectorU.dotProductStartEndXYZ(this.origin, x, y, z);\r\n const f = Geometry.conditionalDivideCoordinate(dotUW, dotUU, 0.0);\r\n if (f !== undefined)\r\n return Point3d.create(x + f * this.vectorU.x, y + f * this.vectorU.y, z + f * this.vectorU.z, result);\r\n } else {\r\n const dotVW = this.vectorV.dotProductStartEndXYZ(this.origin, x, y, z);\r\n const f = Geometry.conditionalDivideCoordinate(dotVW, dotVV, 0.0);\r\n if (f !== undefined)\r\n return Point3d.create(x + f * this.vectorV.x, y + f * this.vectorV.y, z + f * this.vectorV.z, result);\r\n }\r\n return this.origin.clone(result);\r\n }\r\n}\r\n"]}
1
+ {"version":3,"file":"Plane3dByOriginAndVectors.js","sourceRoot":"","sources":["../../../src/geometry3d/Plane3dByOriginAndVectors.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;;;AAE/F;;GAEG;AACH,0CAAmE;AACnE,uCAAoC;AAEpC,uDAAsD;AACtD,mCAAgC;AAChC,2CAAwC;AAExC,yCAAsC;AAEtC;;;;;;;;;;;;;;GAcG;AACH,MAAa,yBAA0B,SAAQ,iBAAO;IACpD,2BAA2B;IACpB,MAAM,CAAU;IACvB,gCAAgC;IACzB,OAAO,CAAW;IACzB,gCAAgC;IACzB,O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C,IAAI,CAAC,MAAM,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;YACvE,MAAM,CAAC,GAAG,mBAAQ,CAAC,2BAA2B,CAAC,KAAK,EAAE,KAAK,EAAE,GAAG,CAAC,CAAC;YAClE,IAAI,CAAC,KAAK,SAAS;gBACjB,OAAO,yBAAO,CAAC,MAAM,CAAC,CAAC,GAAG,CAAC,GAAG,IAAI,CAAC,OAAO,CAAC,CAAC,EAAE,CAAC,GAAG,CAAC,GAAG,IAAI,CAAC,OAAO,CAAC,CAAC,EAAE,CAAC,GAAG,CAAC,GAAG,IAAI,CAAC,OAAO,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC;QAC1G,CAAC;QACD,OAAO,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;IACnC,CAAC;CACF;AAtZD,8DAsZC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n\n/** @packageDocumentation\n * @module CartesianGeometry\n */\nimport { AxisOrder, BeJSONFunctions, Geometry } from \"../Geometry\";\nimport { Plane3d } from \"./Plane3d\";\nimport { Point4d } from \"../geometry4d/Point4d\";\nimport { Point3d, Vector3d } from \"./Point3dVector3d\";\nimport { Ray3d } from \"./Ray3d\";\nimport { Transform } from \"./Transform\";\nimport { XYAndZ } from \"./XYZProps\";\nimport { Matrix3d } from \"./Matrix3d\";\n\n/**\n * A Plane3dByOriginAndVectors is an origin and a pair of vectors.\n * This defines a plane with a (possibly skewed) uv coordinate grid\n * * The grid directions (`vectorU` and `vectorV`)\n * * are NOT required to be unit vectors.\n * * are NOT required to be perpendicular vectors.\n * * The skewed, non-uniform scaling of the grid directions is the primary focus of this class.\n * * Queries of altitude, velocity, normalX, normalY, and normalZ use the NORMALIZED cross product of vectorU\n * and vectorV as plane normal.\n * * Hence these are cartesian distances.\n * * If numerous calls to these are expected, the repeated normalization may be a performance issue.\n * * Using a [[Plane3dByOriginAndUnitNormal]] or the rigid transform returned by [[toRigidFrame]] would provide\n * better performance.\n * @public\n */\nexport class Plane3dByOriginAndVectors extends Plane3d implements BeJSONFunctions {\n /** Origin of plane grid */\n public origin: Point3d;\n /** u direction in plane grid */\n public vectorU: Vector3d;\n /** v direction in plane grid */\n public vectorV: Vector3d;\n private constructor(origin: Point3d, vectorU: Vector3d, vectorV: Vector3d) {\n super();\n this.origin = origin;\n this.vectorU = vectorU;\n this.vectorV = vectorV;\n }\n /** Create a new plane from origin and 2 in-plane vectors. */\n public static createOriginAndVectors(\n origin: Point3d, vectorU: Vector3d, vectorV: Vector3d, result?: Plane3dByOriginAndVectors,\n ): Plane3dByOriginAndVectors {\n if (result) {\n result.origin.setFrom(origin);\n result.vectorU.setFrom(vectorU);\n result.vectorV.setFrom(vectorV);\n return result;\n }\n return new Plane3dByOriginAndVectors(origin.clone(), vectorU.clone(), vectorV.clone());\n }\n /** Clone to a new plane. */\n public clone(result?: Plane3dByOriginAndVectors): Plane3dByOriginAndVectors {\n if (result !== undefined)\n result.setOriginAndVectors(this.origin, this.vectorU, this.vectorV);\n return new Plane3dByOriginAndVectors(this.origin.clone(), this.vectorU.clone(), this.vectorV.clone());\n }\n /**\n * Create a new Plane3dByOriginAndVectors from a variety of plane types.\n * * The input is NOT captured.\n */\n public static createFrom(source: Plane3d, result?: Plane3dByOriginAndVectors): Plane3dByOriginAndVectors | undefined {\n if (source instanceof Plane3dByOriginAndVectors)\n return source.clone(result);\n const normal = source.getUnitNormal();\n if (normal === undefined)\n return undefined;\n const origin = source.getAnyPointOnPlane();\n const vectorU = Matrix3d.createPerpendicularVectorFavorXYPlane(normal);\n if (vectorU.tryNormalizeInPlace()) {\n const vectorV = normal.unitCrossProduct(vectorU);\n if (vectorV !== undefined)\n return new Plane3dByOriginAndVectors(origin, vectorU, vectorV);\n }\n return undefined;\n }\n\n /**\n * Return a Plane3dByOriginAndVectors, with\n * * origin is the translation (aka origin) from the Transform\n * * vectorU is the X column of the transform\n * * vectorV is the Y column of the transform.\n * @param transform source transform\n * @param xLength optional length to impose on vectorU.\n * @param yLength optional length to impose on vectorV.\n * @param result optional preexisting result\n */\n public static createFromTransformColumnsXYAndLengths(\n transform: Transform, xLength: number | undefined, yLength: number | undefined, result?: Plane3dByOriginAndVectors,\n ): Plane3dByOriginAndVectors {\n if (result) {\n result.origin.setFrom(transform.getOrigin());\n transform.matrix.columnX(result.vectorU);\n transform.matrix.columnY(result.vectorV);\n } else {\n result = new Plane3dByOriginAndVectors(\n transform.getOrigin(),\n transform.matrix.columnX(),\n transform.matrix.columnY());\n }\n if (xLength !== undefined)\n result.vectorU.scaleToLength(xLength, result.vectorU);\n if (yLength !== undefined)\n result.vectorV.scaleToLength(yLength, result.vectorV);\n return result;\n }\n /** Capture origin and directions in a new plane. */\n public static createCapture(\n origin: Point3d, vectorU: Vector3d, vectorV: Vector3d, result?: Plane3dByOriginAndVectors,\n ): Plane3dByOriginAndVectors {\n if (!result)\n return new Plane3dByOriginAndVectors(origin, vectorU, vectorV);\n result.origin = origin;\n result.vectorU = vectorU;\n result.vectorV = vectorV;\n return result;\n }\n\n /** Set all origin and both vectors from direct numeric parameters */\n public setOriginAndVectorsXYZ(\n x0: number, y0: number, z0: number, ux: number, uy: number, uz: number, vx: number, vy: number, vz: number,\n ): Plane3dByOriginAndVectors {\n this.origin.set(x0, y0, z0);\n this.vectorU.set(ux, uy, uz);\n this.vectorV.set(vx, vy, vz);\n return this;\n }\n /**\n * Set all origin and both vectors from coordinates in given origin and vectors.\n * * Note that coordinates are copied out of the parameters -- the given parameters are NOT retained by reference.\n */\n public setOriginAndVectors(origin: Point3d, vectorU: Vector3d, vectorV: Vector3d): Plane3dByOriginAndVectors {\n this.origin.setFrom(origin);\n this.vectorU.setFrom(vectorU);\n this.vectorV.setFrom(vectorV);\n return this;\n }\n /** Create a new plane from direct numeric parameters */\n public static createOriginAndVectorsXYZ(\n x0: number, y0: number, z0: number,\n ux: number, uy: number, uz: number,\n vx: number, vy: number, vz: number,\n result?: Plane3dByOriginAndVectors,\n ): Plane3dByOriginAndVectors {\n if (result)\n return result.setOriginAndVectorsXYZ(x0, y0, z0, ux, uy, uz, vx, vy, vz);\n return new Plane3dByOriginAndVectors(\n Point3d.create(x0, y0, z0), Vector3d.create(ux, uy, uz), Vector3d.create(vx, vy, vz),\n );\n }\n /**\n * Define a plane by three points in the plane.\n * @param origin origin for the parameterization.\n * @param targetU target point for the vectorU starting at the origin.\n * @param targetV target point for the vectorV originating at the origin.\n * @param result optional result.\n */\n public static createOriginAndTargets(\n origin: Point3d, targetU: Point3d, targetV: Point3d, result?: Plane3dByOriginAndVectors,\n ): Plane3dByOriginAndVectors {\n return Plane3dByOriginAndVectors.createOriginAndVectorsXYZ(\n origin.x, origin.y, origin.z,\n targetU.x - origin.x, targetU.y - origin.y, targetU.z - origin.z,\n targetV.x - origin.x, targetV.y - origin.y, targetV.z - origin.z,\n result,\n );\n }\n /** Create a plane with origin at 000, unit vectorU in x direction, and unit vectorV in the y direction. */\n public static createXYPlane(result?: Plane3dByOriginAndVectors): Plane3dByOriginAndVectors {\n return Plane3dByOriginAndVectors.createOriginAndVectorsXYZ(0, 0, 0, 1, 0, 0, 0, 1, 0, result);\n }\n /**\n * Create a plane from data presented as Float64Arrays.\n * @param origin x,y,z of origin.\n * @param vectorU x,y,z of vectorU\n * @param vectorV x,y,z of vectorV\n */\n public static createOriginAndVectorsArrays(\n origin: Float64Array, vectorU: Float64Array, vectorV: Float64Array, result?: Plane3dByOriginAndVectors,\n ): Plane3dByOriginAndVectors {\n return Plane3dByOriginAndVectors.createOriginAndVectorsXYZ(\n origin[0], origin[1], origin[2],\n vectorU[0], vectorU[1], vectorU[2],\n vectorV[0], vectorV[1], vectorV[2],\n result,\n );\n }\n /**\n * Create a plane from data presented as Float64Array with weights\n * @param origin x,y,z,w of origin.\n * @param vectorU x,y,z,w of vectorU\n * @param vectorV x,y,z,w of vectorV\n */\n public static createOriginAndVectorsWeightedArrays(\n originW: Float64Array, vectorUw: Float64Array, vectorVw: Float64Array, result?: Plane3dByOriginAndVectors,\n ): Plane3dByOriginAndVectors {\n const w = originW[3];\n result = Plane3dByOriginAndVectors.createXYPlane(result);\n if (Geometry.isSmallMetricDistance(w))\n return result;\n const dw = 1.0 / w;\n const au = vectorUw[3] * dw * dw;\n const av = vectorVw[3] * dw * dw;\n // for homogeneous function X, with w its weight:\n // (X/w) is the cartesian point.\n // (X/w)' = (X' w - X w')/(w*w)\n // = X'/w - (X/w)(w'/w)\n // = X'/w - X w'/w^2)\n // The w parts of the formal xyzw sums are identically 0.\n // Here the X' and its w' are taken from each vectorUw and vectorVw\n result.origin.set(originW[0] * dw, originW[1] * dw, originW[2] * dw);\n Vector3d.createAdd2ScaledXYZ(\n vectorUw[0], vectorUw[1], vectorUw[2], dw, originW[0], originW[1], originW[2], -au, result.vectorU,\n );\n Vector3d.createAdd2ScaledXYZ(\n vectorVw[0], vectorVw[1], vectorVw[2], dw, originW[0], originW[1], originW[2], -av, result.vectorV,\n );\n return result;\n }\n /**\n * Evaluate a point a grid coordinates on the plane.\n * * The computed point is `origin + vectorU * u + vectorV * v`\n * @param u coordinate along vectorU\n * @param v coordinate along vectorV\n * @param result optional result destination.\n * @returns Return the computed coordinate.\n */\n public fractionToPoint(u: number, v: number, result?: Point3d): Point3d {\n return this.origin.plus2Scaled(this.vectorU, u, this.vectorV, v, result);\n }\n /** Return the vector from the plane origin to parametric coordinate (u.v) */\n public fractionToVector(u: number, v: number, result?: Vector3d): Vector3d {\n return Vector3d.createAdd2Scaled(this.vectorU, u, this.vectorV, v, result);\n }\n /** Set coordinates from a json object such as `{origin: [1,2,3], vectorU:[4,5,6], vectorV[3,2,1]}` */\n public setFromJSON(json?: any) {\n if (!json || !json.origin || !json.vectorV) {\n this.origin.set(0, 0, 0);\n this.vectorU.set(1, 0, 0);\n this.vectorV.set(0, 1, 0);\n } else {\n this.origin.setFromJSON(json.origin);\n this.vectorU.setFromJSON(json.vectorU);\n this.vectorV.setFromJSON(json.vectorV);\n }\n }\n /**\n * Convert an Angle to a JSON object.\n * @return {*} [origin,normal]\n */\n public toJSON(): any {\n return {\n origin: this.origin.toJSON(),\n vectorU: this.vectorU.toJSON(),\n vectorV: this.vectorV.toJSON(),\n };\n }\n /** Create a new plane. See `setFromJSON` for layout example. */\n public static fromJSON(json?: any): Plane3dByOriginAndVectors {\n const result = Plane3dByOriginAndVectors.createXYPlane();\n result.setFromJSON(json);\n return result;\n }\n /** Test origin and vectors for isAlmostEqual with `other` */\n public isAlmostEqual(other: Plane3dByOriginAndVectors): boolean {\n return this.origin.isAlmostEqual(other.origin)\n && this.vectorU.isAlmostEqual(other.vectorU)\n && this.vectorV.isAlmostEqual(other.vectorV);\n }\n /**\n * Normalize both `vectorU` and `vectorV` in place. This does NOT make them perpendicular.\n * * Return true if both succeeded.\n */\n public normalizeInPlace(): boolean {\n const okU = this.vectorU.normalizeInPlace();\n const okV = this.vectorV.normalizeInPlace();\n return okU && okV;\n }\n /** Return (if possible) a unit normal to the plane */\n public override getUnitNormal(result?: Vector3d): Vector3d | undefined {\n return this.vectorU.unitCrossProduct(this.vectorV, result);\n }\n /**\n * Return (if possible) a unit normal to the plane.\n * * This method is the same as getUnitNormal, which was created later as part of the abstract base class Plane3d.\n */\n public unitNormal(result?: Vector3d): Vector3d | undefined {\n return this.vectorU.unitCrossProduct(this.vectorV, result);\n }\n /**\n * Return some point on the plane.\n */\n public override getAnyPointOnPlane(result?: Point3d): Point3d {\n // This function returns the plane origin. In general, a point x is on the plane if\n // and only if x = o + a*u + b*v, where a and b are scalars.\n return this.origin.clone(result);\n }\n private static _workVector: Vector3d;\n /** Return (if possible) a ray with origin at plane origin, direction as unit normal to the plane */\n public unitNormalRay(result?: Ray3d): Ray3d | undefined {\n if (!Plane3dByOriginAndVectors._workVector)\n Plane3dByOriginAndVectors._workVector = Vector3d.create();\n const unitNormal = this.vectorU.unitCrossProduct(this.vectorV, Plane3dByOriginAndVectors._workVector);\n if (unitNormal === undefined)\n return undefined;\n return Ray3d.create(this.origin, unitNormal, result);\n }\n /**\n * Create a rigid frame (i.e. frenet frame) with\n * * origin at the plane origin\n * * x axis along the (normalized) vectorU\n * * y axis normalized vectorU to vectorV plane, and perpendicular to x axis\n * * z axis perpendicular to both.\n * @param result optional result\n */\n public toRigidFrame(result?: Transform): Transform | undefined {\n return Transform.createRigidFromOriginAndColumns(this.origin, this.vectorU, this.vectorV, AxisOrder.XYZ, result);\n }\n /** Apply the transform to the origin and vectors in place */\n public transformInPlace(transform: Transform) {\n transform.multiplyPoint3d(this.origin, this.origin);\n transform.multiplyVector(this.vectorU, this.vectorU);\n transform.multiplyVector(this.vectorV, this.vectorV);\n }\n /**\n * Return x component of the (normalized!) {vectorU CROSS vectorV}.\n * Return 0 if the cross product is zero.\n */\n public normalX(): number {\n const unitNormal = this.vectorU.unitCrossProduct(this.vectorV);\n return unitNormal !== undefined ? unitNormal.x : 0.0;\n }\n /**\n * Return y component of the (normalized!) {vectorU CROSS vectorV}.\n * Return 0 if the cross product is zero.\n */\n public normalY(): number {\n const unitNormal = this.vectorU.unitCrossProduct(this.vectorV);\n return unitNormal !== undefined ? unitNormal.y : 0.0;\n }\n /**\n * Return z component of the (normalized!) {vectorU CROSS vectorV}.\n * Return 0 if the cross product is zero.\n */\n public normalZ(): number {\n const unitNormal = this.vectorU.unitCrossProduct(this.vectorV);\n return unitNormal !== undefined ? unitNormal.z : 0.0;\n }\n /** Return signed cartesian altitude perpendicular to the plane. This uses the normalized cross product as normal. */\n public altitude(xyz: XYAndZ): number {\n const unitNormal = this.vectorU.unitCrossProduct(this.vectorV);\n if (unitNormal === undefined)\n return 0.0;\n return Geometry.dotProductXYZXYZ(\n (xyz.x - this.origin.x), (xyz.y - this.origin.y), (xyz.z - this.origin.z),\n unitNormal.x, unitNormal.y, unitNormal.z);\n }\n /** Return signed cartesian altitude perpendicular to the plane. This uses the normalized cross product as normal. */\n public altitudeXYZ(x: number, y: number, z: number): number {\n const unitNormal = this.vectorU.unitCrossProduct(this.vectorV);\n if (unitNormal === undefined)\n return 0.0;\n return Geometry.dotProductXYZXYZ(\n (x - this.origin.x), (y - this.origin.y), (z - this.origin.z),\n unitNormal.x, unitNormal.y, unitNormal.z);\n }\n /** Return signed projection of the input vector to the plane normal. This uses the normalized cross product as normal. */\n public velocity(xyzVector: XYAndZ): number {\n const unitNormal = this.vectorU.unitCrossProduct(this.vectorV);\n if (unitNormal === undefined)\n return 0.0;\n return Geometry.dotProductXYZXYZ(\n xyzVector.x, xyzVector.y, xyzVector.z,\n unitNormal.x, unitNormal.y, unitNormal.z);\n }\n /** Return signed projection of the input vector to the plane normal. This uses the normalized cross product as normal. */\n public velocityXYZ(x: number, y: number, z: number): number {\n const unitNormal = this.vectorU.unitCrossProduct(this.vectorV);\n if (unitNormal === undefined)\n return 0.0;\n return Geometry.dotProductXYZXYZ(\n x, y, z,\n unitNormal.x, unitNormal.y, unitNormal.z);\n }\n /**\n * Return triple product of homogeneous difference {(xyzw - w * origin)} with vectorU and vectorV.\n * * In the usual manner of homogeneous calculations, this is proportional to true cartesian distance from the\n * plane but is not a physical distance.\n */\n public weightedAltitude(xyzw: Point4d) {\n const w = xyzw.w;\n return Geometry.tripleProduct(\n (xyzw.x - this.origin.x * w), (xyzw.y - this.origin.y * w), (xyzw.z - this.origin.z * w),\n this.vectorU.x, this.vectorU.y, this.vectorU.z,\n this.vectorV.x, this.vectorV.y, this.vectorV.z);\n }\n /**\n * Return the projection of spacePoint onto the plane.\n * * If the plane is degenerate to a ray, project to the ray.\n * * If the plane is degenerate to its origin, return the point.\n */\n public projectPointToPlane(spacePoint: Point3d, result?: Point3d): Point3d {\n return this.projectXYZToPlane(spacePoint.x, spacePoint.y, spacePoint.z, result);\n }\n /**\n * Return the projection of (x,y,z) onto the plane.\n * * If the plane is degenerate to a ray, project to the ray.\n * * If the plane is degenerate to its origin, return the point.\n */\n public override projectXYZToPlane(x: number, y: number, z: number, result?: Point3d): Point3d {\n const unitNormal = this.vectorU.unitCrossProduct(this.vectorV);\n if (unitNormal !== undefined) {\n const scale = -unitNormal.dotProductStartEndXYZ(this.origin, x, y, z);\n return Point3d.create(x + scale * unitNormal.x, y + scale * unitNormal.y, z + scale * unitNormal.z, result);\n }\n // vectorU and vectorV are colinear or zero.\n // Project to ray defined by the longer one, or just to origin.\n const dotUU = this.vectorU.magnitudeSquared();\n const dotVV = this.vectorV.magnitudeSquared();\n if (dotUU >= dotVV) {\n const dotUW = this.vectorU.dotProductStartEndXYZ(this.origin, x, y, z);\n const f = Geometry.conditionalDivideCoordinate(dotUW, dotUU, 0.0);\n if (f !== undefined)\n return Point3d.create(x + f * this.vectorU.x, y + f * this.vectorU.y, z + f * this.vectorU.z, result);\n } else {\n const dotVW = this.vectorV.dotProductStartEndXYZ(this.origin, x, y, z);\n const f = Geometry.conditionalDivideCoordinate(dotVW, dotVV, 0.0);\n if (f !== undefined)\n return Point3d.create(x + f * this.vectorV.x, y + f * this.vectorV.y, z + f * this.vectorV.z, result);\n }\n return this.origin.clone(result);\n }\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"Point2dArrayCarrier.js","sourceRoot":"","sources":["../../../src/geometry3d/Point2dArrayCarrier.ts"],"names":[],"mappings":";;;AAAA;;;+FAG+F;AAC/F;;GAEG;AACH,+DAA4D;AAC5D,uDAA0D;AAG1D;;;;;;EAME;AACF,MAAa,mBAAoB,SAAQ,yCAAmB;IAC1D,wCAAwC;IACjC,IAAI,CAAY;IACvB,wCAAwC;IACxC,YAAmB,IAAe;QAChC,KAAK,EAAE,CAAC;QACR,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;IACnB,CAAC;IACD,8BAA8B;IACvB,YAAY,CAAC,KAAa;QAC/B,OAAO,KAAK,IAAI,CAAC,IAAI,KAAK,GAAG,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC;IAChD,CAAC;IACD;;;;;;OAMG;IACa,6BAA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ACnB,CAAC;IAED;;;;;;;OAOG;IACa,2BAA2B,CAAC,MAAa,EAAE,MAAc,EAAE,MAAc;QACvF,IAAI,IAAI,CAAC,YAAY,CAAC,MAAM,CAAC,IAAI,IAAI,CAAC,YAAY,CAAC,MAAM,CAAC;YACxD,OAAO,oBAAE,CAAC,oBAAoB,CAAC,MAAM,EAAE,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,EAAE,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC;QAC/E,OAAO,SAAS,CAAC;IACnB,CAAC;IACD;;;;;;;OAOG;IACa,2BAA2B,CAAC,WAAmB,EAAE,MAAc,EAAE,MAAc;QAC7F,IAAI,IAAI,CAAC,YAAY,CAAC,WAAW,CAAC,IAAI,IAAI,CAAC,YAAY,CAAC,MAAM,CAAC,IAAI,IAAI,CAAC,YAAY,CAAC,MAAM,CAAC;YAC1F,OAAO,oBAAE,CAAC,oBAAoB,CAAC,IAAI,CAAC,IAAI,CAAC,WAAW,CAAC,EAAE,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,EAAE,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC;QAC/F,OAAO,SAAS,CAAC;IACnB,CAAC;IACD,8DAA8D;IAC9D,IAAoB,MAAM;QACxB,OAAO,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC;IAC1B,CAAC;IAED;;;OAGG;IACa,yBAAyB,CAAC,UAAkB;QAC1D,OAAO,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC;IACjC,CAAC;IAED;;;OAGG;IACa,yBAAyB,CAAC,UAAkB;QAC1D,OAAO,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC;IACjC,CAAC;CACF;AA9GD,kDA8GC","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 CartesianGeometry\r\n */\r\nimport { IndexedXYCollection } from \"./IndexedXYCollection\";\r\nimport { Point2d, Vector2d, XY } from \"./Point2dVector2d\";\r\nimport { XAndY } from \"./XYZProps\";\r\n\r\n/**\r\n * Helper object to access members of a Point2d[] in geometric calculations.\r\n * * The collection holds only a reference to the actual array.\r\n * * The actual array may be replaced by the user as needed.\r\n * * When replaced, there is no cached data to be updated.\r\n * @public\r\n*/\r\nexport class Point2dArrayCarrier extends IndexedXYCollection {\r\n /** reference to array being queried. */\r\n public data: Point2d[];\r\n /** CAPTURE caller supplied array ... */\r\n public constructor(data: Point2d[]) {\r\n super();\r\n this.data = data;\r\n }\r\n /** test if index is valid */\r\n public isValidIndex(index: number): boolean {\r\n return index >= 0 && index < this.data.length;\r\n }\r\n /**\r\n * Access by index, returning strongly typed Point2d\r\n * * This returns the xy value but NOT reference to the point in the \"carried\" array.\r\n * @param index index of point within the array\r\n * @param result caller-allocated destination\r\n * @returns undefined if the index is out of bounds\r\n */\r\n public override getPoint2dAtCheckedPointIndex(index: number, result?: Point2d): Point2d | undefined {\r\n if (this.isValidIndex(index)) {\r\n const source = this.data[index];\r\n return Point2d.create(source.x, source.y, result);\r\n }\r\n return undefined;\r\n }\r\n /**\r\n * Access by index, returning strongly typed Vector2d\r\n * @param index index of point within the array\r\n * @param result caller-allocated destination\r\n * @returns undefined if the index is out of bounds\r\n */\r\n public override getVector2dAtCheckedVectorIndex(index: number, result?: Vector2d): Vector2d | undefined {\r\n if (this.isValidIndex(index)) {\r\n const source = this.data[index];\r\n return Vector2d.create(source.x, source.y, result);\r\n }\r\n return undefined;\r\n }\r\n /**\r\n * Return a vector from the point at indexA to the point at indexB\r\n * @param indexA index of point within the array\r\n * @param indexB index of point within the array\r\n * @param result caller-allocated vector.\r\n * @returns undefined if either index is out of bounds\r\n */\r\n public override vectorIndexIndex(indexA: number, indexB: number, result?: Vector2d): Vector2d | undefined {\r\n if (this.isValidIndex(indexA) && this.isValidIndex(indexB))\r\n return Vector2d.createStartEnd(this.data[indexA], this.data[indexB], result);\r\n return undefined;\r\n }\r\n /**\r\n * Return a vector from given origin to point at indexB\r\n * @param origin origin for vector\r\n * @param indexB index of point within the array\r\n * @param result caller-allocated vector.\r\n * @returns undefined if index is out of bounds\r\n */\r\n public override vectorXAndYIndex(origin: XAndY, indexB: number, result?: Vector2d): Vector2d | undefined {\r\n if (this.isValidIndex(indexB))\r\n return Vector2d.createStartEnd(origin, this.data[indexB], result);\r\n return undefined;\r\n }\r\n\r\n /**\r\n * Return the cross product of vectors from origin to points at indexA and indexB\r\n * @param origin origin for vector\r\n * @param indexA index of first target within the array\r\n * @param indexB index of second target within the array\r\n * @param result caller-allocated vector.\r\n * @returns undefined if either index is out of bounds\r\n */\r\n public override crossProductXAndYIndexIndex(origin: XAndY, indexA: number, indexB: number): number | undefined {\r\n if (this.isValidIndex(indexA) && this.isValidIndex(indexB))\r\n return XY.crossProductToPoints(origin, this.data[indexA], this.data[indexB]);\r\n return undefined;\r\n }\r\n /**\r\n * Return the cross product of vectors from point at originIndex to points at indexA and indexB\r\n * @param originIndex index of origin\r\n * @param indexA index of first target within the array\r\n * @param indexB index of second target within the array\r\n * @param result caller-allocated vector.\r\n * @returns return true if indexA, indexB both valid\r\n */\r\n public override crossProductIndexIndexIndex(originIndex: number, indexA: number, indexB: number): number | undefined {\r\n if (this.isValidIndex(originIndex) && this.isValidIndex(indexA) && this.isValidIndex(indexB))\r\n return XY.crossProductToPoints(this.data[originIndex], this.data[indexA], this.data[indexB]);\r\n return undefined;\r\n }\r\n /** Read-only property for number of XYZ in the collection. */\r\n public override get length(): number {\r\n return this.data.length;\r\n }\r\n\r\n /**\r\n * Get x coordinate by point index, with no index checking\r\n * @param pointIndex index to access\r\n */\r\n public override getXAtUncheckedPointIndex(pointIndex: number): number {\r\n return this.data[pointIndex].x;\r\n }\r\n\r\n /**\r\n * Get y coordinate by point index, with no index checking\r\n * @param pointIndex index to access\r\n */\r\n public override getYAtUncheckedPointIndex(pointIndex: number): number {\r\n return this.data[pointIndex].y;\r\n }\r\n}\r\n"]}
1
+ {"version":3,"file":"Point2dArrayCarrier.js","sourceRoot":"","sources":["../../../src/geometry3d/Point2dArrayCarrier.ts"],"names":[],"mappings":";;;AAAA;;;+FAG+F;AAC/F;;GAEG;AACH,+DAA4D;AAC5D,uDAA0D;AAG1D;;;;;;EAME;AACF,MAAa,mBAAoB,SAAQ,yCAAmB;IAC1D,wCAAwC;IACjC,IAAI,CAAY;IACvB,wCAAwC;IACxC,YAAmB,IAAe;QAChC,KAAK,EAAE,CAAC;QACR,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;IACnB,CAAC;IACD,8BAA8B;IACvB,YAAY,CAAC,KAAa;QAC/B,OAAO,KAAK,IAAI,CAAC,IAAI,KAAK,GAAG,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC;IAChD,CAAC;IACD;;;;;;OAMG;IACa,6BAA6B,CAAC,KAAa,EAAE,MAAgB;QAC3E,IAAI,IAAI,CAAC,YAAY,CAAC,KAAK,CAAC,EAAE,CAAC;YAC7B,MAAM,MAAM,GAAG,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;YAChC,OAAO,yBAAO,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC;QACpD,CAAC;QACD,OAAO,SAAS,CAAC;IACnB,CAAC;IACD;;;;;OAKG;IACa,+BAA+B,CAAC,KAAa,EAAE,MAAiB;QAC9E,IAAI,IAAI,CAAC,YAAY,CAAC,KAAK,CAAC,EAAE,CAAC;YAC7B,MAAM,MAAM,GAAG,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;YAChC,OAAO,0BAAQ,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC;QACrD,CAAC;QACD,OAAO,SAAS,C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,EAAE,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,EAAE,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC;QAC/F,OAAO,SAAS,CAAC;IACnB,CAAC;IACD,8DAA8D;IAC9D,IAAoB,MAAM;QACxB,OAAO,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC;IAC1B,CAAC;IAED;;;OAGG;IACa,yBAAyB,CAAC,UAAkB;QAC1D,OAAO,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC;IACjC,CAAC;IAED;;;OAGG;IACa,yBAAyB,CAAC,UAAkB;QAC1D,OAAO,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC;IACjC,CAAC;CACF;AA9GD,kDA8GC","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 CartesianGeometry\n */\nimport { IndexedXYCollection } from \"./IndexedXYCollection\";\nimport { Point2d, Vector2d, XY } from \"./Point2dVector2d\";\nimport { XAndY } from \"./XYZProps\";\n\n/**\n * Helper object to access members of a Point2d[] in geometric calculations.\n * * The collection holds only a reference to the actual array.\n * * The actual array may be replaced by the user as needed.\n * * When replaced, there is no cached data to be updated.\n * @public\n*/\nexport class Point2dArrayCarrier extends IndexedXYCollection {\n /** reference to array being queried. */\n public data: Point2d[];\n /** CAPTURE caller supplied array ... */\n public constructor(data: Point2d[]) {\n super();\n this.data = data;\n }\n /** test if index is valid */\n public isValidIndex(index: number): boolean {\n return index >= 0 && index < this.data.length;\n }\n /**\n * Access by index, returning strongly typed Point2d\n * * This returns the xy value but NOT reference to the point in the \"carried\" array.\n * @param index index of point within the array\n * @param result caller-allocated destination\n * @returns undefined if the index is out of bounds\n */\n public override getPoint2dAtCheckedPointIndex(index: number, result?: Point2d): Point2d | undefined {\n if (this.isValidIndex(index)) {\n const source = this.data[index];\n return Point2d.create(source.x, source.y, result);\n }\n return undefined;\n }\n /**\n * Access by index, returning strongly typed Vector2d\n * @param index index of point within the array\n * @param result caller-allocated destination\n * @returns undefined if the index is out of bounds\n */\n public override getVector2dAtCheckedVectorIndex(index: number, result?: Vector2d): Vector2d | undefined {\n if (this.isValidIndex(index)) {\n const source = this.data[index];\n return Vector2d.create(source.x, source.y, result);\n }\n return undefined;\n }\n /**\n * Return a vector from the point at indexA to the point at indexB\n * @param indexA index of point within the array\n * @param indexB index of point within the array\n * @param result caller-allocated vector.\n * @returns undefined if either index is out of bounds\n */\n public override vectorIndexIndex(indexA: number, indexB: number, result?: Vector2d): Vector2d | undefined {\n if (this.isValidIndex(indexA) && this.isValidIndex(indexB))\n return Vector2d.createStartEnd(this.data[indexA], this.data[indexB], result);\n return undefined;\n }\n /**\n * Return a vector from given origin to point at indexB\n * @param origin origin for vector\n * @param indexB index of point within the array\n * @param result caller-allocated vector.\n * @returns undefined if index is out of bounds\n */\n public override vectorXAndYIndex(origin: XAndY, indexB: number, result?: Vector2d): Vector2d | undefined {\n if (this.isValidIndex(indexB))\n return Vector2d.createStartEnd(origin, this.data[indexB], result);\n return undefined;\n }\n\n /**\n * Return the cross product of vectors from origin to points at indexA and indexB\n * @param origin origin for vector\n * @param indexA index of first target within the array\n * @param indexB index of second target within the array\n * @param result caller-allocated vector.\n * @returns undefined if either index is out of bounds\n */\n public override crossProductXAndYIndexIndex(origin: XAndY, indexA: number, indexB: number): number | undefined {\n if (this.isValidIndex(indexA) && this.isValidIndex(indexB))\n return XY.crossProductToPoints(origin, this.data[indexA], this.data[indexB]);\n return undefined;\n }\n /**\n * Return the cross product of vectors from point at originIndex to points at indexA and indexB\n * @param originIndex index of origin\n * @param indexA index of first target within the array\n * @param indexB index of second target within the array\n * @param result caller-allocated vector.\n * @returns return true if indexA, indexB both valid\n */\n public override crossProductIndexIndexIndex(originIndex: number, indexA: number, indexB: number): number | undefined {\n if (this.isValidIndex(originIndex) && this.isValidIndex(indexA) && this.isValidIndex(indexB))\n return XY.crossProductToPoints(this.data[originIndex], this.data[indexA], this.data[indexB]);\n return undefined;\n }\n /** Read-only property for number of XYZ in the collection. */\n public override get length(): number {\n return this.data.length;\n }\n\n /**\n * Get x coordinate by point index, with no index checking\n * @param pointIndex index to access\n */\n public override getXAtUncheckedPointIndex(pointIndex: number): number {\n return this.data[pointIndex].x;\n }\n\n /**\n * Get y coordinate by point index, with no index checking\n * @param pointIndex index to access\n */\n public override getYAtUncheckedPointIndex(pointIndex: number): number {\n return this.data[pointIndex].y;\n }\n}\n"]}