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

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 (503) hide show
  1. package/lib/cjs/Constant.js.map +1 -1
  2. package/lib/cjs/Geometry.js.map +1 -1
  3. package/lib/cjs/bspline/AkimaCurve3d.js.map +1 -1
  4. package/lib/cjs/bspline/BSpline1dNd.js.map +1 -1
  5. package/lib/cjs/bspline/BSplineCurve.js.map +1 -1
  6. package/lib/cjs/bspline/BSplineCurve3dH.js.map +1 -1
  7. package/lib/cjs/bspline/BSplineCurveOps.js.map +1 -1
  8. package/lib/cjs/bspline/BSplineSurface.js.map +1 -1
  9. package/lib/cjs/bspline/Bezier1dNd.js.map +1 -1
  10. package/lib/cjs/bspline/BezierCurve3d.js.map +1 -1
  11. package/lib/cjs/bspline/BezierCurve3dH.js.map +1 -1
  12. package/lib/cjs/bspline/BezierCurveBase.js.map +1 -1
  13. package/lib/cjs/bspline/InterpolationCurve3d.js.map +1 -1
  14. package/lib/cjs/bspline/KnotVector.js.map +1 -1
  15. package/lib/cjs/bspline/SurfaceLocationDetail.js.map +1 -1
  16. package/lib/cjs/clipping/AlternatingConvexClipTree.js.map +1 -1
  17. package/lib/cjs/clipping/BooleanClipFactory.js.map +1 -1
  18. package/lib/cjs/clipping/BooleanClipNode.js.map +1 -1
  19. package/lib/cjs/clipping/ClipPlane.js.map +1 -1
  20. package/lib/cjs/clipping/ClipPrimitive.js.map +1 -1
  21. package/lib/cjs/clipping/ClipUtils.js.map +1 -1
  22. package/lib/cjs/clipping/ClipVector.js.map +1 -1
  23. package/lib/cjs/clipping/ConvexClipPlaneSet.js.map +1 -1
  24. package/lib/cjs/clipping/UnionOfConvexClipPlaneSets.js.map +1 -1
  25. package/lib/cjs/clipping/internalContexts/LineStringOffsetClipperContext.js.map +1 -1
  26. package/lib/cjs/core-geometry.js.map +1 -1
  27. package/lib/cjs/curve/Arc3d.js.map +1 -1
  28. package/lib/cjs/curve/ConstructCurveBetweenCurves.js.map +1 -1
  29. package/lib/cjs/curve/CoordinateXYZ.js.map +1 -1
  30. package/lib/cjs/curve/CurveChainWithDistanceIndex.js.map +1 -1
  31. package/lib/cjs/curve/CurveCollection.js.map +1 -1
  32. package/lib/cjs/curve/CurveCurve.js.map +1 -1
  33. package/lib/cjs/curve/CurveExtendMode.js.map +1 -1
  34. package/lib/cjs/curve/CurveFactory.js.map +1 -1
  35. package/lib/cjs/curve/CurveLocationDetail.js.map +1 -1
  36. package/lib/cjs/curve/CurveOps.js.map +1 -1
  37. package/lib/cjs/curve/CurvePrimitive.js.map +1 -1
  38. package/lib/cjs/curve/CurveProcessor.js.map +1 -1
  39. package/lib/cjs/curve/CurveTypes.js.map +1 -1
  40. package/lib/cjs/curve/CurveWireMomentsXYZ.js.map +1 -1
  41. package/lib/cjs/curve/GeometryQuery.js.map +1 -1
  42. package/lib/cjs/curve/LineSegment3d.js.map +1 -1
  43. package/lib/cjs/curve/LineString3d.js.map +1 -1
  44. package/lib/cjs/curve/Loop.js.map +1 -1
  45. package/lib/cjs/curve/OffsetOptions.js.map +1 -1
  46. package/lib/cjs/curve/ParityRegion.js.map +1 -1
  47. package/lib/cjs/curve/Path.js.map +1 -1
  48. package/lib/cjs/curve/PointString3d.js.map +1 -1
  49. package/lib/cjs/curve/ProxyCurve.js.map +1 -1
  50. package/lib/cjs/curve/Query/ConsolidateAdjacentPrimitivesContext.js.map +1 -1
  51. package/lib/cjs/curve/Query/CurveSplitContext.js.map +1 -1
  52. package/lib/cjs/curve/Query/CylindricalRange.js.map +1 -1
  53. package/lib/cjs/curve/Query/InOutTests.js.map +1 -1
  54. package/lib/cjs/curve/Query/PlanarSubdivision.js.map +1 -1
  55. package/lib/cjs/curve/Query/StrokeCountChain.js.map +1 -1
  56. package/lib/cjs/curve/Query/StrokeCountMap.js.map +1 -1
  57. package/lib/cjs/curve/RegionMomentsXY.js.map +1 -1
  58. package/lib/cjs/curve/RegionOps.js.map +1 -1
  59. package/lib/cjs/curve/RegionOpsClassificationSweeps.js.map +1 -1
  60. package/lib/cjs/curve/StrokeOptions.js.map +1 -1
  61. package/lib/cjs/curve/UnionRegion.js.map +1 -1
  62. package/lib/cjs/curve/internalContexts/AnnounceTangentStrokeHandler.js.map +1 -1
  63. package/lib/cjs/curve/internalContexts/AppendPlaneIntersectionStrokeHandler.js.map +1 -1
  64. package/lib/cjs/curve/internalContexts/ChainCollectorContext.js.map +1 -1
  65. package/lib/cjs/curve/internalContexts/CloneCurvesContext.js.map +1 -1
  66. package/lib/cjs/curve/internalContexts/CloneWithExpandedLineStrings.js.map +1 -1
  67. package/lib/cjs/curve/internalContexts/ClosestPointStrokeHandler.js.map +1 -1
  68. package/lib/cjs/curve/internalContexts/CountLinearPartsSearchContext.js.map +1 -1
  69. package/lib/cjs/curve/internalContexts/CurveCurveCloseApproachXY.js.map +1 -1
  70. package/lib/cjs/curve/internalContexts/CurveCurveIntersectXY.js.map +1 -1
  71. package/lib/cjs/curve/internalContexts/CurveCurveIntersectXYZ.js.map +1 -1
  72. package/lib/cjs/curve/internalContexts/CurveLengthContext.js.map +1 -1
  73. package/lib/cjs/curve/internalContexts/CurveOffsetXYHandler.js.map +1 -1
  74. package/lib/cjs/curve/internalContexts/EllipticalArcApproximationContext.js.map +1 -1
  75. package/lib/cjs/curve/internalContexts/GapSearchContext.js.map +1 -1
  76. package/lib/cjs/curve/internalContexts/MultiChainCollector.js.map +1 -1
  77. package/lib/cjs/curve/internalContexts/NewtonRtoRStrokeHandler.js.map +1 -1
  78. package/lib/cjs/curve/internalContexts/PlaneAltitudeRangeContext.js.map +1 -1
  79. package/lib/cjs/curve/internalContexts/PolygonOffsetContext.js.map +1 -1
  80. package/lib/cjs/curve/internalContexts/SumLengthsContext.js.map +1 -1
  81. package/lib/cjs/curve/internalContexts/TransferWithSplitArcs.js.map +1 -1
  82. package/lib/cjs/curve/internalContexts/TransformInPlaceContext.js.map +1 -1
  83. package/lib/cjs/curve/spiral/AustralianRailCorpXYEvaluator.js.map +1 -1
  84. package/lib/cjs/curve/spiral/ClothoidSeries.d.ts +5 -1
  85. package/lib/cjs/curve/spiral/ClothoidSeries.d.ts.map +1 -1
  86. package/lib/cjs/curve/spiral/ClothoidSeries.js +11 -6
  87. package/lib/cjs/curve/spiral/ClothoidSeries.js.map +1 -1
  88. package/lib/cjs/curve/spiral/CubicEvaluator.d.ts +1 -1
  89. package/lib/cjs/curve/spiral/CubicEvaluator.js +1 -1
  90. package/lib/cjs/curve/spiral/CubicEvaluator.js.map +1 -1
  91. package/lib/cjs/curve/spiral/CzechSpiralEvaluator.d.ts +6 -6
  92. package/lib/cjs/curve/spiral/CzechSpiralEvaluator.js +6 -6
  93. package/lib/cjs/curve/spiral/CzechSpiralEvaluator.js.map +1 -1
  94. package/lib/cjs/curve/spiral/DirectHalfCosineSpiralEvaluator.js.map +1 -1
  95. package/lib/cjs/curve/spiral/DirectSpiral3d.d.ts +19 -19
  96. package/lib/cjs/curve/spiral/DirectSpiral3d.d.ts.map +1 -1
  97. package/lib/cjs/curve/spiral/DirectSpiral3d.js +21 -21
  98. package/lib/cjs/curve/spiral/DirectSpiral3d.js.map +1 -1
  99. package/lib/cjs/curve/spiral/IntegratedSpiral3d.d.ts +1 -1
  100. package/lib/cjs/curve/spiral/IntegratedSpiral3d.d.ts.map +1 -1
  101. package/lib/cjs/curve/spiral/IntegratedSpiral3d.js +3 -2
  102. package/lib/cjs/curve/spiral/IntegratedSpiral3d.js.map +1 -1
  103. package/lib/cjs/curve/spiral/MXCubicAlongArcSpiralEvaluator.d.ts +1 -1
  104. package/lib/cjs/curve/spiral/MXCubicAlongArcSpiralEvaluator.js +1 -1
  105. package/lib/cjs/curve/spiral/MXCubicAlongArcSpiralEvaluator.js.map +1 -1
  106. package/lib/cjs/curve/spiral/NormalizedTransition.d.ts +8 -6
  107. package/lib/cjs/curve/spiral/NormalizedTransition.d.ts.map +1 -1
  108. package/lib/cjs/curve/spiral/NormalizedTransition.js +10 -6
  109. package/lib/cjs/curve/spiral/NormalizedTransition.js.map +1 -1
  110. package/lib/cjs/curve/spiral/PolishCubicSpiralEvaluator.d.ts +1 -1
  111. package/lib/cjs/curve/spiral/PolishCubicSpiralEvaluator.js +1 -1
  112. package/lib/cjs/curve/spiral/PolishCubicSpiralEvaluator.js.map +1 -1
  113. package/lib/cjs/curve/spiral/TransitionConditionalProperties.d.ts +20 -8
  114. package/lib/cjs/curve/spiral/TransitionConditionalProperties.d.ts.map +1 -1
  115. package/lib/cjs/curve/spiral/TransitionConditionalProperties.js +20 -8
  116. package/lib/cjs/curve/spiral/TransitionConditionalProperties.js.map +1 -1
  117. package/lib/cjs/curve/spiral/TransitionSpiral3d.d.ts +5 -4
  118. package/lib/cjs/curve/spiral/TransitionSpiral3d.d.ts.map +1 -1
  119. package/lib/cjs/curve/spiral/TransitionSpiral3d.js.map +1 -1
  120. package/lib/cjs/curve/spiral/XYCurveEvaluator.d.ts.map +1 -1
  121. package/lib/cjs/curve/spiral/XYCurveEvaluator.js.map +1 -1
  122. package/lib/cjs/geometry3d/Angle.js.map +1 -1
  123. package/lib/cjs/geometry3d/AngleSweep.js.map +1 -1
  124. package/lib/cjs/geometry3d/BarycentricTriangle.js.map +1 -1
  125. package/lib/cjs/geometry3d/BilinearPatch.js.map +1 -1
  126. package/lib/cjs/geometry3d/CoincidentGeometryOps.js.map +1 -1
  127. package/lib/cjs/geometry3d/Ellipsoid.js.map +1 -1
  128. package/lib/cjs/geometry3d/FrameBuilder.js.map +1 -1
  129. package/lib/cjs/geometry3d/FrustumAnimation.js.map +1 -1
  130. package/lib/cjs/geometry3d/GeometryHandler.js.map +1 -1
  131. package/lib/cjs/geometry3d/GrowableBlockedArray.js.map +1 -1
  132. package/lib/cjs/geometry3d/GrowableFloat64Array.js.map +1 -1
  133. package/lib/cjs/geometry3d/GrowableXYArray.js.map +1 -1
  134. package/lib/cjs/geometry3d/GrowableXYZArray.js.map +1 -1
  135. package/lib/cjs/geometry3d/IndexedCollectionInterval.js.map +1 -1
  136. package/lib/cjs/geometry3d/IndexedXYCollection.js.map +1 -1
  137. package/lib/cjs/geometry3d/IndexedXYZCollection.js.map +1 -1
  138. package/lib/cjs/geometry3d/LongitudeLatitudeAltitude.js.map +1 -1
  139. package/lib/cjs/geometry3d/Matrix3d.js.map +1 -1
  140. package/lib/cjs/geometry3d/OrderedRotationAngles.js.map +1 -1
  141. package/lib/cjs/geometry3d/Plane3d.js.map +1 -1
  142. package/lib/cjs/geometry3d/Plane3dByOriginAndUnitNormal.js.map +1 -1
  143. package/lib/cjs/geometry3d/Plane3dByOriginAndVectors.js.map +1 -1
  144. package/lib/cjs/geometry3d/Point2dArrayCarrier.js.map +1 -1
  145. package/lib/cjs/geometry3d/Point2dVector2d.js.map +1 -1
  146. package/lib/cjs/geometry3d/Point3dArrayCarrier.js.map +1 -1
  147. package/lib/cjs/geometry3d/Point3dVector3d.js.map +1 -1
  148. package/lib/cjs/geometry3d/PointHelpers.js.map +1 -1
  149. package/lib/cjs/geometry3d/PointStreaming.js.map +1 -1
  150. package/lib/cjs/geometry3d/PolygonOps.js.map +1 -1
  151. package/lib/cjs/geometry3d/PolylineCompressionByEdgeOffset.js.map +1 -1
  152. package/lib/cjs/geometry3d/PolylineOps.js.map +1 -1
  153. package/lib/cjs/geometry3d/Range.js.map +1 -1
  154. package/lib/cjs/geometry3d/Ray2d.js.map +1 -1
  155. package/lib/cjs/geometry3d/Ray3d.js.map +1 -1
  156. package/lib/cjs/geometry3d/ReusableObjectCache.js.map +1 -1
  157. package/lib/cjs/geometry3d/Segment1d.js.map +1 -1
  158. package/lib/cjs/geometry3d/SortablePolygon.js.map +1 -1
  159. package/lib/cjs/geometry3d/Transform.js.map +1 -1
  160. package/lib/cjs/geometry3d/UVSurfaceOps.js.map +1 -1
  161. package/lib/cjs/geometry3d/XYZProps.js.map +1 -1
  162. package/lib/cjs/geometry3d/YawPitchRollAngles.js.map +1 -1
  163. package/lib/cjs/geometry4d/Map4d.js.map +1 -1
  164. package/lib/cjs/geometry4d/Matrix4d.js.map +1 -1
  165. package/lib/cjs/geometry4d/MomentData.js.map +1 -1
  166. package/lib/cjs/geometry4d/PlaneByOriginAndVectors4d.js.map +1 -1
  167. package/lib/cjs/geometry4d/Point4d.js.map +1 -1
  168. package/lib/cjs/numerics/BandedSystem.js.map +1 -1
  169. package/lib/cjs/numerics/BezierPolynomials.js.map +1 -1
  170. package/lib/cjs/numerics/ClusterableArray.js.map +1 -1
  171. package/lib/cjs/numerics/Complex.js.map +1 -1
  172. package/lib/cjs/numerics/ConvexPolygon2d.js.map +1 -1
  173. package/lib/cjs/numerics/Newton.js.map +1 -1
  174. package/lib/cjs/numerics/PascalCoefficients.js.map +1 -1
  175. package/lib/cjs/numerics/PolarData.js.map +1 -1
  176. package/lib/cjs/numerics/Polynomials.js.map +1 -1
  177. package/lib/cjs/numerics/Quadrature.js.map +1 -1
  178. package/lib/cjs/numerics/Range1dArray.js.map +1 -1
  179. package/lib/cjs/numerics/SmallSystem.js.map +1 -1
  180. package/lib/cjs/numerics/TriDiagonalSystem.js.map +1 -1
  181. package/lib/cjs/numerics/UnionFind.js.map +1 -1
  182. package/lib/cjs/numerics/UsageSums.js.map +1 -1
  183. package/lib/cjs/polyface/AuxData.js.map +1 -1
  184. package/lib/cjs/polyface/BoxTopology.js.map +1 -1
  185. package/lib/cjs/polyface/FacetFaceData.js.map +1 -1
  186. package/lib/cjs/polyface/FacetLocationDetail.js.map +1 -1
  187. package/lib/cjs/polyface/FacetOrientation.js.map +1 -1
  188. package/lib/cjs/polyface/GreedyTriangulationBetweenLineStrings.js.map +1 -1
  189. package/lib/cjs/polyface/IndexedEdgeMatcher.js.map +1 -1
  190. package/lib/cjs/polyface/IndexedPolyfaceVisitor.js.map +1 -1
  191. package/lib/cjs/polyface/IndexedPolyfaceWalker.js.map +1 -1
  192. package/lib/cjs/polyface/Polyface.js.map +1 -1
  193. package/lib/cjs/polyface/PolyfaceBuilder.js.map +1 -1
  194. package/lib/cjs/polyface/PolyfaceClip.js.map +1 -1
  195. package/lib/cjs/polyface/PolyfaceData.js.map +1 -1
  196. package/lib/cjs/polyface/PolyfaceQuery.js.map +1 -1
  197. package/lib/cjs/polyface/RangeLengthData.js.map +1 -1
  198. package/lib/cjs/polyface/RangeTree/LineString3dRangeTreeContext.js.map +1 -1
  199. package/lib/cjs/polyface/RangeTree/MinimumValueTester.js.map +1 -1
  200. package/lib/cjs/polyface/RangeTree/Point3dArrayRangeTreeContext.js.map +1 -1
  201. package/lib/cjs/polyface/RangeTree/PolyfaceRangeTreeContext.js.map +1 -1
  202. package/lib/cjs/polyface/RangeTree/RangeTreeNode.js.map +1 -1
  203. package/lib/cjs/polyface/RangeTree/RangeTreeSearchHandlers.js.map +1 -1
  204. package/lib/cjs/polyface/TaggedNumericData.js.map +1 -1
  205. package/lib/cjs/polyface/TriangleCandidate.js.map +1 -1
  206. package/lib/cjs/polyface/multiclip/BuildAverageNormalsContext.js.map +1 -1
  207. package/lib/cjs/polyface/multiclip/GriddedRaggedRange2dSet.js.map +1 -1
  208. package/lib/cjs/polyface/multiclip/GriddedRaggedRange2dSetWithOverflow.js.map +1 -1
  209. package/lib/cjs/polyface/multiclip/LinearSearchRange2dArray.js.map +1 -1
  210. package/lib/cjs/polyface/multiclip/OffsetMeshContext.js.map +1 -1
  211. package/lib/cjs/polyface/multiclip/Range2dSearchInterface.js.map +1 -1
  212. package/lib/cjs/polyface/multiclip/RangeSearch.js.map +1 -1
  213. package/lib/cjs/polyface/multiclip/SweepLineStringToFacetContext.js.map +1 -1
  214. package/lib/cjs/polyface/multiclip/XYPointBuckets.js.map +1 -1
  215. package/lib/cjs/serialization/BGFBAccessors.js.map +1 -1
  216. package/lib/cjs/serialization/BGFBReader.js.map +1 -1
  217. package/lib/cjs/serialization/BGFBWriter.js.map +1 -1
  218. package/lib/cjs/serialization/BentleyGeometryFlatBuffer.js.map +1 -1
  219. package/lib/cjs/serialization/DeepCompare.js.map +1 -1
  220. package/lib/cjs/serialization/GeometrySamples.js.map +1 -1
  221. package/lib/cjs/serialization/IModelJsonSchema.js.map +1 -1
  222. package/lib/cjs/serialization/SerializationHelpers.js.map +1 -1
  223. package/lib/cjs/solid/Box.js.map +1 -1
  224. package/lib/cjs/solid/Cone.js.map +1 -1
  225. package/lib/cjs/solid/LinearSweep.js.map +1 -1
  226. package/lib/cjs/solid/RotationalSweep.js.map +1 -1
  227. package/lib/cjs/solid/RuledSweep.js.map +1 -1
  228. package/lib/cjs/solid/SolidPrimitive.js.map +1 -1
  229. package/lib/cjs/solid/Sphere.js.map +1 -1
  230. package/lib/cjs/solid/SweepContour.js.map +1 -1
  231. package/lib/cjs/solid/TorusPipe.js.map +1 -1
  232. package/lib/cjs/topology/ChainMerge.js.map +1 -1
  233. package/lib/cjs/topology/Graph.js.map +1 -1
  234. package/lib/cjs/topology/HalfEdgeGraphFromIndexedLoopsContext.js.map +1 -1
  235. package/lib/cjs/topology/HalfEdgeGraphSearch.js.map +1 -1
  236. package/lib/cjs/topology/HalfEdgeGraphSpineContext.js.map +1 -1
  237. package/lib/cjs/topology/HalfEdgeGraphValidation.js.map +1 -1
  238. package/lib/cjs/topology/HalfEdgeMarkSet.js.map +1 -1
  239. package/lib/cjs/topology/HalfEdgeNodeXYZUV.js.map +1 -1
  240. package/lib/cjs/topology/HalfEdgePointInGraphSearch.js.map +1 -1
  241. package/lib/cjs/topology/HalfEdgePositionDetail.js.map +1 -1
  242. package/lib/cjs/topology/HalfEdgePriorityQueue.js.map +1 -1
  243. package/lib/cjs/topology/InsertAndRetriangulateContext.js.map +1 -1
  244. package/lib/cjs/topology/MaskManager.js.map +1 -1
  245. package/lib/cjs/topology/Merging.js.map +1 -1
  246. package/lib/cjs/topology/RegularizeFace.js.map +1 -1
  247. package/lib/cjs/topology/SignedDataSummary.js.map +1 -1
  248. package/lib/cjs/topology/SpaceTriangulation.js.map +1 -1
  249. package/lib/cjs/topology/Triangulation.js.map +1 -1
  250. package/lib/cjs/topology/Voronoi.js.map +1 -1
  251. package/lib/cjs/topology/XYParitySearchContext.js.map +1 -1
  252. package/lib/esm/Constant.js.map +1 -1
  253. package/lib/esm/Geometry.js.map +1 -1
  254. package/lib/esm/bspline/AkimaCurve3d.js.map +1 -1
  255. package/lib/esm/bspline/BSpline1dNd.js.map +1 -1
  256. package/lib/esm/bspline/BSplineCurve.js.map +1 -1
  257. package/lib/esm/bspline/BSplineCurve3dH.js.map +1 -1
  258. package/lib/esm/bspline/BSplineCurveOps.js.map +1 -1
  259. package/lib/esm/bspline/BSplineSurface.js.map +1 -1
  260. package/lib/esm/bspline/Bezier1dNd.js.map +1 -1
  261. package/lib/esm/bspline/BezierCurve3d.js.map +1 -1
  262. package/lib/esm/bspline/BezierCurve3dH.js.map +1 -1
  263. package/lib/esm/bspline/BezierCurveBase.js.map +1 -1
  264. package/lib/esm/bspline/InterpolationCurve3d.js.map +1 -1
  265. package/lib/esm/bspline/KnotVector.js.map +1 -1
  266. package/lib/esm/bspline/SurfaceLocationDetail.js.map +1 -1
  267. package/lib/esm/clipping/AlternatingConvexClipTree.js.map +1 -1
  268. package/lib/esm/clipping/BooleanClipFactory.js.map +1 -1
  269. package/lib/esm/clipping/BooleanClipNode.js.map +1 -1
  270. package/lib/esm/clipping/ClipPlane.js.map +1 -1
  271. package/lib/esm/clipping/ClipPrimitive.js.map +1 -1
  272. package/lib/esm/clipping/ClipUtils.js.map +1 -1
  273. package/lib/esm/clipping/ClipVector.js.map +1 -1
  274. package/lib/esm/clipping/ConvexClipPlaneSet.js.map +1 -1
  275. package/lib/esm/clipping/UnionOfConvexClipPlaneSets.js.map +1 -1
  276. package/lib/esm/clipping/internalContexts/LineStringOffsetClipperContext.js.map +1 -1
  277. package/lib/esm/core-geometry.js.map +1 -1
  278. package/lib/esm/curve/Arc3d.js.map +1 -1
  279. package/lib/esm/curve/ConstructCurveBetweenCurves.js.map +1 -1
  280. package/lib/esm/curve/CoordinateXYZ.js.map +1 -1
  281. package/lib/esm/curve/CurveChainWithDistanceIndex.js.map +1 -1
  282. package/lib/esm/curve/CurveCollection.js.map +1 -1
  283. package/lib/esm/curve/CurveCurve.js.map +1 -1
  284. package/lib/esm/curve/CurveExtendMode.js.map +1 -1
  285. package/lib/esm/curve/CurveFactory.js.map +1 -1
  286. package/lib/esm/curve/CurveLocationDetail.js.map +1 -1
  287. package/lib/esm/curve/CurveOps.js.map +1 -1
  288. package/lib/esm/curve/CurvePrimitive.js.map +1 -1
  289. package/lib/esm/curve/CurveProcessor.js.map +1 -1
  290. package/lib/esm/curve/CurveTypes.js.map +1 -1
  291. package/lib/esm/curve/CurveWireMomentsXYZ.js.map +1 -1
  292. package/lib/esm/curve/GeometryQuery.js.map +1 -1
  293. package/lib/esm/curve/LineSegment3d.js.map +1 -1
  294. package/lib/esm/curve/LineString3d.js.map +1 -1
  295. package/lib/esm/curve/Loop.js.map +1 -1
  296. package/lib/esm/curve/OffsetOptions.js.map +1 -1
  297. package/lib/esm/curve/ParityRegion.js.map +1 -1
  298. package/lib/esm/curve/Path.js.map +1 -1
  299. package/lib/esm/curve/PointString3d.js.map +1 -1
  300. package/lib/esm/curve/ProxyCurve.js.map +1 -1
  301. package/lib/esm/curve/Query/ConsolidateAdjacentPrimitivesContext.js.map +1 -1
  302. package/lib/esm/curve/Query/CurveSplitContext.js.map +1 -1
  303. package/lib/esm/curve/Query/CylindricalRange.js.map +1 -1
  304. package/lib/esm/curve/Query/InOutTests.js.map +1 -1
  305. package/lib/esm/curve/Query/PlanarSubdivision.js.map +1 -1
  306. package/lib/esm/curve/Query/StrokeCountChain.js.map +1 -1
  307. package/lib/esm/curve/Query/StrokeCountMap.js.map +1 -1
  308. package/lib/esm/curve/RegionMomentsXY.js.map +1 -1
  309. package/lib/esm/curve/RegionOps.js.map +1 -1
  310. package/lib/esm/curve/RegionOpsClassificationSweeps.js.map +1 -1
  311. package/lib/esm/curve/StrokeOptions.js.map +1 -1
  312. package/lib/esm/curve/UnionRegion.js.map +1 -1
  313. package/lib/esm/curve/internalContexts/AnnounceTangentStrokeHandler.js.map +1 -1
  314. package/lib/esm/curve/internalContexts/AppendPlaneIntersectionStrokeHandler.js.map +1 -1
  315. package/lib/esm/curve/internalContexts/ChainCollectorContext.js.map +1 -1
  316. package/lib/esm/curve/internalContexts/CloneCurvesContext.js.map +1 -1
  317. package/lib/esm/curve/internalContexts/CloneWithExpandedLineStrings.js.map +1 -1
  318. package/lib/esm/curve/internalContexts/ClosestPointStrokeHandler.js.map +1 -1
  319. package/lib/esm/curve/internalContexts/CountLinearPartsSearchContext.js.map +1 -1
  320. package/lib/esm/curve/internalContexts/CurveCurveCloseApproachXY.js.map +1 -1
  321. package/lib/esm/curve/internalContexts/CurveCurveIntersectXY.js.map +1 -1
  322. package/lib/esm/curve/internalContexts/CurveCurveIntersectXYZ.js.map +1 -1
  323. package/lib/esm/curve/internalContexts/CurveLengthContext.js.map +1 -1
  324. package/lib/esm/curve/internalContexts/CurveOffsetXYHandler.js.map +1 -1
  325. package/lib/esm/curve/internalContexts/EllipticalArcApproximationContext.js.map +1 -1
  326. package/lib/esm/curve/internalContexts/GapSearchContext.js.map +1 -1
  327. package/lib/esm/curve/internalContexts/MultiChainCollector.js.map +1 -1
  328. package/lib/esm/curve/internalContexts/NewtonRtoRStrokeHandler.js.map +1 -1
  329. package/lib/esm/curve/internalContexts/PlaneAltitudeRangeContext.js.map +1 -1
  330. package/lib/esm/curve/internalContexts/PolygonOffsetContext.js.map +1 -1
  331. package/lib/esm/curve/internalContexts/SumLengthsContext.js.map +1 -1
  332. package/lib/esm/curve/internalContexts/TransferWithSplitArcs.js.map +1 -1
  333. package/lib/esm/curve/internalContexts/TransformInPlaceContext.js.map +1 -1
  334. package/lib/esm/curve/spiral/AustralianRailCorpXYEvaluator.js.map +1 -1
  335. package/lib/esm/curve/spiral/ClothoidSeries.d.ts +5 -1
  336. package/lib/esm/curve/spiral/ClothoidSeries.d.ts.map +1 -1
  337. package/lib/esm/curve/spiral/ClothoidSeries.js +11 -6
  338. package/lib/esm/curve/spiral/ClothoidSeries.js.map +1 -1
  339. package/lib/esm/curve/spiral/CubicEvaluator.d.ts +1 -1
  340. package/lib/esm/curve/spiral/CubicEvaluator.js +1 -1
  341. package/lib/esm/curve/spiral/CubicEvaluator.js.map +1 -1
  342. package/lib/esm/curve/spiral/CzechSpiralEvaluator.d.ts +6 -6
  343. package/lib/esm/curve/spiral/CzechSpiralEvaluator.js +6 -6
  344. package/lib/esm/curve/spiral/CzechSpiralEvaluator.js.map +1 -1
  345. package/lib/esm/curve/spiral/DirectHalfCosineSpiralEvaluator.js.map +1 -1
  346. package/lib/esm/curve/spiral/DirectSpiral3d.d.ts +19 -19
  347. package/lib/esm/curve/spiral/DirectSpiral3d.d.ts.map +1 -1
  348. package/lib/esm/curve/spiral/DirectSpiral3d.js +21 -21
  349. package/lib/esm/curve/spiral/DirectSpiral3d.js.map +1 -1
  350. package/lib/esm/curve/spiral/IntegratedSpiral3d.d.ts +1 -1
  351. package/lib/esm/curve/spiral/IntegratedSpiral3d.d.ts.map +1 -1
  352. package/lib/esm/curve/spiral/IntegratedSpiral3d.js +3 -2
  353. package/lib/esm/curve/spiral/IntegratedSpiral3d.js.map +1 -1
  354. package/lib/esm/curve/spiral/MXCubicAlongArcSpiralEvaluator.d.ts +1 -1
  355. package/lib/esm/curve/spiral/MXCubicAlongArcSpiralEvaluator.js +1 -1
  356. package/lib/esm/curve/spiral/MXCubicAlongArcSpiralEvaluator.js.map +1 -1
  357. package/lib/esm/curve/spiral/NormalizedTransition.d.ts +8 -6
  358. package/lib/esm/curve/spiral/NormalizedTransition.d.ts.map +1 -1
  359. package/lib/esm/curve/spiral/NormalizedTransition.js +10 -6
  360. package/lib/esm/curve/spiral/NormalizedTransition.js.map +1 -1
  361. package/lib/esm/curve/spiral/PolishCubicSpiralEvaluator.d.ts +1 -1
  362. package/lib/esm/curve/spiral/PolishCubicSpiralEvaluator.js +1 -1
  363. package/lib/esm/curve/spiral/PolishCubicSpiralEvaluator.js.map +1 -1
  364. package/lib/esm/curve/spiral/TransitionConditionalProperties.d.ts +20 -8
  365. package/lib/esm/curve/spiral/TransitionConditionalProperties.d.ts.map +1 -1
  366. package/lib/esm/curve/spiral/TransitionConditionalProperties.js +20 -8
  367. package/lib/esm/curve/spiral/TransitionConditionalProperties.js.map +1 -1
  368. package/lib/esm/curve/spiral/TransitionSpiral3d.d.ts +5 -4
  369. package/lib/esm/curve/spiral/TransitionSpiral3d.d.ts.map +1 -1
  370. package/lib/esm/curve/spiral/TransitionSpiral3d.js.map +1 -1
  371. package/lib/esm/curve/spiral/XYCurveEvaluator.d.ts.map +1 -1
  372. package/lib/esm/curve/spiral/XYCurveEvaluator.js.map +1 -1
  373. package/lib/esm/geometry3d/Angle.js.map +1 -1
  374. package/lib/esm/geometry3d/AngleSweep.js.map +1 -1
  375. package/lib/esm/geometry3d/BarycentricTriangle.js.map +1 -1
  376. package/lib/esm/geometry3d/BilinearPatch.js.map +1 -1
  377. package/lib/esm/geometry3d/CoincidentGeometryOps.js.map +1 -1
  378. package/lib/esm/geometry3d/Ellipsoid.js.map +1 -1
  379. package/lib/esm/geometry3d/FrameBuilder.js.map +1 -1
  380. package/lib/esm/geometry3d/FrustumAnimation.js.map +1 -1
  381. package/lib/esm/geometry3d/GeometryHandler.js.map +1 -1
  382. package/lib/esm/geometry3d/GrowableBlockedArray.js.map +1 -1
  383. package/lib/esm/geometry3d/GrowableFloat64Array.js.map +1 -1
  384. package/lib/esm/geometry3d/GrowableXYArray.js.map +1 -1
  385. package/lib/esm/geometry3d/GrowableXYZArray.js.map +1 -1
  386. package/lib/esm/geometry3d/IndexedCollectionInterval.js.map +1 -1
  387. package/lib/esm/geometry3d/IndexedXYCollection.js.map +1 -1
  388. package/lib/esm/geometry3d/IndexedXYZCollection.js.map +1 -1
  389. package/lib/esm/geometry3d/LongitudeLatitudeAltitude.js.map +1 -1
  390. package/lib/esm/geometry3d/Matrix3d.js.map +1 -1
  391. package/lib/esm/geometry3d/OrderedRotationAngles.js.map +1 -1
  392. package/lib/esm/geometry3d/Plane3d.js.map +1 -1
  393. package/lib/esm/geometry3d/Plane3dByOriginAndUnitNormal.js.map +1 -1
  394. package/lib/esm/geometry3d/Plane3dByOriginAndVectors.js.map +1 -1
  395. package/lib/esm/geometry3d/Point2dArrayCarrier.js.map +1 -1
  396. package/lib/esm/geometry3d/Point2dVector2d.js.map +1 -1
  397. package/lib/esm/geometry3d/Point3dArrayCarrier.js.map +1 -1
  398. package/lib/esm/geometry3d/Point3dVector3d.js.map +1 -1
  399. package/lib/esm/geometry3d/PointHelpers.js.map +1 -1
  400. package/lib/esm/geometry3d/PointStreaming.js.map +1 -1
  401. package/lib/esm/geometry3d/PolygonOps.js.map +1 -1
  402. package/lib/esm/geometry3d/PolylineCompressionByEdgeOffset.js.map +1 -1
  403. package/lib/esm/geometry3d/PolylineOps.js.map +1 -1
  404. package/lib/esm/geometry3d/Range.js.map +1 -1
  405. package/lib/esm/geometry3d/Ray2d.js.map +1 -1
  406. package/lib/esm/geometry3d/Ray3d.js.map +1 -1
  407. package/lib/esm/geometry3d/ReusableObjectCache.js.map +1 -1
  408. package/lib/esm/geometry3d/Segment1d.js.map +1 -1
  409. package/lib/esm/geometry3d/SortablePolygon.js.map +1 -1
  410. package/lib/esm/geometry3d/Transform.js.map +1 -1
  411. package/lib/esm/geometry3d/UVSurfaceOps.js.map +1 -1
  412. package/lib/esm/geometry3d/XYZProps.js.map +1 -1
  413. package/lib/esm/geometry3d/YawPitchRollAngles.js.map +1 -1
  414. package/lib/esm/geometry4d/Map4d.js.map +1 -1
  415. package/lib/esm/geometry4d/Matrix4d.js.map +1 -1
  416. package/lib/esm/geometry4d/MomentData.js.map +1 -1
  417. package/lib/esm/geometry4d/PlaneByOriginAndVectors4d.js.map +1 -1
  418. package/lib/esm/geometry4d/Point4d.js.map +1 -1
  419. package/lib/esm/numerics/BandedSystem.js.map +1 -1
  420. package/lib/esm/numerics/BezierPolynomials.js.map +1 -1
  421. package/lib/esm/numerics/ClusterableArray.js.map +1 -1
  422. package/lib/esm/numerics/Complex.js.map +1 -1
  423. package/lib/esm/numerics/ConvexPolygon2d.js.map +1 -1
  424. package/lib/esm/numerics/Newton.js.map +1 -1
  425. package/lib/esm/numerics/PascalCoefficients.js.map +1 -1
  426. package/lib/esm/numerics/PolarData.js.map +1 -1
  427. package/lib/esm/numerics/Polynomials.js.map +1 -1
  428. package/lib/esm/numerics/Quadrature.js.map +1 -1
  429. package/lib/esm/numerics/Range1dArray.js.map +1 -1
  430. package/lib/esm/numerics/SmallSystem.js.map +1 -1
  431. package/lib/esm/numerics/TriDiagonalSystem.js.map +1 -1
  432. package/lib/esm/numerics/UnionFind.js.map +1 -1
  433. package/lib/esm/numerics/UsageSums.js.map +1 -1
  434. package/lib/esm/polyface/AuxData.js.map +1 -1
  435. package/lib/esm/polyface/BoxTopology.js.map +1 -1
  436. package/lib/esm/polyface/FacetFaceData.js.map +1 -1
  437. package/lib/esm/polyface/FacetLocationDetail.js.map +1 -1
  438. package/lib/esm/polyface/FacetOrientation.js.map +1 -1
  439. package/lib/esm/polyface/GreedyTriangulationBetweenLineStrings.js.map +1 -1
  440. package/lib/esm/polyface/IndexedEdgeMatcher.js.map +1 -1
  441. package/lib/esm/polyface/IndexedPolyfaceVisitor.js.map +1 -1
  442. package/lib/esm/polyface/IndexedPolyfaceWalker.js.map +1 -1
  443. package/lib/esm/polyface/Polyface.js.map +1 -1
  444. package/lib/esm/polyface/PolyfaceBuilder.js.map +1 -1
  445. package/lib/esm/polyface/PolyfaceClip.js.map +1 -1
  446. package/lib/esm/polyface/PolyfaceData.js.map +1 -1
  447. package/lib/esm/polyface/PolyfaceQuery.js.map +1 -1
  448. package/lib/esm/polyface/RangeLengthData.js.map +1 -1
  449. package/lib/esm/polyface/RangeTree/LineString3dRangeTreeContext.js.map +1 -1
  450. package/lib/esm/polyface/RangeTree/MinimumValueTester.js.map +1 -1
  451. package/lib/esm/polyface/RangeTree/Point3dArrayRangeTreeContext.js.map +1 -1
  452. package/lib/esm/polyface/RangeTree/PolyfaceRangeTreeContext.js.map +1 -1
  453. package/lib/esm/polyface/RangeTree/RangeTreeNode.js.map +1 -1
  454. package/lib/esm/polyface/RangeTree/RangeTreeSearchHandlers.js.map +1 -1
  455. package/lib/esm/polyface/TaggedNumericData.js.map +1 -1
  456. package/lib/esm/polyface/TriangleCandidate.js.map +1 -1
  457. package/lib/esm/polyface/multiclip/BuildAverageNormalsContext.js.map +1 -1
  458. package/lib/esm/polyface/multiclip/GriddedRaggedRange2dSet.js.map +1 -1
  459. package/lib/esm/polyface/multiclip/GriddedRaggedRange2dSetWithOverflow.js.map +1 -1
  460. package/lib/esm/polyface/multiclip/LinearSearchRange2dArray.js.map +1 -1
  461. package/lib/esm/polyface/multiclip/OffsetMeshContext.js.map +1 -1
  462. package/lib/esm/polyface/multiclip/Range2dSearchInterface.js.map +1 -1
  463. package/lib/esm/polyface/multiclip/RangeSearch.js.map +1 -1
  464. package/lib/esm/polyface/multiclip/SweepLineStringToFacetContext.js.map +1 -1
  465. package/lib/esm/polyface/multiclip/XYPointBuckets.js.map +1 -1
  466. package/lib/esm/serialization/BGFBAccessors.js.map +1 -1
  467. package/lib/esm/serialization/BGFBReader.js.map +1 -1
  468. package/lib/esm/serialization/BGFBWriter.js.map +1 -1
  469. package/lib/esm/serialization/BentleyGeometryFlatBuffer.js.map +1 -1
  470. package/lib/esm/serialization/DeepCompare.js.map +1 -1
  471. package/lib/esm/serialization/GeometrySamples.js.map +1 -1
  472. package/lib/esm/serialization/IModelJsonSchema.js.map +1 -1
  473. package/lib/esm/serialization/SerializationHelpers.js.map +1 -1
  474. package/lib/esm/solid/Box.js.map +1 -1
  475. package/lib/esm/solid/Cone.js.map +1 -1
  476. package/lib/esm/solid/LinearSweep.js.map +1 -1
  477. package/lib/esm/solid/RotationalSweep.js.map +1 -1
  478. package/lib/esm/solid/RuledSweep.js.map +1 -1
  479. package/lib/esm/solid/SolidPrimitive.js.map +1 -1
  480. package/lib/esm/solid/Sphere.js.map +1 -1
  481. package/lib/esm/solid/SweepContour.js.map +1 -1
  482. package/lib/esm/solid/TorusPipe.js.map +1 -1
  483. package/lib/esm/topology/ChainMerge.js.map +1 -1
  484. package/lib/esm/topology/Graph.js.map +1 -1
  485. package/lib/esm/topology/HalfEdgeGraphFromIndexedLoopsContext.js.map +1 -1
  486. package/lib/esm/topology/HalfEdgeGraphSearch.js.map +1 -1
  487. package/lib/esm/topology/HalfEdgeGraphSpineContext.js.map +1 -1
  488. package/lib/esm/topology/HalfEdgeGraphValidation.js.map +1 -1
  489. package/lib/esm/topology/HalfEdgeMarkSet.js.map +1 -1
  490. package/lib/esm/topology/HalfEdgeNodeXYZUV.js.map +1 -1
  491. package/lib/esm/topology/HalfEdgePointInGraphSearch.js.map +1 -1
  492. package/lib/esm/topology/HalfEdgePositionDetail.js.map +1 -1
  493. package/lib/esm/topology/HalfEdgePriorityQueue.js.map +1 -1
  494. package/lib/esm/topology/InsertAndRetriangulateContext.js.map +1 -1
  495. package/lib/esm/topology/MaskManager.js.map +1 -1
  496. package/lib/esm/topology/Merging.js.map +1 -1
  497. package/lib/esm/topology/RegularizeFace.js.map +1 -1
  498. package/lib/esm/topology/SignedDataSummary.js.map +1 -1
  499. package/lib/esm/topology/SpaceTriangulation.js.map +1 -1
  500. package/lib/esm/topology/Triangulation.js.map +1 -1
  501. package/lib/esm/topology/Voronoi.js.map +1 -1
  502. package/lib/esm/topology/XYParitySearchContext.js.map +1 -1
  503. package/package.json +3 -3
@@ -13,12 +13,12 @@ exports.NormalizedCosineTransition = exports.NormalizedSineTransition = exports.
13
13
  * * Each function maps fractional progress to a curvature value.
14
14
  * * f(0) === 0
15
15
  * * f(1) === 1
16
- * * f(u) === 1 - f (1-u)
16
+ * * f(u) === 1 - f(1-u)
17
17
  * * Each implementation provides:
18
18
  * * fractionToCurvature -- the f(u) function described above
19
19
  * * fractionToCurvatureDerivative -- df(u)/du
20
20
  * * fractionToArea -- integral of the area under f(u) from 0 to u.
21
- * * the symmetry condition ensures that the integral from 0 to 1 is 1/2
21
+ * * The symmetry condition ensures that the integral from 0 to 1 is 1/2.
22
22
  * @internal
23
23
  */
24
24
  class NormalizedTransition {
@@ -62,7 +62,9 @@ exports.NormalizedTransition = NormalizedTransition;
62
62
  * @internal
63
63
  */
64
64
  class NormalizedClothoidTransition extends NormalizedTransition {
65
- constructor() { super(); }
65
+ constructor() {
66
+ super();
67
+ }
66
68
  /** At fractional position on the x axis, return the (normalized) curvature fraction. */
67
69
  fractionToCurvatureFraction(fractionX) {
68
70
  return fractionX;
@@ -91,7 +93,7 @@ class NormalizedBlossTransition extends NormalizedTransition {
91
93
  // 2nd derivative 6 - 12 x
92
94
  // derivatives zero at 0,1
93
95
  // inflection zero at 0.5
94
- // integral is x^3 - x^4 / 2 = x^3 ( 1-x/2)
96
+ // integral is x^3 - x^4 / 2 = x^3 (1-x/2)
95
97
  constructor() { super(); }
96
98
  /** At fractional position on the x axis, return the (normalized) curvature fraction. */
97
99
  fractionToCurvatureFraction(u) {
@@ -175,7 +177,8 @@ class NormalizedSineTransition extends NormalizedTransition {
175
177
  const a = 2.0 * Math.PI;
176
178
  return 1 - Math.cos(u * a);
177
179
  }
178
- /** Return the integrated area under the curve.
180
+ /**
181
+ * Return the integrated area under the curve.
179
182
  * * This fraction is the angular change fraction.
180
183
  */
181
184
  fractionToArea(u) {
@@ -201,7 +204,8 @@ class NormalizedCosineTransition extends NormalizedTransition {
201
204
  const a = Math.PI;
202
205
  return 0.5 * a * Math.sin(u * a);
203
206
  }
204
- /** Return the integrated area under the curve.
207
+ /**
208
+ * Return the integrated area under the curve.
205
209
  * * This fraction is the angular change fraction.
206
210
  */
207
211
  fractionToArea(u) {
@@ -1 +1 @@
1
- {"version":3,"file":"NormalizedTransition.js","sourceRoot":"","sources":["../../../../src/curve/spiral/NormalizedTransition.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;;;AAE/F;;GAEG;AAEH;;;;;;;;;;;;GAYG;AACH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C,EAAE,CAAC;QACxB,OAAO,CAAC,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC;IAC7B,CAAC;IACD;;OAEG;IACI,cAAc,CAAC,CAAS;QAC7B,MAAM,CAAC,GAAG,GAAG,GAAG,IAAI,CAAC,EAAE,CAAC;QACxB,OAAO,GAAG,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,GAAG,GAAG,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC;IACzD,CAAC;CACF;AAnBD,4DAmBC;AAED;;;;GAIG;AACH,MAAa,0BAA2B,SAAQ,oBAAoB;IAClE,gBAAgB,KAAK,EAAE,CAAC,CAAC,CAAC;IAC1B,wFAAwF;IACjF,2BAA2B,CAAC,CAAS;QAC1C,MAAM,CAAC,GAAG,IAAI,CAAC,EAAE,CAAC;QAClB,OAAO,GAAG,GAAG,CAAC,CAAC,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;IACrC,CAAC;IACD,oEAAoE;IAC7D,qCAAqC,CAAC,CAAS;QACpD,MAAM,CAAC,GAAG,IAAI,CAAC,EAAE,CAAC;QAClB,OAAO,GAAG,GAAG,CAAC,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC;IACnC,CAAC;IACD;;OAEG;IACI,cAAc,CAAC,CAAS;QAC7B,MAAM,CAAC,GAAG,IAAI,CAAC,EAAE,CAAC;QAClB,OAAO,GAAG,GAAG,CAAC,GAAG,GAAG,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC;IAC7C,CAAC;CACF;AAnBD,gEAmBC","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 Curve\n */\n\n/**\n * NormalizedTransition is the (abstract) base class for clothoid, bloss, biquadratic, sine, and cosine transition functions.\n * * Each function maps fractional progress to a curvature value.\n * * f(0) === 0\n * * f(1) === 1\n * * f(u) === 1 - f (1-u)\n * * Each implementation provides:\n * * fractionToCurvature -- the f(u) function described above\n * * fractionToCurvatureDerivative -- df(u)/du\n * * fractionToArea -- integral of the area under f(u) from 0 to u.\n * * the symmetry condition ensures that the integral from 0 to 1 is 1/2\n * @internal\n */\nexport abstract class NormalizedTransition {\n /** Constructor initializes with 0..1 values. Call \"setBearingCurvatureLengthCurvature\" to apply real values. */\n constructor() { }\n /** At fractional position on the x axis, return the (normalized) curvature fraction. */\n public abstract fractionToCurvatureFraction(fractionX: number): number;\n /** Return the derivative of the (normalized) curvature fraction */\n public abstract fractionToCurvatureFractionDerivative(fractionX: number): number;\n /**\n * Return the integrated area under the curve\n * * This is equal to the accumulated angle change.\n */\n public abstract fractionToArea(fractionX: number): number;\n private static _clothoidEvaluator?: NormalizedClothoidTransition;\n private static _biquadraticEvaluator?: NormalizedBiQuadraticTransition;\n private static _blossEvaluator?: NormalizedBlossTransition;\n private static _sineEvaluator?: NormalizedSineTransition;\n private static _cosineEvaluator?: NormalizedCosineTransition;\n /**\n * Return a standard evaluator identified by string as:\n * * clothoid\n * * bloss\n * * biquadratic\n * * sine\n * * cosine\n * Each of these types\n * * is instantiated (only once) as a single static object within the NormalizedTransition class.\n * * has no instance data or mutator methods.\n * @param name string name of the transition.\n */\n public static findEvaluator(name: string): NormalizedTransition | undefined {\n if (name === \"clothoid\")\n return this._clothoidEvaluator ? this._clothoidEvaluator : (this._clothoidEvaluator = new NormalizedClothoidTransition());\n if (name === \"bloss\")\n return this._blossEvaluator ? this._blossEvaluator : (this._blossEvaluator = new NormalizedBlossTransition());\n if (name === \"biquadratic\")\n return this._biquadraticEvaluator ? this._biquadraticEvaluator : (this._biquadraticEvaluator = new NormalizedBiQuadraticTransition());\n if (name === \"sine\")\n return this._sineEvaluator ? this._sineEvaluator : (this._sineEvaluator = new NormalizedSineTransition());\n if (name === \"cosine\")\n return this._cosineEvaluator ? this._cosineEvaluator : (this._cosineEvaluator = new NormalizedCosineTransition());\n return undefined;\n }\n}\n\n/**\n * Transition functions for clothoid spiral.\n * * curvature variation is linear from (0,0) to (1,1)\n * @internal\n */\nexport class NormalizedClothoidTransition extends NormalizedTransition {\n constructor() { super(); }\n /** At fractional position on the x axis, return the (normalized) curvature fraction. */\n public fractionToCurvatureFraction(fractionX: number): number {\n return fractionX;\n }\n /** Return the derivative of the (normalized) curvature fraction. */\n public fractionToCurvatureFractionDerivative(_u: number): number {\n return 1.0;\n }\n /**\n * Return the integrated area under the curve.\n * * This fraction is the angular change fraction.\n */\n public fractionToArea(fractionX: number): number {\n return fractionX * fractionX * 0.5;\n }\n}\n\n/**\n * Transition functions for bloss spiral.\n * * curvature variation is cubic from (0,0) with slope 0 to (1,1) with slope 1.\n * @internal\n */\nexport class NormalizedBlossTransition extends NormalizedTransition {\n // bloss curve is (3 - 2x) x ^2 = 3 x^2 - 2 x^3\n // derivative 6x (1-x)\n // 2nd derivative 6 - 12 x\n // derivatives zero at 0,1\n // inflection zero at 0.5\n // integral is x^3 - x^4 / 2 = x^3 ( 1-x/2)\n constructor() { super(); }\n /** At fractional position on the x axis, return the (normalized) curvature fraction. */\n public fractionToCurvatureFraction(u: number): number {\n return u * u * (3 - 2 * u);\n }\n /** Return the derivative of the (normalized) curvature fraction. */\n public fractionToCurvatureFractionDerivative(u: number): number {\n return 6.0 * u * (1.0 - u);\n }\n /**\n * Return the integrated area under the curve.\n * * This fraction is the angular change fraction.\n */\n public fractionToArea(u: number): number {\n return u * u * u * (1 - 0.5 * u);\n }\n}\n\n/**\n * Transition functions for biquadratic transition.\n * * Curvature is a pair of joining quadratics.\n * * In lower half of the interval, the quadratic is from (0,0) to (0.5, 0.5) with zero slope at origin.\n * * In upper half of the interval, the quadratic is from (0.5,0.5) to (1,1) with zero slope at 1.\n * @internal\n */\nexport class NormalizedBiQuadraticTransition extends NormalizedTransition {\n constructor() {\n super();\n }\n private integratedBasis(u: number): number {\n return u * u * u * (2.0 / 3.0);\n }\n private basis(u: number): number {\n return 2 * u * u;\n }\n private basisDerivative(u: number): number {\n return 4 * u;\n }\n /**\n * At fractional position on the x axis, return the (normalized) curvature fraction.\n * * For [u <= 0.5, u >= 0.5]\n * * f(u) = [2 u^2, 1 - 2 (1-u)^2]\n * * f'(u) = [4 u, 4 (1-u)]\n * * If(u) = [2 u^3 / 3, 0.5 (1 -u )^3/3]\n */\n public fractionToCurvatureFraction(u: number): number {\n return u <= 0.5 ? this.basis(u) : 1.0 - this.basis(1.0 - u);\n }\n /** Return the derivative of the (normalized) curvature fraction. */\n public fractionToCurvatureFractionDerivative(u: number): number {\n return u < 0.5 ? this.basisDerivative(u) : this.basisDerivative(1 - u);\n }\n /**\n * Return the integrated area under the curve.\n * * This fraction is the angular change fraction.\n */\n public fractionToArea(u: number): number {\n if (u <= 0.5)\n return this.integratedBasis(u);\n const v = 1 - u;\n return 0.5 - v + this.integratedBasis(v);\n }\n}\n\n/**\n * Transition functions for sine transition.\n * * curvature variation is the sum of\n * * straight line from (0,0) to (1,1), like clothoid.\n * * additional full period of a sine wave, producing 0 slope at both ends.\n * @internal\n */\nexport class NormalizedSineTransition extends NormalizedTransition {\n constructor() { super(); }\n /** At fractional position on the x axis, return the (normalized) curvature fraction. */\n public fractionToCurvatureFraction(u: number): number {\n const a = 2.0 * Math.PI;\n return u - Math.sin(u * a) / a;\n }\n /** Return the derivative of the (normalized) curvature fraction. */\n public fractionToCurvatureFractionDerivative(u: number): number {\n const a = 2.0 * Math.PI;\n return 1 - Math.cos(u * a);\n }\n /** Return the integrated area under the curve.\n * * This fraction is the angular change fraction.\n */\n public fractionToArea(u: number): number {\n const a = 2.0 * Math.PI;\n return 0.5 * u * u + (Math.cos(u * a) - 1.0) / (a * a);\n }\n}\n\n/**\n * Transition functions for cosine.\n * * curvature variation is a half period of a cosine.\n * @internal\n */\nexport class NormalizedCosineTransition extends NormalizedTransition {\n constructor() { super(); }\n /** At fractional position on the x axis, return the (normalized) curvature fraction. */\n public fractionToCurvatureFraction(u: number): number {\n const a = Math.PI;\n return 0.5 * (1 - Math.cos(u * a));\n }\n /** Return the derivative of the (normalized) curvature fraction. */\n public fractionToCurvatureFractionDerivative(u: number): number {\n const a = Math.PI;\n return 0.5 * a * Math.sin(u * a);\n }\n /** Return the integrated area under the curve.\n * * This fraction is the angular change fraction.\n */\n public fractionToArea(u: number): number {\n const a = Math.PI;\n return 0.5 * u - 0.5 * Math.sin(u * a) / a;\n }\n}\n"]}
1
+ {"version":3,"file":"NormalizedTransition.js","sourceRoot":"","sources":["../../../../src/curve/spiral/NormalizedTransition.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;;;AAE/F;;GAEG;AAEH;;;;;;;;;;;;GAYG;AACH,MAAsB,oBAAoB;IACxC,gHAAgH;IAChH,gBAAgB,CAAC;IAUT,MAAM,CAAC,kBAAkB,CAAgC;IACzD,MAAM,CAAC,qBAAqB,CAAmC;IAC/D,MAAM,CAAC,eAAe,CAA6B;IACnD,MAAM,CAAC,cAAc,CAA4B;IACjD,MAAM,CAAC,gBAAgB,CAA8B;IAC7D;;;;;;;;;;;OAWG;IACI,MAAM,CAAC,aAAa,CAAC,IAAY;QACtC,IAAI,IAAI,KAAK,UAAU;YACrB,OAAO,IAAI,CAAC,kBAAkB,CAAC,CAAC,CAAC,IAAI,CAAC,kBAAkB,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,kBAAkB,GAAG,IAAI,4BAA4B,EAAE,CAAC,CAAC;QAC5H,IAAI,IAAI,KAAK,OAAO;YAClB,OAAO,IAAI,CAAC,eAAe,CAAC,CAAC,CAAC,IAAI,CAAC,eAAe,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,eAAe,GAAG,IAAI,yBAAyB,EAAE,CAAC,CAAC;QAChH,IAAI,IAA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AAC,CAAC,CAAC,CAAC;IACrC,CAAC;IACD,oEAAoE;IAC7D,qCAAqC,CAAC,CAAS;QACpD,MAAM,CAAC,GAAG,IAAI,CAAC,EAAE,CAAC;QAClB,OAAO,GAAG,GAAG,CAAC,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC;IACnC,CAAC;IACD;;;OAGG;IACI,cAAc,CAAC,CAAS;QAC7B,MAAM,CAAC,GAAG,IAAI,CAAC,EAAE,CAAC;QAClB,OAAO,GAAG,GAAG,CAAC,GAAG,GAAG,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC;IAC7C,CAAC;CACF;AApBD,gEAoBC","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 Curve\r\n */\r\n\r\n/**\r\n * NormalizedTransition is the (abstract) base class for clothoid, bloss, biquadratic, sine, and cosine transition functions.\r\n * * Each function maps fractional progress to a curvature value.\r\n * * f(0) === 0\r\n * * f(1) === 1\r\n * * f(u) === 1 - f(1-u)\r\n * * Each implementation provides:\r\n * * fractionToCurvature -- the f(u) function described above\r\n * * fractionToCurvatureDerivative -- df(u)/du\r\n * * fractionToArea -- integral of the area under f(u) from 0 to u.\r\n * * The symmetry condition ensures that the integral from 0 to 1 is 1/2.\r\n * @internal\r\n */\r\nexport abstract class NormalizedTransition {\r\n /** Constructor initializes with 0..1 values. Call \"setBearingCurvatureLengthCurvature\" to apply real values. */\r\n constructor() { }\r\n /** At fractional position on the x axis, return the (normalized) curvature fraction. */\r\n public abstract fractionToCurvatureFraction(fractionX: number): number;\r\n /** Return the derivative of the (normalized) curvature fraction. */\r\n public abstract fractionToCurvatureFractionDerivative(fractionX: number): number;\r\n /**\r\n * Return the integrated area under the curve.\r\n * * This is equal to the accumulated angle change.\r\n */\r\n public abstract fractionToArea(fractionX: number): number;\r\n private static _clothoidEvaluator?: NormalizedClothoidTransition;\r\n private static _biquadraticEvaluator?: NormalizedBiQuadraticTransition;\r\n private static _blossEvaluator?: NormalizedBlossTransition;\r\n private static _sineEvaluator?: NormalizedSineTransition;\r\n private static _cosineEvaluator?: NormalizedCosineTransition;\r\n /**\r\n * Return a standard evaluator identified by string as:\r\n * * clothoid\r\n * * bloss\r\n * * biquadratic\r\n * * sine\r\n * * cosine\r\n * Each of these types\r\n * * is instantiated (only once) as a single static object within the NormalizedTransition class.\r\n * * has no instance data or mutator methods.\r\n * @param name string name of the transition.\r\n */\r\n public static findEvaluator(name: string): NormalizedTransition | undefined {\r\n if (name === \"clothoid\")\r\n return this._clothoidEvaluator ? this._clothoidEvaluator : (this._clothoidEvaluator = new NormalizedClothoidTransition());\r\n if (name === \"bloss\")\r\n return this._blossEvaluator ? this._blossEvaluator : (this._blossEvaluator = new NormalizedBlossTransition());\r\n if (name === \"biquadratic\")\r\n return this._biquadraticEvaluator ? this._biquadraticEvaluator : (this._biquadraticEvaluator = new NormalizedBiQuadraticTransition());\r\n if (name === \"sine\")\r\n return this._sineEvaluator ? this._sineEvaluator : (this._sineEvaluator = new NormalizedSineTransition());\r\n if (name === \"cosine\")\r\n return this._cosineEvaluator ? this._cosineEvaluator : (this._cosineEvaluator = new NormalizedCosineTransition());\r\n return undefined;\r\n }\r\n}\r\n\r\n/**\r\n * Transition functions for clothoid spiral.\r\n * * curvature variation is linear from (0,0) to (1,1)\r\n * @internal\r\n */\r\nexport class NormalizedClothoidTransition extends NormalizedTransition {\r\n constructor() {\r\n super();\r\n }\r\n /** At fractional position on the x axis, return the (normalized) curvature fraction. */\r\n public fractionToCurvatureFraction(fractionX: number): number {\r\n return fractionX;\r\n }\r\n /** Return the derivative of the (normalized) curvature fraction. */\r\n public fractionToCurvatureFractionDerivative(_u: number): number {\r\n return 1.0;\r\n }\r\n /**\r\n * Return the integrated area under the curve.\r\n * * This fraction is the angular change fraction.\r\n */\r\n public fractionToArea(fractionX: number): number {\r\n return fractionX * fractionX * 0.5;\r\n }\r\n}\r\n\r\n/**\r\n * Transition functions for bloss spiral.\r\n * * curvature variation is cubic from (0,0) with slope 0 to (1,1) with slope 1.\r\n * @internal\r\n */\r\nexport class NormalizedBlossTransition extends NormalizedTransition {\r\n // bloss curve is (3 - 2x) x ^2 = 3 x^2 - 2 x^3\r\n // derivative 6x (1-x)\r\n // 2nd derivative 6 - 12 x\r\n // derivatives zero at 0,1\r\n // inflection zero at 0.5\r\n // integral is x^3 - x^4 / 2 = x^3 (1-x/2)\r\n constructor() { super(); }\r\n /** At fractional position on the x axis, return the (normalized) curvature fraction. */\r\n public fractionToCurvatureFraction(u: number): number {\r\n return u * u * (3 - 2 * u);\r\n }\r\n /** Return the derivative of the (normalized) curvature fraction. */\r\n public fractionToCurvatureFractionDerivative(u: number): number {\r\n return 6.0 * u * (1.0 - u);\r\n }\r\n /**\r\n * Return the integrated area under the curve.\r\n * * This fraction is the angular change fraction.\r\n */\r\n public fractionToArea(u: number): number {\r\n return u * u * u * (1 - 0.5 * u);\r\n }\r\n}\r\n\r\n/**\r\n * Transition functions for biquadratic transition.\r\n * * Curvature is a pair of joining quadratics.\r\n * * In lower half of the interval, the quadratic is from (0,0) to (0.5, 0.5) with zero slope at origin.\r\n * * In upper half of the interval, the quadratic is from (0.5,0.5) to (1,1) with zero slope at 1.\r\n * @internal\r\n */\r\nexport class NormalizedBiQuadraticTransition extends NormalizedTransition {\r\n constructor() {\r\n super();\r\n }\r\n private integratedBasis(u: number): number {\r\n return u * u * u * (2.0 / 3.0);\r\n }\r\n private basis(u: number): number {\r\n return 2 * u * u;\r\n }\r\n private basisDerivative(u: number): number {\r\n return 4 * u;\r\n }\r\n /**\r\n * At fractional position on the x axis, return the (normalized) curvature fraction.\r\n * * For [u <= 0.5, u >= 0.5]\r\n * * f(u) = [2 u^2, 1 - 2 (1-u)^2]\r\n * * f'(u) = [4 u, 4 (1-u)]\r\n * * If(u) = [2 u^3 / 3, 0.5 (1 -u )^3/3]\r\n */\r\n public fractionToCurvatureFraction(u: number): number {\r\n return u <= 0.5 ? this.basis(u) : 1.0 - this.basis(1.0 - u);\r\n }\r\n /** Return the derivative of the (normalized) curvature fraction. */\r\n public fractionToCurvatureFractionDerivative(u: number): number {\r\n return u < 0.5 ? this.basisDerivative(u) : this.basisDerivative(1 - u);\r\n }\r\n /**\r\n * Return the integrated area under the curve.\r\n * * This fraction is the angular change fraction.\r\n */\r\n public fractionToArea(u: number): number {\r\n if (u <= 0.5)\r\n return this.integratedBasis(u);\r\n const v = 1 - u;\r\n return 0.5 - v + this.integratedBasis(v);\r\n }\r\n}\r\n\r\n/**\r\n * Transition functions for sine transition.\r\n * * curvature variation is the sum of\r\n * * straight line from (0,0) to (1,1), like clothoid.\r\n * * additional full period of a sine wave, producing 0 slope at both ends.\r\n * @internal\r\n */\r\nexport class NormalizedSineTransition extends NormalizedTransition {\r\n constructor() { super(); }\r\n /** At fractional position on the x axis, return the (normalized) curvature fraction. */\r\n public fractionToCurvatureFraction(u: number): number {\r\n const a = 2.0 * Math.PI;\r\n return u - Math.sin(u * a) / a;\r\n }\r\n /** Return the derivative of the (normalized) curvature fraction. */\r\n public fractionToCurvatureFractionDerivative(u: number): number {\r\n const a = 2.0 * Math.PI;\r\n return 1 - Math.cos(u * a);\r\n }\r\n /**\r\n * Return the integrated area under the curve.\r\n * * This fraction is the angular change fraction.\r\n */\r\n public fractionToArea(u: number): number {\r\n const a = 2.0 * Math.PI;\r\n return 0.5 * u * u + (Math.cos(u * a) - 1.0) / (a * a);\r\n }\r\n}\r\n\r\n/**\r\n * Transition functions for cosine.\r\n * * curvature variation is a half period of a cosine.\r\n * @internal\r\n */\r\nexport class NormalizedCosineTransition extends NormalizedTransition {\r\n constructor() { super(); }\r\n /** At fractional position on the x axis, return the (normalized) curvature fraction. */\r\n public fractionToCurvatureFraction(u: number): number {\r\n const a = Math.PI;\r\n return 0.5 * (1 - Math.cos(u * a));\r\n }\r\n /** Return the derivative of the (normalized) curvature fraction. */\r\n public fractionToCurvatureFractionDerivative(u: number): number {\r\n const a = Math.PI;\r\n return 0.5 * a * Math.sin(u * a);\r\n }\r\n /**\r\n * Return the integrated area under the curve.\r\n * * This fraction is the angular change fraction.\r\n */\r\n public fractionToArea(u: number): number {\r\n const a = Math.PI;\r\n return 0.5 * u - 0.5 * Math.sin(u * a) / a;\r\n }\r\n}\r\n"]}
@@ -2,7 +2,7 @@ import { CubicEvaluator } from "./CubicEvaluator";
2
2
  /**
3
3
  * Polish Cubic.
4
4
  * * Construction takes nominal length and end radius.
5
- * curve is is y= m*x^3 with
5
+ * curve is y = m*x^3 with
6
6
  * * x any point on the x axis.
7
7
  * * m is (1/6RL).
8
8
  * * Lx = x length is along the axis, determined by inversion of a distance series at nominal length.
@@ -14,7 +14,7 @@ const CubicEvaluator_1 = require("./CubicEvaluator");
14
14
  /**
15
15
  * Polish Cubic.
16
16
  * * Construction takes nominal length and end radius.
17
- * curve is is y= m*x^3 with
17
+ * curve is y = m*x^3 with
18
18
  * * x any point on the x axis.
19
19
  * * m is (1/6RL).
20
20
  * * Lx = x length is along the axis, determined by inversion of a distance series at nominal length.
@@ -1 +1 @@
1
- {"version":3,"file":"PolishCubicSpiralEvaluator.js","sourceRoot":"","sources":["../../../../src/curve/spiral/PolishCubicSpiralEvaluator.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;;;AAE/F;;GAEG;AACH,6CAA0C;AAC1C,kDAAqD;AACrD,qDAAkD;AAElD;;;;;;;;GAQG;AACH,MAAa,oBAAqB,SAAQ,+BAAc;IAC/C,cAAc,CAAS;IACvB,cAAc,CAAS;IAC9B,uEAAuE;IACvE,YAAoB,OAAe,EAAE,OAAe,EAAE,UAAkB,EAAE,MAAc;QACtF,KAAK,CAAC,UAAU,EAAE,MAAM,CAAC,CAAC;QAC1B,IAAI,CAAC,cAAc,GAAG,OAAO,CAAC;QAC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AA0B;QAC1B,6BAA6B;QAC7B,MAAM,EAAE,GAAG,CAAC,GAAG,GAAG,GAAG,GAAG,CAAC,GAAG,GAAG,GAAG,GAAG,CAAC,CAAC,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,CAAC,GAAG,GAAG,IAAI,GAAG,GAAG,GAAG,GAAG,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;QAC7F,OAAO,EAAE,CAAC;IACZ,CAAC;IACD,kDAAkD;IAC3C,MAAM,CAAC,2BAA2B,CAAC,CAAS,EAAE,OAAe,EAAE,OAAe;QACnF,MAAM,IAAI,GAAG,qBAAY,CAAC,WAAW,CAAC,CAAC,EACrC,CAAC,CAAS,EAAE,EAAE,CAAC,CAAC,IAAI,CAAC,sBAAsB,CAAC,CAAC,EAAE,OAAO,EAAE,OAAO,CAAC,GAAG,CAAC,CAAC,EACrE,CAAC,CAAS,EAAE,EAAE,CAAC,IAAI,CAAC,gCAAgC,CAAC,CAAC,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC,CAAC;QAC7E,OAAO,IAAI,CAAC;IACd,CAAC;CACF;AAzFD,oDAyFC","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 Curve\n */\nimport { Geometry } from \"../../Geometry\";\nimport { SimpleNewton } from \"../../numerics/Newton\";\nimport { CubicEvaluator } from \"./CubicEvaluator\";\n\n/**\n * Polish Cubic.\n * * Construction takes nominal length and end radius.\n * curve is is y= m*x^3 with\n * * x any point on the x axis.\n * * m is (1/6RL).\n * * Lx = x length is along the axis, determined by inversion of a distance series at nominal length.\n * @internal\n */\nexport class PolishCubicEvaluator extends CubicEvaluator {\n public nominalLength1: number;\n public nominalRadius1: number;\n /** Constructor is private. Caller responsible for cubicM validity. */\n private constructor(length1: number, radius1: number, axisLength: number, cubicM: number) {\n super(axisLength, cubicM);\n this.nominalLength1 = length1;\n this.nominalRadius1 = radius1;\n }\n /** Compute the czech cubic constant. */\n public static computeCubicM(length1: number, radius1: number): number {\n return 1.0 / (6.0 * length1 * radius1);\n }\n public static create(length1: number, radius1: number): PolishCubicEvaluator | undefined {\n const m = this.computeCubicM(length1, radius1);\n if (m === undefined)\n return undefined;\n const xMax = PolishCubicEvaluator.approximateDistanceAlongToX(length1, radius1, length1);\n if (xMax === undefined)\n return undefined;\n return new PolishCubicEvaluator(length1, radius1, xMax, m);\n }\n public override scaleInPlace(scaleFactor: number) {\n this.nominalLength1 *= scaleFactor;\n this.nominalRadius1 *= scaleFactor;\n super.scaleInPlace(scaleFactor);\n }\n /** Return a deep copy of the evaluator. */\n public clone(): PolishCubicEvaluator {\n return new PolishCubicEvaluator(this.nominalLength1, this.nominalRadius1, this.axisLength, this.cubicM);\n }\n /** Member by member matchup. */\n public isAlmostEqual(other: any): boolean {\n if (other instanceof PolishCubicEvaluator) {\n return Geometry.isSameCoordinate(this.nominalLength1, other.nominalLength1)\n && Geometry.isSameCoordinate(this.nominalRadius1, other.nominalRadius1);\n }\n return false;\n }\n /** Compute the coefficient of x^4 in the x-to-distance series expansion. */\n public static computeX4SeriesCoefficient(length1: number, radius1: number): number {\n return 1.0 / (4.0 * length1 * length1 * radius1 * radius1);\n }\n /**\n * Evaluate a series approximation of distance along the true curve.\n * @param x distance along x axis.\n * @param radius1 nominal end radius.\n * @param length1 nominal length along curve.\n * @returns\n */\n public static xToApproximateDistance(x: number, radius1: number, length1: number): number {\n // C31 * ( 1 + 1 / 10 * E31 - 1 / 72 * E31^2 + 1 / 208 * E31^3 - 5 / 2176 * E31^4 )\n const a4 = this.computeX4SeriesCoefficient(length1, radius1);\n const ax2 = a4 * x * x;\n const ax3 = ax2 * x;\n const ax4 = ax3 * x;\n const s0 = x * (1.0 + ax4 * (0.1 + ax4 * (-1.0 / 72.0 + ax4 * (1.0 / 208.0 - 5.0 * ax4 / 2176.0))));\n return s0;\n }\n /**\n * Evaluate the derivative of the x-to-distance series.\n * @param x distance along x axis.\n * @param radius1 nominal end radius.\n * @param length1 nominal length along curve.\n * @returns\n */\n public static xToApproximateDistanceDerivative(x: number, radius1: number, length1: number): number {\n // C31 * ( 1 + 1 / 10 * E31 - 1 / 72 * E31^2 + 1 / 208 * E31^3 - 5 / 2176 * E31^4 )\n const a4 = this.computeX4SeriesCoefficient(length1, radius1);\n const ax2 = a4 * x * x;\n const ax3 = ax2 * x;\n const ax4 = ax3 * x;\n // derivative notes:\n // take away leading x -- this reduces each power by 1\n // multiply each coefficient by its original power:\n // 0.1 ==> 0.5\n // 1/72 ==> 9/72 = 1/8\n // 1/208 ==> 13/208 = 1/16\n // 1/2176 ==> 17/2176 = 1/128\n const ds = (1.0 + ax4 * (0.5 + ax4 * (-1.0 / 8.0 + ax4 * (1.0 / 16.0 - 5.0 * ax4 / 128.0))));\n return ds;\n }\n /** Invert the xToApproximateDistance function. */\n public static approximateDistanceAlongToX(s: number, radius1: number, length1: number): number | undefined {\n const root = SimpleNewton.runNewton1D(s,\n (x: number) => (this.xToApproximateDistance(x, radius1, length1) - s),\n (x: number) => this.xToApproximateDistanceDerivative(x, radius1, length1));\n return root;\n }\n}\n"]}
1
+ {"version":3,"file":"PolishCubicSpiralEvaluator.js","sourceRoot":"","sources":["../../../../src/curve/spiral/PolishCubicSpiralEvaluator.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;;;AAE/F;;GAEG;AACH,6CAA0C;AAC1C,kDAAqD;AACrD,qDAAkD;AAElD;;;;;;;;GAQG;AACH,MAAa,oBAAqB,SAAQ,+BAAc;IAC/C,cAAc,CAAS;IACvB,cAAc,CAAS;IAC9B,uEAAuE;IACvE,YAAoB,OAAe,EAAE,OAAe,EAAE,UAAkB,EAAE,MAAc;QACtF,KAAK,CAAC,UAAU,EAAE,MAAM,CAAC,CAAC;QAC1B,IAAI,CAAC,cAAc,GAAG,OAAO,CAAC;QAC9B,IAAI,CAAC,cAAc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;QAC7B,MAAM,EAAE,GAAG,CAAC,GAAG,GAAG,GAAG,GAAG,CAAC,GAAG,GAAG,GAAG,GAAG,CAAC,CAAC,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,CAAC,GAAG,GAAG,IAAI,GAAG,GAAG,GAAG,GAAG,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;QAC7F,OAAO,EAAE,CAAC;IACZ,CAAC;IACD,kDAAkD;IAC3C,MAAM,CAAC,2BAA2B,CAAC,CAAS,EAAE,OAAe,EAAE,OAAe;QACnF,MAAM,IAAI,GAAG,qBAAY,CAAC,WAAW,CAAC,CAAC,EACrC,CAAC,CAAS,EAAE,EAAE,CAAC,CAAC,IAAI,CAAC,sBAAsB,CAAC,CAAC,EAAE,OAAO,EAAE,OAAO,CAAC,GAAG,CAAC,CAAC,EACrE,CAAC,CAAS,EAAE,EAAE,CAAC,IAAI,CAAC,gCAAgC,CAAC,CAAC,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC,CAAC;QAC7E,OAAO,IAAI,CAAC;IACd,CAAC;CACF;AAzFD,oDAyFC","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 Curve\r\n */\r\nimport { Geometry } from \"../../Geometry\";\r\nimport { SimpleNewton } from \"../../numerics/Newton\";\r\nimport { CubicEvaluator } from \"./CubicEvaluator\";\r\n\r\n/**\r\n * Polish Cubic.\r\n * * Construction takes nominal length and end radius.\r\n * curve is y = m*x^3 with\r\n * * x any point on the x axis.\r\n * * m is (1/6RL).\r\n * * Lx = x length is along the axis, determined by inversion of a distance series at nominal length.\r\n * @internal\r\n */\r\nexport class PolishCubicEvaluator extends CubicEvaluator {\r\n public nominalLength1: number;\r\n public nominalRadius1: number;\r\n /** Constructor is private. Caller responsible for cubicM validity. */\r\n private constructor(length1: number, radius1: number, axisLength: number, cubicM: number) {\r\n super(axisLength, cubicM);\r\n this.nominalLength1 = length1;\r\n this.nominalRadius1 = radius1;\r\n }\r\n /** Compute the czech cubic constant. */\r\n public static computeCubicM(length1: number, radius1: number): number {\r\n return 1.0 / (6.0 * length1 * radius1);\r\n }\r\n public static create(length1: number, radius1: number): PolishCubicEvaluator | undefined {\r\n const m = this.computeCubicM(length1, radius1);\r\n if (m === undefined)\r\n return undefined;\r\n const xMax = PolishCubicEvaluator.approximateDistanceAlongToX(length1, radius1, length1);\r\n if (xMax === undefined)\r\n return undefined;\r\n return new PolishCubicEvaluator(length1, radius1, xMax, m);\r\n }\r\n public override scaleInPlace(scaleFactor: number) {\r\n this.nominalLength1 *= scaleFactor;\r\n this.nominalRadius1 *= scaleFactor;\r\n super.scaleInPlace(scaleFactor);\r\n }\r\n /** Return a deep copy of the evaluator. */\r\n public clone(): PolishCubicEvaluator {\r\n return new PolishCubicEvaluator(this.nominalLength1, this.nominalRadius1, this.axisLength, this.cubicM);\r\n }\r\n /** Member by member matchup. */\r\n public isAlmostEqual(other: any): boolean {\r\n if (other instanceof PolishCubicEvaluator) {\r\n return Geometry.isSameCoordinate(this.nominalLength1, other.nominalLength1)\r\n && Geometry.isSameCoordinate(this.nominalRadius1, other.nominalRadius1);\r\n }\r\n return false;\r\n }\r\n /** Compute the coefficient of x^4 in the x-to-distance series expansion. */\r\n public static computeX4SeriesCoefficient(length1: number, radius1: number): number {\r\n return 1.0 / (4.0 * length1 * length1 * radius1 * radius1);\r\n }\r\n /**\r\n * Evaluate a series approximation of distance along the true curve.\r\n * @param x distance along x axis.\r\n * @param radius1 nominal end radius.\r\n * @param length1 nominal length along curve.\r\n * @returns\r\n */\r\n public static xToApproximateDistance(x: number, radius1: number, length1: number): number {\r\n // C31 * ( 1 + 1 / 10 * E31 - 1 / 72 * E31^2 + 1 / 208 * E31^3 - 5 / 2176 * E31^4 )\r\n const a4 = this.computeX4SeriesCoefficient(length1, radius1);\r\n const ax2 = a4 * x * x;\r\n const ax3 = ax2 * x;\r\n const ax4 = ax3 * x;\r\n const s0 = x * (1.0 + ax4 * (0.1 + ax4 * (-1.0 / 72.0 + ax4 * (1.0 / 208.0 - 5.0 * ax4 / 2176.0))));\r\n return s0;\r\n }\r\n /**\r\n * Evaluate the derivative of the x-to-distance series.\r\n * @param x distance along x axis.\r\n * @param radius1 nominal end radius.\r\n * @param length1 nominal length along curve.\r\n * @returns\r\n */\r\n public static xToApproximateDistanceDerivative(x: number, radius1: number, length1: number): number {\r\n // C31 * ( 1 + 1 / 10 * E31 - 1 / 72 * E31^2 + 1 / 208 * E31^3 - 5 / 2176 * E31^4 )\r\n const a4 = this.computeX4SeriesCoefficient(length1, radius1);\r\n const ax2 = a4 * x * x;\r\n const ax3 = ax2 * x;\r\n const ax4 = ax3 * x;\r\n // derivative notes:\r\n // take away leading x -- this reduces each power by 1\r\n // multiply each coefficient by its original power:\r\n // 0.1 ==> 0.5\r\n // 1/72 ==> 9/72 = 1/8\r\n // 1/208 ==> 13/208 = 1/16\r\n // 1/2176 ==> 17/2176 = 1/128\r\n const ds = (1.0 + ax4 * (0.5 + ax4 * (-1.0 / 8.0 + ax4 * (1.0 / 16.0 - 5.0 * ax4 / 128.0))));\r\n return ds;\r\n }\r\n /** Invert the xToApproximateDistance function. */\r\n public static approximateDistanceAlongToX(s: number, radius1: number, length1: number): number | undefined {\r\n const root = SimpleNewton.runNewton1D(s,\r\n (x: number) => (this.xToApproximateDistance(x, radius1, length1) - s),\r\n (x: number) => this.xToApproximateDistanceDerivative(x, radius1, length1));\r\n return root;\r\n }\r\n}\r\n"]}
@@ -2,10 +2,10 @@ import { Angle } from "../../geometry3d/Angle";
2
2
  /**
3
3
  * A true transition spiral is a curve defined by its curvature, with the curvature function symmetric about midpoint.
4
4
  * * The symmetry condition creates a relationship among the following 4 quantities:
5
- * ** curvature0 = curvature (i.e. 1/radius) at start
6
- * ** curvature1 = curvature (i.e. 1/radius) at end
7
- * ** sweepRadians = signed turning angle from start to end
8
- * ** arcLength = length of curve
5
+ * ** curvature0 = curvature (i.e. 1/radius) at start.
6
+ * ** curvature1 = curvature (i.e. 1/radius) at end.
7
+ * ** sweepRadians = signed turning angle from start to end.
8
+ * ** arcLength = length of curve.
9
9
  * * The relationship is the equation:
10
10
  * ** `sweepRadians = arcLength * average Curvature = arcLength * 0.5 * (curvature0 + curvature1)`
11
11
  * * That is, regardless of any curvature properties other than symmetry, specifying any 3 of the quantities fully
@@ -13,13 +13,25 @@ import { Angle } from "../../geometry3d/Angle";
13
13
  * @public
14
14
  */
15
15
  export declare class TransitionConditionalProperties {
16
- /** Radius (or 0 at start). */
16
+ /**
17
+ * Radius at start (radius of the osculating circle at the spiral segment's start).
18
+ * radius0 === 0 means straight line at start.
19
+ */
17
20
  radius0: number | undefined;
18
- /** Radius (or 0) at end. */
21
+ /**
22
+ * Radius at end (radius of the osculating circle at the spiral segment's end).
23
+ * radius1 === 0 means straight line at end.
24
+ */
19
25
  radius1: number | undefined;
20
- /** Bearing at start, measured from x towards y. */
26
+ /**
27
+ * Bearing at start (the signed angle from global x-axis to the start tangent of the spiral).
28
+ * * If the direction from x-axis to start tangent is CCW, the start bearing is positive.
29
+ */
21
30
  bearing0: Angle | undefined;
22
- /** Bearing at end, measured from x towards y. */
31
+ /**
32
+ * Bearing at end (the signed angle from global x-axis to the end tangent of the spiral).
33
+ * * If the direction from x-axis to end tangent is CCW, the end bearing is positive.
34
+ */
23
35
  bearing1: Angle | undefined;
24
36
  /** Curve length. */
25
37
  curveLength: number | undefined;
@@ -1 +1 @@
1
- {"version":3,"file":"TransitionConditionalProperties.d.ts","sourceRoot":"","sources":["../../../../src/curve/spiral/TransitionConditionalProperties.ts"],"names":[],"mappings":"AASA,OAAO,EAAE,KAAK,EAAE,MAAM,wBAAwB,CAAC;AAG/C;;;;;;;;;;;;GAYG;AACH,qBAAa,+BAA+B;IAC1C,8BAA8B;IACvB,OAAO,EAAE,MAAM,GAAG,SAAS,CAAC;IACnC,4BAA4B;IACrB,OAAO,EAAE,MAAM,GAAG,SAAS,CAAC;IACnC,mDAAmD;IAC5C,QAAQ,EAAE,KAAK,GAAG,SAAS,CAAC;IACnC,iDAAiD;IAC1C,QAAQ,EAAE,KAAK,GAAG,SAAS,CAAC;IACnC,oBAAoB;IACb,WAAW,EAAE,MAAM,GAAG,SAAS,CAAC;IACvC;;;;;;;OAOG;gBAED,OAAO,EAAE,MAAM,GAAG,SAAS,EAC3B,OAAO,EAAE,MAAM,GAAG,SAAS,EAC3B,QAAQ,EAAE,KAAK,GAAG,SAAS,EAC3B,QAAQ,EAAE,KAAK,GAAG,SAAS,EAC3B,SAAS,EAAE,MAAM,GAAG,SAAS;IAQ/B,kEAAkE;IAC3D,oBAAoB;IAO3B,qEAAqE;IAC9D,KAAK,IAAI,+BAA+B;IAS/C,0EAA0E;IACnE,qBAAqB,IAAI,OAAO;IAUvC;;;OAGG;IACI,0BAA0B,IAAI,OAAO;IAsC5C,OAAO,CAAC,qBAAqB;IAO7B,OAAO,CAAC,kBAAkB;IAO1B,8EAA8E;IACvE,aAAa,CAAC,KAAK,CAAC,EAAE,+BAA+B,GAAG,OAAO;IAetE,iFAAiF;IAC1E,gBAAgB,CAAC,CAAC,EAAE,MAAM,GAAG,IAAI;IAUxC,uEAAuE;WACzD,cAAc,CAC1B,CAAC,EAAE,+BAA+B,GAAG,SAAS,EAAE,CAAC,EAAE,+BAA+B,GAAG,SAAS,GAC7F,OAAO;CAKX"}
1
+ {"version":3,"file":"TransitionConditionalProperties.d.ts","sourceRoot":"","sources":["../../../../src/curve/spiral/TransitionConditionalProperties.ts"],"names":[],"mappings":"AASA,OAAO,EAAE,KAAK,EAAE,MAAM,wBAAwB,CAAC;AAG/C;;;;;;;;;;;;GAYG;AACH,qBAAa,+BAA+B;IAC1C;;;OAGG;IACI,OAAO,EAAE,MAAM,GAAG,SAAS,CAAC;IACnC;;;OAGG;IACI,OAAO,EAAE,MAAM,GAAG,SAAS,CAAC;IACnC;;;OAGG;IACI,QAAQ,EAAE,KAAK,GAAG,SAAS,CAAC;IACnC;;;OAGG;IACI,QAAQ,EAAE,KAAK,GAAG,SAAS,CAAC;IACnC,oBAAoB;IACb,WAAW,EAAE,MAAM,GAAG,SAAS,CAAC;IACvC;;;;;;;OAOG;gBAED,OAAO,EAAE,MAAM,GAAG,SAAS,EAC3B,OAAO,EAAE,MAAM,GAAG,SAAS,EAC3B,QAAQ,EAAE,KAAK,GAAG,SAAS,EAC3B,QAAQ,EAAE,KAAK,GAAG,SAAS,EAC3B,SAAS,EAAE,MAAM,GAAG,SAAS;IAQ/B,kEAAkE;IAC3D,oBAAoB;IAO3B,qEAAqE;IAC9D,KAAK,IAAI,+BAA+B;IAS/C,0EAA0E;IACnE,qBAAqB,IAAI,OAAO;IAUvC;;;OAGG;IACI,0BAA0B,IAAI,OAAO;IAsC5C,OAAO,CAAC,qBAAqB;IAO7B,OAAO,CAAC,kBAAkB;IAO1B,8EAA8E;IACvE,aAAa,CAAC,KAAK,CAAC,EAAE,+BAA+B,GAAG,OAAO;IAetE,iFAAiF;IAC1E,gBAAgB,CAAC,CAAC,EAAE,MAAM,GAAG,IAAI;IAUxC,uEAAuE;WACzD,cAAc,CAC1B,CAAC,EAAE,+BAA+B,GAAG,SAAS,EAAE,CAAC,EAAE,+BAA+B,GAAG,SAAS,GAC7F,OAAO;CAKX"}
@@ -14,10 +14,10 @@ const TransitionSpiral3d_1 = require("./TransitionSpiral3d");
14
14
  /**
15
15
  * A true transition spiral is a curve defined by its curvature, with the curvature function symmetric about midpoint.
16
16
  * * The symmetry condition creates a relationship among the following 4 quantities:
17
- * ** curvature0 = curvature (i.e. 1/radius) at start
18
- * ** curvature1 = curvature (i.e. 1/radius) at end
19
- * ** sweepRadians = signed turning angle from start to end
20
- * ** arcLength = length of curve
17
+ * ** curvature0 = curvature (i.e. 1/radius) at start.
18
+ * ** curvature1 = curvature (i.e. 1/radius) at end.
19
+ * ** sweepRadians = signed turning angle from start to end.
20
+ * ** arcLength = length of curve.
21
21
  * * The relationship is the equation:
22
22
  * ** `sweepRadians = arcLength * average Curvature = arcLength * 0.5 * (curvature0 + curvature1)`
23
23
  * * That is, regardless of any curvature properties other than symmetry, specifying any 3 of the quantities fully
@@ -25,13 +25,25 @@ const TransitionSpiral3d_1 = require("./TransitionSpiral3d");
25
25
  * @public
26
26
  */
27
27
  class TransitionConditionalProperties {
28
- /** Radius (or 0 at start). */
28
+ /**
29
+ * Radius at start (radius of the osculating circle at the spiral segment's start).
30
+ * radius0 === 0 means straight line at start.
31
+ */
29
32
  radius0;
30
- /** Radius (or 0) at end. */
33
+ /**
34
+ * Radius at end (radius of the osculating circle at the spiral segment's end).
35
+ * radius1 === 0 means straight line at end.
36
+ */
31
37
  radius1;
32
- /** Bearing at start, measured from x towards y. */
38
+ /**
39
+ * Bearing at start (the signed angle from global x-axis to the start tangent of the spiral).
40
+ * * If the direction from x-axis to start tangent is CCW, the start bearing is positive.
41
+ */
33
42
  bearing0;
34
- /** Bearing at end, measured from x towards y. */
43
+ /**
44
+ * Bearing at end (the signed angle from global x-axis to the end tangent of the spiral).
45
+ * * If the direction from x-axis to end tangent is CCW, the end bearing is positive.
46
+ */
35
47
  bearing1;
36
48
  /** Curve length. */
37
49
  curveLength;
@@ -1 +1 @@
1
- {"version":3,"file":"TransitionConditionalProperties.js","sourceRoot":"","sources":["../../../../src/curve/spiral/TransitionConditionalProperties.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;;;AAE/F;;GAEG;AACH,6CAA0C;AAC1C,kDAA+C;AAC/C,6DAA0D;AAE1D;;;;;;;;;;;;GAYG;AACH,MAAa,+BAA+B;IAC1C,8BAA8B;IACvB,OAAO,CAAqB;IACnC,4BAA4B;IACrB,OAAO,CAAqB;IACnC,mDAAmD;IAC5C,QAAQ,CAAoB;IACnC,iDAAiD;IAC1C,QAAQ,CAAoB;IACnC,oBAAoB;IACb,WAAW,CAAqB;IACvC;;;;;;;OAOG;IACH,YACE,OAA2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AAC,OAAO,KAAK,SAAS;YAC5B,IAAI,CAAC,OAAO,IAAI,CAAC,CAAC;QACpB,IAAI,IAAI,CAAC,WAAW,KAAK,SAAS;YAChC,IAAI,CAAC,WAAW,IAAI,CAAC,CAAC;IAC1B,CAAC;IACD,uEAAuE;IAChE,MAAM,CAAC,cAAc,CAC1B,CAA8C,EAAE,CAA8C;QAE9F,IAAI,CAAC,KAAK,SAAS;YACjB,OAAO,CAAC,KAAK,SAAS,CAAC;QACzB,OAAO,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC;IAC5B,CAAC;CACF;AAxJD,0EAwJC","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 Curve\n */\nimport { Geometry } from \"../../Geometry\";\nimport { Angle } from \"../../geometry3d/Angle\";\nimport { TransitionSpiral3d } from \"./TransitionSpiral3d\";\n\n/**\n * A true transition spiral is a curve defined by its curvature, with the curvature function symmetric about midpoint.\n * * The symmetry condition creates a relationship among the following 4 quantities:\n * ** curvature0 = curvature (i.e. 1/radius) at start\n * ** curvature1 = curvature (i.e. 1/radius) at end\n * ** sweepRadians = signed turning angle from start to end\n * ** arcLength = length of curve\n * * The relationship is the equation:\n * ** `sweepRadians = arcLength * average Curvature = arcLength * 0.5 * (curvature0 + curvature1)`\n * * That is, regardless of any curvature properties other than symmetry, specifying any 3 of the quantities fully\n * determines the remaining one.\n * @public\n */\nexport class TransitionConditionalProperties {\n /** Radius (or 0 at start). */\n public radius0: number | undefined;\n /** Radius (or 0) at end. */\n public radius1: number | undefined;\n /** Bearing at start, measured from x towards y. */\n public bearing0: Angle | undefined;\n /** Bearing at end, measured from x towards y. */\n public bearing1: Angle | undefined;\n /** Curve length. */\n public curveLength: number | undefined;\n /**\n * Capture numeric or undefined values.\n * @param radius0 start radius or undefined.\n * @param radius1 end radius or undefined.\n * @param bearing0 start bearing or undefined.\n * @param bearing1 end bearing or undefined.\n * @param arcLength arc length or undefined.\n */\n public constructor(\n radius0: number | undefined,\n radius1: number | undefined,\n bearing0: Angle | undefined,\n bearing1: Angle | undefined,\n arcLength: number | undefined,\n ) {\n this.radius0 = radius0;\n this.radius1 = radius1;\n this.bearing0 = bearing0;\n this.bearing1 = bearing1;\n this.curveLength = arcLength;\n }\n /** Return the number of defined values among the 5 properties. */\n public numDefinedProperties() {\n return Geometry.defined01(this.radius0)\n + Geometry.defined01(this.radius1)\n + Geometry.defined01(this.bearing0)\n + Geometry.defined01(this.bearing1)\n + Geometry.defined01(this.curveLength);\n }\n /** Clone with all 5 properties (i.e., preserve undefined states). */\n public clone(): TransitionConditionalProperties {\n return new TransitionConditionalProperties(\n this.radius0,\n this.radius1,\n this.bearing0 === undefined ? undefined : this.bearing0.clone(),\n this.bearing1 === undefined ? undefined : this.bearing1.clone(),\n this.curveLength,\n );\n }\n /** Return true if all 5 properties are defined and agree equationally. */\n public getIsValidCompleteSet(): boolean {\n if (this.curveLength !== undefined && this.bearing0 !== undefined && this.bearing1 !== undefined\n && this.radius0 !== undefined && this.radius1 !== undefined) {\n const arcLength = TransitionSpiral3d.radiusRadiusSweepRadiansToArcLength(\n this.radius0, this.radius1, this.bearing1.radians - this.bearing0.radians,\n );\n return Geometry.isSameCoordinate(this.curveLength, arcLength);\n }\n return false;\n }\n /**\n * Examine which properties are defined and compute the (single) undefined.\n * @returns true if the input state had precisely one undefined member.\n */\n public tryResolveAnySingleUnknown(): boolean {\n if (this.getIsValidCompleteSet())\n return true;\n if (this.bearing0 && this.bearing1) {\n const sweepRadians = this.bearing1.radians - this.bearing0.radians;\n if (this.curveLength === undefined && this.radius0 !== undefined && this.radius1 !== undefined) {\n this.curveLength = TransitionSpiral3d.radiusRadiusSweepRadiansToArcLength(this.radius0, this.radius1, sweepRadians);\n return true;\n }\n if (this.curveLength !== undefined && this.radius0 === undefined && this.radius1 !== undefined) {\n this.radius0 = TransitionSpiral3d.radius1LengthSweepRadiansToRadius0(this.radius1, this.curveLength, sweepRadians);\n return true;\n }\n if (this.curveLength !== undefined && this.radius0 !== undefined && this.radius1 === undefined) {\n this.radius1 = TransitionSpiral3d.radius0LengthSweepRadiansToRadius1(this.radius0, this.curveLength, sweepRadians);\n return true;\n }\n return false;\n }\n // at least one bearing is undefined\n if (this.curveLength === undefined || this.radius0 === undefined || this.radius1 === undefined)\n return false;\n if (this.bearing0) { // bearing 1 is undefined\n this.bearing1 = Angle.createRadians(\n this.bearing0.radians +\n TransitionSpiral3d.radiusRadiusLengthToSweepRadians(this.radius0, this.radius1, this.curveLength),\n );\n return true;\n }\n if (this.bearing1) { // bearing 0 is undefined\n this.bearing0 = Angle.createRadians(\n this.bearing1.radians -\n TransitionSpiral3d.radiusRadiusLengthToSweepRadians(this.radius0, this.radius1, this.curveLength),\n );\n return true;\n }\n return false;\n }\n private almostEqualCoordinate(a: number | undefined, b: number | undefined): boolean {\n if (a === undefined && b === undefined)\n return true;\n if (a !== undefined && b !== undefined)\n return Geometry.isSameCoordinate(a, b);\n return false;\n }\n private almostEqualBearing(a: Angle | undefined, b: Angle | undefined): boolean {\n if (a === undefined && b === undefined)\n return true;\n if (a !== undefined && b !== undefined)\n return a.isAlmostEqualNoPeriodShift(b);\n return false;\n }\n /** Test if `this` and `other` have matching numeric and undefined members. */\n public isAlmostEqual(other?: TransitionConditionalProperties): boolean {\n if (!other)\n return false;\n if (!this.almostEqualCoordinate(this.radius0, other.radius0))\n return false;\n if (!this.almostEqualCoordinate(this.radius1, other.radius1))\n return false;\n if (!this.almostEqualBearing(this.bearing0, other.bearing0))\n return false;\n if (!this.almostEqualBearing(this.bearing1, other.bearing1))\n return false;\n if (!this.almostEqualCoordinate(this.curveLength, other.curveLength))\n return false;\n return true;\n }\n /** Apply a NONZERO scale factor to all distances. If `a` is zero, do nothing. */\n public applyScaleFactor(a: number): void {\n if (a === 0)\n return;\n if (this.radius0 !== undefined)\n this.radius0 *= a;\n if (this.radius1 !== undefined)\n this.radius1 *= a;\n if (this.curveLength !== undefined)\n this.curveLength *= a;\n }\n /** Test if `a` and `b` have matching numeric and undefined members. */\n public static areAlmostEqual(\n a: TransitionConditionalProperties | undefined, b: TransitionConditionalProperties | undefined,\n ): boolean {\n if (a === undefined)\n return b === undefined;\n return a.isAlmostEqual(b);\n }\n}\n"]}
1
+ {"version":3,"file":"TransitionConditionalProperties.js","sourceRoot":"","sources":["../../../../src/curve/spiral/TransitionConditionalProperties.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;;;AAE/F;;GAEG;AACH,6CAA0C;AAC1C,kDAA+C;AAC/C,6DAA0D;AAE1D;;;;;;;;;;;;GAYG;AACH,MAAa,+BAA+B;IAC1C;;;OAGG;IACI,OAAO,CAAqB;IACnC;;;OAGG;IACI,OAAO,CAAqB;IACnC;;;OAGG;IACI,QAAQ,CAAoB;IACnC;;;OAGG;IACI,QAAQ,CAAoB;IACnC,oBAAoB;IACb,WAAW,CAAqB;IACvC;;;;;;;OAOG;IACH,YACE,OAA2B,EAC3B,OAA2B,EAC3B,QAA2B,EAC3B,QAA2B,EAC3B,SAA6B;QAE7B,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;QACvB,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;QACvB,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;QACzB,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;QACzB,IAAI,CAAC,WAAW,GAAG,SAAS,CAAC;IAC/B,CAAC;IACD,kEAAkE;IAC3D,oBAAoB;QACzB,OAAO,mBAAQ,CAAC,SAAS,CAAC,IAAI,CAAC,OAAO,CAAC;cACnC,mBAAQ,CAAC,SAAS,CAAC,IAAI,CAAC,OAAO,CAAC;cAChC,mBAAQ,CAAC,SAAS,CAAC,IAAI,CAAC,QAAQ,CAAC;cACjC,mBAAQ,CAAC,SAAS,CAAC,IAAI,CAAC,QAAQ,CAAC;cACjC,mBAAQ,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AAC,qBAAqB,CAAC,IAAI,CAAC,OAAO,EAAE,KAAK,CAAC,OAAO,CAAC;YAC1D,OAAO,KAAK,CAAC;QACf,IAAI,CAAC,IAAI,CAAC,kBAAkB,CAAC,IAAI,CAAC,QAAQ,EAAE,KAAK,CAAC,QAAQ,CAAC;YACzD,OAAO,KAAK,CAAC;QACf,IAAI,CAAC,IAAI,CAAC,kBAAkB,CAAC,IAAI,CAAC,QAAQ,EAAE,KAAK,CAAC,QAAQ,CAAC;YACzD,OAAO,KAAK,CAAC;QACf,IAAI,CAAC,IAAI,CAAC,qBAAqB,CAAC,IAAI,CAAC,WAAW,EAAE,KAAK,CAAC,WAAW,CAAC;YAClE,OAAO,KAAK,CAAC;QACf,OAAO,IAAI,CAAC;IACd,CAAC;IACD,iFAAiF;IAC1E,gBAAgB,CAAC,CAAS;QAC/B,IAAI,CAAC,KAAK,CAAC;YACT,OAAO;QACT,IAAI,IAAI,CAAC,OAAO,KAAK,SAAS;YAC5B,IAAI,CAAC,OAAO,IAAI,CAAC,CAAC;QACpB,IAAI,IAAI,CAAC,OAAO,KAAK,SAAS;YAC5B,IAAI,CAAC,OAAO,IAAI,CAAC,CAAC;QACpB,IAAI,IAAI,CAAC,WAAW,KAAK,SAAS;YAChC,IAAI,CAAC,WAAW,IAAI,CAAC,CAAC;IAC1B,CAAC;IACD,uEAAuE;IAChE,MAAM,CAAC,cAAc,CAC1B,CAA8C,EAAE,CAA8C;QAE9F,IAAI,CAAC,KAAK,SAAS;YACjB,OAAO,CAAC,KAAK,SAAS,CAAC;QACzB,OAAO,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC;IAC5B,CAAC;CACF;AApKD,0EAoKC","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 Curve\r\n */\r\nimport { Geometry } from \"../../Geometry\";\r\nimport { Angle } from \"../../geometry3d/Angle\";\r\nimport { TransitionSpiral3d } from \"./TransitionSpiral3d\";\r\n\r\n/**\r\n * A true transition spiral is a curve defined by its curvature, with the curvature function symmetric about midpoint.\r\n * * The symmetry condition creates a relationship among the following 4 quantities:\r\n * ** curvature0 = curvature (i.e. 1/radius) at start.\r\n * ** curvature1 = curvature (i.e. 1/radius) at end.\r\n * ** sweepRadians = signed turning angle from start to end.\r\n * ** arcLength = length of curve.\r\n * * The relationship is the equation:\r\n * ** `sweepRadians = arcLength * average Curvature = arcLength * 0.5 * (curvature0 + curvature1)`\r\n * * That is, regardless of any curvature properties other than symmetry, specifying any 3 of the quantities fully\r\n * determines the remaining one.\r\n * @public\r\n */\r\nexport class TransitionConditionalProperties {\r\n /**\r\n * Radius at start (radius of the osculating circle at the spiral segment's start).\r\n * radius0 === 0 means straight line at start.\r\n */\r\n public radius0: number | undefined;\r\n /**\r\n * Radius at end (radius of the osculating circle at the spiral segment's end).\r\n * radius1 === 0 means straight line at end.\r\n */\r\n public radius1: number | undefined;\r\n /**\r\n * Bearing at start (the signed angle from global x-axis to the start tangent of the spiral).\r\n * * If the direction from x-axis to start tangent is CCW, the start bearing is positive.\r\n */\r\n public bearing0: Angle | undefined;\r\n /**\r\n * Bearing at end (the signed angle from global x-axis to the end tangent of the spiral).\r\n * * If the direction from x-axis to end tangent is CCW, the end bearing is positive.\r\n */\r\n public bearing1: Angle | undefined;\r\n /** Curve length. */\r\n public curveLength: number | undefined;\r\n /**\r\n * Capture numeric or undefined values.\r\n * @param radius0 start radius or undefined.\r\n * @param radius1 end radius or undefined.\r\n * @param bearing0 start bearing or undefined.\r\n * @param bearing1 end bearing or undefined.\r\n * @param arcLength arc length or undefined.\r\n */\r\n public constructor(\r\n radius0: number | undefined,\r\n radius1: number | undefined,\r\n bearing0: Angle | undefined,\r\n bearing1: Angle | undefined,\r\n arcLength: number | undefined,\r\n ) {\r\n this.radius0 = radius0;\r\n this.radius1 = radius1;\r\n this.bearing0 = bearing0;\r\n this.bearing1 = bearing1;\r\n this.curveLength = arcLength;\r\n }\r\n /** Return the number of defined values among the 5 properties. */\r\n public numDefinedProperties() {\r\n return Geometry.defined01(this.radius0)\r\n + Geometry.defined01(this.radius1)\r\n + Geometry.defined01(this.bearing0)\r\n + Geometry.defined01(this.bearing1)\r\n + Geometry.defined01(this.curveLength);\r\n }\r\n /** Clone with all 5 properties (i.e., preserve undefined states). */\r\n public clone(): TransitionConditionalProperties {\r\n return new TransitionConditionalProperties(\r\n this.radius0,\r\n this.radius1,\r\n this.bearing0 === undefined ? undefined : this.bearing0.clone(),\r\n this.bearing1 === undefined ? undefined : this.bearing1.clone(),\r\n this.curveLength,\r\n );\r\n }\r\n /** Return true if all 5 properties are defined and agree equationally. */\r\n public getIsValidCompleteSet(): boolean {\r\n if (this.curveLength !== undefined && this.bearing0 !== undefined && this.bearing1 !== undefined\r\n && this.radius0 !== undefined && this.radius1 !== undefined) {\r\n const arcLength = TransitionSpiral3d.radiusRadiusSweepRadiansToArcLength(\r\n this.radius0, this.radius1, this.bearing1.radians - this.bearing0.radians,\r\n );\r\n return Geometry.isSameCoordinate(this.curveLength, arcLength);\r\n }\r\n return false;\r\n }\r\n /**\r\n * Examine which properties are defined and compute the (single) undefined.\r\n * @returns true if the input state had precisely one undefined member.\r\n */\r\n public tryResolveAnySingleUnknown(): boolean {\r\n if (this.getIsValidCompleteSet())\r\n return true;\r\n if (this.bearing0 && this.bearing1) {\r\n const sweepRadians = this.bearing1.radians - this.bearing0.radians;\r\n if (this.curveLength === undefined && this.radius0 !== undefined && this.radius1 !== undefined) {\r\n this.curveLength = TransitionSpiral3d.radiusRadiusSweepRadiansToArcLength(this.radius0, this.radius1, sweepRadians);\r\n return true;\r\n }\r\n if (this.curveLength !== undefined && this.radius0 === undefined && this.radius1 !== undefined) {\r\n this.radius0 = TransitionSpiral3d.radius1LengthSweepRadiansToRadius0(this.radius1, this.curveLength, sweepRadians);\r\n return true;\r\n }\r\n if (this.curveLength !== undefined && this.radius0 !== undefined && this.radius1 === undefined) {\r\n this.radius1 = TransitionSpiral3d.radius0LengthSweepRadiansToRadius1(this.radius0, this.curveLength, sweepRadians);\r\n return true;\r\n }\r\n return false;\r\n }\r\n // at least one bearing is undefined\r\n if (this.curveLength === undefined || this.radius0 === undefined || this.radius1 === undefined)\r\n return false;\r\n if (this.bearing0) { // bearing 1 is undefined\r\n this.bearing1 = Angle.createRadians(\r\n this.bearing0.radians +\r\n TransitionSpiral3d.radiusRadiusLengthToSweepRadians(this.radius0, this.radius1, this.curveLength),\r\n );\r\n return true;\r\n }\r\n if (this.bearing1) { // bearing 0 is undefined\r\n this.bearing0 = Angle.createRadians(\r\n this.bearing1.radians -\r\n TransitionSpiral3d.radiusRadiusLengthToSweepRadians(this.radius0, this.radius1, this.curveLength),\r\n );\r\n return true;\r\n }\r\n return false;\r\n }\r\n private almostEqualCoordinate(a: number | undefined, b: number | undefined): boolean {\r\n if (a === undefined && b === undefined)\r\n return true;\r\n if (a !== undefined && b !== undefined)\r\n return Geometry.isSameCoordinate(a, b);\r\n return false;\r\n }\r\n private almostEqualBearing(a: Angle | undefined, b: Angle | undefined): boolean {\r\n if (a === undefined && b === undefined)\r\n return true;\r\n if (a !== undefined && b !== undefined)\r\n return a.isAlmostEqualNoPeriodShift(b);\r\n return false;\r\n }\r\n /** Test if `this` and `other` have matching numeric and undefined members. */\r\n public isAlmostEqual(other?: TransitionConditionalProperties): boolean {\r\n if (!other)\r\n return false;\r\n if (!this.almostEqualCoordinate(this.radius0, other.radius0))\r\n return false;\r\n if (!this.almostEqualCoordinate(this.radius1, other.radius1))\r\n return false;\r\n if (!this.almostEqualBearing(this.bearing0, other.bearing0))\r\n return false;\r\n if (!this.almostEqualBearing(this.bearing1, other.bearing1))\r\n return false;\r\n if (!this.almostEqualCoordinate(this.curveLength, other.curveLength))\r\n return false;\r\n return true;\r\n }\r\n /** Apply a NONZERO scale factor to all distances. If `a` is zero, do nothing. */\r\n public applyScaleFactor(a: number): void {\r\n if (a === 0)\r\n return;\r\n if (this.radius0 !== undefined)\r\n this.radius0 *= a;\r\n if (this.radius1 !== undefined)\r\n this.radius1 *= a;\r\n if (this.curveLength !== undefined)\r\n this.curveLength *= a;\r\n }\r\n /** Test if `a` and `b` have matching numeric and undefined members. */\r\n public static areAlmostEqual(\r\n a: TransitionConditionalProperties | undefined, b: TransitionConditionalProperties | undefined,\r\n ): boolean {\r\n if (a === undefined)\r\n return b === undefined;\r\n return a.isAlmostEqual(b);\r\n }\r\n}\r\n"]}
@@ -15,11 +15,11 @@ import type { Ray3d } from "../../geometry3d/Ray3d";
15
15
  /**
16
16
  * This is the set of valid type names for "integrated" spirals.
17
17
  * * Behavior is expressed by a `NormalizedTransition` snap function.
18
- * * The snap function varies smoothly from f(0)=0 to f(1)=1.
18
+ * * The snap function varies smoothly from f(0) = 0 to f(1) = 1.
19
19
  * * The various snap functions are:
20
20
  * * clothoid: linear
21
- * * biquadratic: 2 quadratics pieced together, joining with 1st derivative continuity at f(0.) = 0.5, with zero
22
- * slope f'(0)=0 and f'(1)= 0
21
+ * * biquadratic: 2 quadratics pieced together, joining with 1st derivative continuity at f(0.5) = 0.5, with zero
22
+ * slope f'(0) = 0 and f'(1) = 0
23
23
  * * bloss: A single cubic with zero slope at 0 and 1
24
24
  * * cosine: half of a cosine wave, centered around 0.5
25
25
  * * sine: full period of a sine wave added to the line f(u)=u
@@ -29,7 +29,8 @@ import type { Ray3d } from "../../geometry3d/Ray3d";
29
29
  export type IntegratedSpiralTypeName = "clothoid" | "bloss" | "biquadratic" | "cosine" | "sine";
30
30
  /**
31
31
  * This is the set of valid type names for "direct" spirals.
32
- * "Direct" spirals can evaluate fractionToPoint by direct equations, i.e. not requiring the numeric integrations in "Integrated" spiral types.
32
+ * "Direct" spirals can evaluate fractionToPoint by direct equations, i.e. not requiring the numeric integrations in
33
+ * "Integrated" spiral types.
33
34
  * @public
34
35
  */
35
36
  export type DirectSpiralTypeName = "JapaneseCubic" | "Arema" | "ChineseCubic" | "HalfCosine" | "AustralianRailCorp" | "WesternAustralian" | "Czech" | "MXCubicAlongArc" | "Polish" | "Italian";
@@ -1 +1 @@
1
- {"version":3,"file":"TransitionSpiral3d.d.ts","sourceRoot":"","sources":["../../../../src/curve/spiral/TransitionSpiral3d.ts"],"names":[],"mappings":"AAKA;;GAEG;AAEH,OAAO,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AAE5D,OAAO,EAAE,QAAQ,EAAE,MAAM,2BAA2B,CAAC;AACrD,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAC;AAC1D,OAAO,EAAE,SAAS,EAAE,MAAM,4BAA4B,CAAC;AACvD,OAAO,EAAE,SAAS,EAAE,MAAM,4BAA4B,CAAC;AACvD,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAGnD,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC/C,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AACjD,OAAO,EAAE,+BAA+B,EAAE,MAAM,mCAAmC,CAAC;AAEpF,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,kCAAkC,CAAC;AACjE,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,wBAAwB,CAAC;AACpD;;;;;;;;;;;;;GAaG;AACH,MAAM,MAAM,wBAAwB,GAAG,UAAU,GAAG,OAAO,GAAG,aAAa,GAAG,QAAQ,GAAG,MAAM,CAAC;AAEhG;;;;GAIG;AACH,MAAM,MAAM,oBAAoB,GAC9B,eAAe,GACb,OAAO,GACP,cAAc,GACd,YAAY,GACZ,oBAAoB,GACpB,mBAAmB,GACnB,OAAO,GACP,iBAAiB,GACjB,QAAQ,GACR,SAAS,CACV;AAEH;;;;;;;;;;;;;;GAcG;AACH,8BAAsB,kBAAmB,SAAQ,cAAc;IAC7D,kCAAkC;IAClC,SAAS,CAAC,WAAW,EAAE,MAAM,CAAC;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;IACxF,CAAC;IACD;;;;;;;OAOG;IACa,uBAAuB,CAAC,GAAqB,EAAE,OAAiB;QAC9E,OAAO,qDAAyB,CAAC,kCAAkC,CAAC,IAAI,EAAE,GAAG,EAAE,OAAO,CAAC,CAAC;IAC1F,CAAC;CACF;AA5KD,gDA4KC","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 Curve\n */\n\nimport { BSplineCurve3d } from \"../../bspline/BSplineCurve\";\nimport { Geometry } from \"../../Geometry\";\nimport { Matrix3d } from \"../../geometry3d/Matrix3d\";\nimport { Range1d, Range3d } from \"../../geometry3d/Range\";\nimport { Segment1d } from \"../../geometry3d/Segment1d\";\nimport { Transform } from \"../../geometry3d/Transform\";\nimport { CurvePrimitive } from \"../CurvePrimitive\";\nimport { CurveOffsetXYHandler } from \"../internalContexts/CurveOffsetXYHandler\";\nimport { PlaneAltitudeRangeContext } from \"../internalContexts/PlaneAltitudeRangeContext\";\nimport { LineString3d } from \"../LineString3d\";\nimport { OffsetOptions } from \"../OffsetOptions\";\nimport { TransitionConditionalProperties } from \"./TransitionConditionalProperties\";\n\nimport type { Vector3d } from \"../../geometry3d/Point3dVector3d\";\nimport type { Ray3d } from \"../../geometry3d/Ray3d\";\n/**\n * This is the set of valid type names for \"integrated\" spirals.\n * * Behavior is expressed by a `NormalizedTransition` snap function.\n * * The snap function varies smoothly from f(0)=0 to f(1)=1.\n * * The various snap functions are:\n * * clothoid: linear\n * * biquadratic: 2 quadratics pieced together, joining with 1st derivative continuity at f(0.) = 0.5, with zero\n * slope f'(0)=0 and f'(1)= 0\n * * bloss: A single cubic with zero slope at 0 and 1\n * * cosine: half of a cosine wave, centered around 0.5\n * * sine: full period of a sine wave added to the line f(u)=u\n * *\n * @public\n */\nexport type IntegratedSpiralTypeName = \"clothoid\" | \"bloss\" | \"biquadratic\" | \"cosine\" | \"sine\";\n\n/**\n * This is the set of valid type names for \"direct\" spirals.\n * \"Direct\" spirals can evaluate fractionToPoint by direct equations, i.e. not requiring the numeric integrations in \"Integrated\" spiral types.\n * @public\n */\nexport type DirectSpiralTypeName =\n \"JapaneseCubic\" // 1 term from each of the X,Y clothoid series expansions: y = x^3 / (6RL)\n | \"Arema\" // 2 terms from each of the X,Y clothoid series expansions; identical to ChineseCubic\n | \"ChineseCubic\" // Identical to Arema\n | \"HalfCosine\" // high continuity cosine variation from quadratic\n | \"AustralianRailCorp\" // cubic with high accuracy distance series\n | \"WesternAustralian\" // simple cubic -- 2 terms of x series, 1 term of y series\n | \"Czech\" // simple cubic with two term distance approximation\n | \"MXCubicAlongArc\" // x obtained from fractional distance via 2-terms from series, y = x^3 / (6RL)\n | \"Polish\"\n | \"Italian\"\n ;\n\n/**\n * TransitionSpiral3d is a base class for multiple variants of spirals.\n * * The menagerie of spiral types have 2 broad categories:\n * * IntegratedSpiral3d -- a spiral whose direct function for curvature versus distance must be integrated to\n * determine x,y.\n * * The IntegratedSpiral3d types are enumerated in `IntegratedSpiralTypes`.\n * * DirectSpiral3d -- a spiral implemented with direct calculation of x,y from fractional position along the spiral.\n * * The direct spiral types are enumerated in the `DirectSpiralType`.\n * * The method set for CurvePrimitive support includes a `handleTransitionSpiral(g: TransitionSpiral3d)` which receives\n * all the spiral types.\n * * The spiral class may impose expectations that its inflection is at the origin, with tangent along the x axis.\n * * This is generally necessary for direct spirals.\n * * This is not necessary for integrated spirals.\n * @public\n */\nexport abstract class TransitionSpiral3d extends CurvePrimitive {\n /** String name of spiral type. */\n protected _spiralType: string;\n /** Original defining properties. */\n protected _designProperties: TransitionConditionalProperties | undefined;\n /** Placement transform. */\n protected _localToWorld: Transform;\n /**\n * Fractional interval for the \"active\" part of a containing spiral.\n * (the radius, angle, and length conditions define a complete spiral, and some portion of it is \"active\")\n */\n protected _activeFractionInterval: Segment1d;\n /** Return (reference to) the active portion of the reference spiral. */\n public get activeFractionInterval(): Segment1d {\n return this._activeFractionInterval;\n }\n /** Strokes in the active portion. */\n public abstract get activeStrokes(): LineString3d;\n /** (Reference to) placement transform. */\n public get localToWorld(): Transform {\n return this._localToWorld;\n }\n protected constructor(\n spiralType: string | undefined,\n localToWorld: Transform,\n activeFractionInterval: Segment1d | undefined,\n designProperties: TransitionConditionalProperties | undefined,\n ) {\n super();\n this._spiralType = spiralType ? spiralType : \"unknownSpiralType\";\n this._designProperties = designProperties;\n this._localToWorld = localToWorld;\n this._activeFractionInterval = activeFractionInterval ? activeFractionInterval : Segment1d.create(0, 1);\n }\n public get spiralType(): string {\n return this._spiralType;\n }\n /** Return 1/r with convention that exact zero input returns 0 (straight line, zero curvature, infinite radius). */\n public static radiusToCurvature(radius: number): number {\n return (radius === 0.0) ? 0.0 : 1.0 / radius;\n }\n /** Return 1/k with convention that near-zero input returns 0 (straight line, zero curvature, infinite radius). */\n public static curvatureToRadius(curvature: number): number {\n if (Math.abs(curvature) < Geometry.smallAngleRadians)\n return 0.0;\n return 1.0 / curvature;\n }\n /** Return a deep clone. */\n public abstract override clone(): TransitionSpiral3d;\n /** Recompute strokes. */\n public abstract refreshComputedProperties(): void;\n /** Return (if possible) a spiral which is a portion of this curve. */\n public override clonePartialCurve(fractionA: number, fractionB: number): TransitionSpiral3d {\n const spiralB = this.clone();\n const globalFractionA = this._activeFractionInterval.fractionToPoint(fractionA);\n const globalFractionB = this._activeFractionInterval.fractionToPoint(fractionB);\n spiralB._activeFractionInterval.set(globalFractionA, globalFractionB);\n spiralB.refreshComputedProperties();\n return spiralB;\n }\n /** Clone with a transform applied. */\n public override cloneTransformed(transform: Transform): TransitionSpiral3d {\n const result = this.clone();\n result.tryTransformInPlace(transform); // we're confident it will always work\n return result;\n }\n /** Return the average of the start and end curvatures. */\n public static averageCurvature(radiusLimits: Segment1d): number {\n return 0.5 * (TransitionSpiral3d.radiusToCurvature(radiusLimits.x0) + TransitionSpiral3d.radiusToCurvature(radiusLimits.x1));\n }\n /**\n * Given two radii (or zeros for 0 curvature) return the average curvature.\n * @param r0 start radius, or 0 for line.\n * @param r1 end radius, or 0 for line.\n */\n public static averageCurvatureR0R1(r0: number, r1: number): number {\n return 0.5 * (TransitionSpiral3d.radiusToCurvature(r0) + TransitionSpiral3d.radiusToCurvature(r1));\n }\n /**\n * Given two radii (or zeros for 0 curvature) return the curvature at the given fraction.\n * @param r0 start radius, or 0 for line.\n * @param fraction fractional position between the curvatures defined by r0 and r1.\n * @param r1 end radius, or 0 for line.\n */\n public static interpolateCurvatureR0R1(r0: number, fraction: number, r1: number): number {\n return Geometry.interpolate(TransitionSpiral3d.radiusToCurvature(r0), fraction, TransitionSpiral3d.radiusToCurvature(r1));\n }\n /** Return the arc length of a transition spiral with given sweep and radius pair. */\n public static radiusRadiusSweepRadiansToArcLength(radius0: number, radius1: number, sweepRadians: number): number {\n return Math.abs(sweepRadians / TransitionSpiral3d.averageCurvatureR0R1(radius0, radius1));\n }\n /** Return the turn angle for spiral of given length between two radii */\n public static radiusRadiusLengthToSweepRadians(radius0: number, radius1: number, arcLength: number): number {\n return TransitionSpiral3d.averageCurvatureR0R1(radius0, radius1) * arcLength;\n }\n /** Return the end radius for spiral of given start radius, length, and turn angle. */\n public static radius0LengthSweepRadiansToRadius1(radius0: number, arcLength: number, sweepRadians: number) {\n return TransitionSpiral3d.curvatureToRadius(\n (2.0 * sweepRadians / arcLength) - TransitionSpiral3d.radiusToCurvature(radius0),\n );\n }\n /** Return the start radius for spiral of given end radius, length, and turn angle. */\n public static radius1LengthSweepRadiansToRadius0(radius1: number, arcLength: number, sweepRadians: number) {\n return TransitionSpiral3d.curvatureToRadius(\n (2.0 * sweepRadians / arcLength) - TransitionSpiral3d.radiusToCurvature(radius1),\n );\n }\n /** Return the original defining properties (if any) saved by the constructor. */\n public get designProperties(): TransitionConditionalProperties | undefined {\n return this._designProperties;\n }\n /**\n * * If transformA is rigid with uniform scale, apply the rigid part of transformA to the localToWorld transform and\n * return the scale and rigid separation.\n * * If not rigid, do nothing and return undefined.\n * * Also apply the scale factor to the designProperties.\n * @param transformA\n */\n protected applyRigidPartOfTransform(transformA: Transform): { rigidAxes: Matrix3d, scale: number } | undefined {\n const rigidData = transformA.matrix.factorRigidWithSignedScale();\n if (rigidData !== undefined) {\n // [sQ a][R b] = [sQ*R sQb+a]\n // but we save it as [Q*R sQb+a] with spiral data scaled by s\n const transformC0 = transformA.multiplyTransformTransform(this.localToWorld);\n // but pull the scale part out of the matrix\n const matrixC = rigidData.rigidAxes.multiplyMatrixMatrix(this.localToWorld.matrix);\n this._localToWorld = Transform.createOriginAndMatrix(transformC0.origin, matrixC);\n if (this.designProperties)\n this.designProperties.applyScaleFactor(rigidData.scale);\n return rigidData;\n }\n return undefined;\n }\n /**\n * Construct an offset of the instance curve as viewed in the xy-plane (ignoring z).\n * * No attempt is made to join the offsets of smaller constituent primitives. To construct a fully joined offset for an\n * aggregate instance (e.g., LineString3d, CurveChainWithDistanceIndex), use RegionOps.constructCurveXYOffset() instead.\n * @param offsetDistanceOrOptions offset distance (positive to left of the instance curve), or options object.\n */\n public override constructOffsetXY(offsetDistanceOrOptions: number | OffsetOptions): BSplineCurve3d | undefined {\n const options = OffsetOptions.create(offsetDistanceOrOptions);\n const handler = new CurveOffsetXYHandler(this, options.leftOffsetDistance);\n this.emitStrokableParts(handler, options.strokeOptions);\n return handler.claimResult();\n }\n /** Extend the range by the strokes of the spiral. */\n public override extendRange(rangeToExtend: Range3d, transform?: Transform): void {\n rangeToExtend.extendRange(this.rangeBetweenFractions(0.0, 1.0, transform));\n }\n /**\n * Return the range of spiral between fractions of the activeStrokes.\n * * Use activeStrokes point count times interval factor for initial evaluation count, but do at least 5.\n */\n public override rangeBetweenFractions(fractionA: number, fractionB: number, transform?: Transform): Range3d {\n const strokes = this.activeStrokes;\n if (undefined === strokes)\n return Range3d.createNull();\n let count = Math.ceil(strokes.numPoints() * Math.abs(fractionB - fractionA));\n count = Geometry.clamp(5, count, 30);\n return this.rangeBetweenFractionsByCount(fractionA, fractionB, count, transform, 0.5);\n }\n /**\n * Project instance geometry (via dispatch) onto the given ray, and return the extreme fractional parameters of\n * projection.\n * @param ray ray onto which the instance is projected. A `Vector3d` is treated as a `Ray3d` with zero origin.\n * @param lowHigh optional receiver for output\n * @returns range of fractional projection parameters onto the ray, where 0.0 is start of the ray and 1.0 is the\n * end of the ray.\n */\n public override projectedParameterRange(ray: Vector3d | Ray3d, lowHigh?: Range1d): Range1d | undefined {\n return PlaneAltitudeRangeContext.findExtremeFractionsAlongDirection(this, ray, lowHigh);\n }\n}\n"]}
1
+ {"version":3,"file":"TransitionSpiral3d.js","sourceRoot":"","sources":["../../../../src/curve/spiral/TransitionSpiral3d.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;;;AAO/F,6CAA0C;AAE1C,kDAA0D;AAC1D,0DAAuD;AACvD,0DAAuD;AACvD,sDAAmD;AACnD,mFAAgF;AAChF,6FAA0F;AAE1F,oDAAiD;AAyCjD;;;;;;;;;;;;;;GAcG;AACH,MAAsB,kBAAmB,SAAQ,+BAAc;IAC7D,kCAAkC;IACxB,WAAW,CAAS;IAC9B,oCAAoC;IAC1B,iBAAiB,CAA8C;IACzE,2BAA2B;IACjB,aAAa,CAAY;IACnC;;;OAGG;IACO,uBAAuB,CAAY;IAC7C,wEAAwE;IACxE,IAAW,sBAAsB;QAC/B,OAAO,IAAI,CAAC,uBAAuB,CAAC;IACtC,CAAC;IAGD,0CAA0C;IAC1C,IAAW,YAAY;QACrB,OAAO,IAAI,CAAC,aAAa,CAAC;IAC5B,CAAC;IACD,YACE,UAA8B,EAC9B,YAAuB,EACvB,sBAA6C,EAC7C,gBAA6D;QAE7D,KAAK,EAAE,CAAC;QACR,IAAI,CAAC,WAAW,GAAG,UAAU,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,mBAAmB,CAAC;QACjE,IAAI,CAAC,iBAAiB,GAAG,gBAAgB,CAAC;QAC1C,IAAI,CAAC,aAAa,G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B,CAAC,CAAC;QAC3E,IAAI,CAAC,kBAAkB,CAAC,OAAO,EAAE,OAAO,CAAC,aAAa,CAAC,CAAC;QACxD,OAAO,OAAO,CAAC,WAAW,EAAE,CAAC;IAC/B,CAAC;IACD,qDAAqD;IACrC,WAAW,CAAC,aAAsB,EAAE,SAAqB;QACvE,aAAa,CAAC,WAAW,CAAC,IAAI,CAAC,qBAAqB,CAAC,GAAG,EAAE,GAAG,EAAE,SAAS,CAAC,CAAC,CAAC;IAC7E,CAAC;IACD;;;OAGG;IACa,qBAAqB,CAAC,SAAiB,EAAE,SAAiB,EAAE,SAAqB;QAC/F,MAAM,OAAO,GAAG,IAAI,CAAC,aAAa,CAAC;QACnC,IAAI,SAAS,KAAK,OAAO;YACvB,OAAO,eAAO,CAAC,UAAU,EAAE,CAAC;QAC9B,IAAI,KAAK,GAAG,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,SAAS,EAAE,GAAG,IAAI,CAAC,GAAG,CAAC,SAAS,GAAG,SAAS,CAAC,CAAC,CAAC;QAC7E,KAAK,GAAG,mBAAQ,CAAC,KAAK,CAAC,CAAC,EAAE,KAAK,EAAE,EAAE,CAAC,CAAC;QACrC,OAAO,IAAI,CAAC,4BAA4B,CAAC,SAAS,EAAE,SAAS,EAAE,KAAK,EAAE,SAAS,EAAE,GAAG,CAAC,CAAC;IACxF,CAAC;IACD;;;;;;;OAOG;IACa,uBAAuB,CAAC,GAAqB,EAAE,OAAiB;QAC9E,OAAO,qDAAyB,CAAC,kCAAkC,CAAC,IAAI,EAAE,GAAG,EAAE,OAAO,CAAC,CAAC;IAC1F,CAAC;CACF;AA5KD,gDA4KC","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 Curve\r\n */\r\n\r\nimport { BSplineCurve3d } from \"../../bspline/BSplineCurve\";\r\nimport { Geometry } from \"../../Geometry\";\r\nimport { Matrix3d } from \"../../geometry3d/Matrix3d\";\r\nimport { Range1d, Range3d } from \"../../geometry3d/Range\";\r\nimport { Segment1d } from \"../../geometry3d/Segment1d\";\r\nimport { Transform } from \"../../geometry3d/Transform\";\r\nimport { CurvePrimitive } from \"../CurvePrimitive\";\r\nimport { CurveOffsetXYHandler } from \"../internalContexts/CurveOffsetXYHandler\";\r\nimport { PlaneAltitudeRangeContext } from \"../internalContexts/PlaneAltitudeRangeContext\";\r\nimport { LineString3d } from \"../LineString3d\";\r\nimport { OffsetOptions } from \"../OffsetOptions\";\r\nimport { TransitionConditionalProperties } from \"./TransitionConditionalProperties\";\r\n\r\nimport type { Vector3d } from \"../../geometry3d/Point3dVector3d\";\r\nimport type { Ray3d } from \"../../geometry3d/Ray3d\";\r\n\r\n/**\r\n * This is the set of valid type names for \"integrated\" spirals.\r\n * * Behavior is expressed by a `NormalizedTransition` snap function.\r\n * * The snap function varies smoothly from f(0) = 0 to f(1) = 1.\r\n * * The various snap functions are:\r\n * * clothoid: linear\r\n * * biquadratic: 2 quadratics pieced together, joining with 1st derivative continuity at f(0.5) = 0.5, with zero\r\n * slope f'(0) = 0 and f'(1) = 0\r\n * * bloss: A single cubic with zero slope at 0 and 1\r\n * * cosine: half of a cosine wave, centered around 0.5\r\n * * sine: full period of a sine wave added to the line f(u)=u\r\n * *\r\n * @public\r\n */\r\nexport type IntegratedSpiralTypeName = \"clothoid\" | \"bloss\" | \"biquadratic\" | \"cosine\" | \"sine\";\r\n\r\n/**\r\n * This is the set of valid type names for \"direct\" spirals.\r\n * \"Direct\" spirals can evaluate fractionToPoint by direct equations, i.e. not requiring the numeric integrations in\r\n * \"Integrated\" spiral types.\r\n * @public\r\n */\r\nexport type DirectSpiralTypeName =\r\n \"JapaneseCubic\" // 1 term from each of the X,Y clothoid series expansions: y = x^3 / (6RL)\r\n | \"Arema\" // 2 terms from each of the X,Y clothoid series expansions; identical to ChineseCubic\r\n | \"ChineseCubic\" // Identical to Arema\r\n | \"HalfCosine\" // high continuity cosine variation from quadratic\r\n | \"AustralianRailCorp\" // cubic with high accuracy distance series\r\n | \"WesternAustralian\" // simple cubic -- 2 terms of x series, 1 term of y series\r\n | \"Czech\" // simple cubic with two term distance approximation\r\n | \"MXCubicAlongArc\" // x obtained from fractional distance via 2-terms from series, y = x^3 / (6RL)\r\n | \"Polish\"\r\n | \"Italian\"\r\n ;\r\n\r\n/**\r\n * TransitionSpiral3d is a base class for multiple variants of spirals.\r\n * * The menagerie of spiral types have 2 broad categories:\r\n * * IntegratedSpiral3d -- a spiral whose direct function for curvature versus distance must be integrated to\r\n * determine x,y.\r\n * * The IntegratedSpiral3d types are enumerated in `IntegratedSpiralTypes`.\r\n * * DirectSpiral3d -- a spiral implemented with direct calculation of x,y from fractional position along the spiral.\r\n * * The direct spiral types are enumerated in the `DirectSpiralType`.\r\n * * The method set for CurvePrimitive support includes a `handleTransitionSpiral(g: TransitionSpiral3d)` which receives\r\n * all the spiral types.\r\n * * The spiral class may impose expectations that its inflection is at the origin, with tangent along the x axis.\r\n * * This is generally necessary for direct spirals.\r\n * * This is not necessary for integrated spirals.\r\n * @public\r\n */\r\nexport abstract class TransitionSpiral3d extends CurvePrimitive {\r\n /** String name of spiral type. */\r\n protected _spiralType: string;\r\n /** Original defining properties. */\r\n protected _designProperties: TransitionConditionalProperties | undefined;\r\n /** Placement transform. */\r\n protected _localToWorld: Transform;\r\n /**\r\n * Fractional interval for the \"active\" part of a containing spiral.\r\n * (the radius, angle, and length conditions define a complete spiral, and some portion of it is \"active\")\r\n */\r\n protected _activeFractionInterval: Segment1d;\r\n /** Return (reference to) the active portion of the reference spiral. */\r\n public get activeFractionInterval(): Segment1d {\r\n return this._activeFractionInterval;\r\n }\r\n /** Strokes in the active portion. */\r\n public abstract get activeStrokes(): LineString3d;\r\n /** (Reference to) placement transform. */\r\n public get localToWorld(): Transform {\r\n return this._localToWorld;\r\n }\r\n protected constructor(\r\n spiralType: string | undefined,\r\n localToWorld: Transform,\r\n activeFractionInterval: Segment1d | undefined,\r\n designProperties: TransitionConditionalProperties | undefined,\r\n ) {\r\n super();\r\n this._spiralType = spiralType ? spiralType : \"unknownSpiralType\";\r\n this._designProperties = designProperties;\r\n this._localToWorld = localToWorld;\r\n this._activeFractionInterval = activeFractionInterval ? activeFractionInterval : Segment1d.create(0, 1);\r\n }\r\n public get spiralType(): string {\r\n return this._spiralType;\r\n }\r\n /** Return 1/r with convention that exact zero input returns 0 (straight line, zero curvature, infinite radius). */\r\n public static radiusToCurvature(radius: number): number {\r\n return (radius === 0.0) ? 0.0 : 1.0 / radius;\r\n }\r\n /** Return 1/k with convention that near-zero input returns 0 (straight line, zero curvature, infinite radius). */\r\n public static curvatureToRadius(curvature: number): number {\r\n if (Math.abs(curvature) < Geometry.smallAngleRadians)\r\n return 0.0;\r\n return 1.0 / curvature;\r\n }\r\n /** Return a deep clone. */\r\n public abstract override clone(): TransitionSpiral3d;\r\n /** Recompute strokes. */\r\n public abstract refreshComputedProperties(): void;\r\n /** Return (if possible) a spiral which is a portion of this curve. */\r\n public override clonePartialCurve(fractionA: number, fractionB: number): TransitionSpiral3d {\r\n const spiralB = this.clone();\r\n const globalFractionA = this._activeFractionInterval.fractionToPoint(fractionA);\r\n const globalFractionB = this._activeFractionInterval.fractionToPoint(fractionB);\r\n spiralB._activeFractionInterval.set(globalFractionA, globalFractionB);\r\n spiralB.refreshComputedProperties();\r\n return spiralB;\r\n }\r\n /** Clone with a transform applied. */\r\n public override cloneTransformed(transform: Transform): TransitionSpiral3d {\r\n const result = this.clone();\r\n result.tryTransformInPlace(transform); // we're confident it will always work\r\n return result;\r\n }\r\n /** Return the average of the start and end curvatures. */\r\n public static averageCurvature(radiusLimits: Segment1d): number {\r\n return 0.5 * (TransitionSpiral3d.radiusToCurvature(radiusLimits.x0) + TransitionSpiral3d.radiusToCurvature(radiusLimits.x1));\r\n }\r\n /**\r\n * Given two radii (or zeros for 0 curvature) return the average curvature.\r\n * @param r0 start radius, or 0 for line.\r\n * @param r1 end radius, or 0 for line.\r\n */\r\n public static averageCurvatureR0R1(r0: number, r1: number): number {\r\n return 0.5 * (TransitionSpiral3d.radiusToCurvature(r0) + TransitionSpiral3d.radiusToCurvature(r1));\r\n }\r\n /**\r\n * Given two radii (or zeros for 0 curvature) return the curvature at the given fraction.\r\n * @param r0 start radius, or 0 for line.\r\n * @param fraction fractional position between the curvatures defined by r0 and r1.\r\n * @param r1 end radius, or 0 for line.\r\n */\r\n public static interpolateCurvatureR0R1(r0: number, fraction: number, r1: number): number {\r\n return Geometry.interpolate(TransitionSpiral3d.radiusToCurvature(r0), fraction, TransitionSpiral3d.radiusToCurvature(r1));\r\n }\r\n /** Return the arc length of a transition spiral with given sweep and radius pair. */\r\n public static radiusRadiusSweepRadiansToArcLength(radius0: number, radius1: number, sweepRadians: number): number {\r\n return Math.abs(sweepRadians / TransitionSpiral3d.averageCurvatureR0R1(radius0, radius1));\r\n }\r\n /** Return the turn angle for spiral of given length between two radii */\r\n public static radiusRadiusLengthToSweepRadians(radius0: number, radius1: number, arcLength: number): number {\r\n return TransitionSpiral3d.averageCurvatureR0R1(radius0, radius1) * arcLength;\r\n }\r\n /** Return the end radius for spiral of given start radius, length, and turn angle. */\r\n public static radius0LengthSweepRadiansToRadius1(radius0: number, arcLength: number, sweepRadians: number) {\r\n return TransitionSpiral3d.curvatureToRadius(\r\n (2.0 * sweepRadians / arcLength) - TransitionSpiral3d.radiusToCurvature(radius0),\r\n );\r\n }\r\n /** Return the start radius for spiral of given end radius, length, and turn angle. */\r\n public static radius1LengthSweepRadiansToRadius0(radius1: number, arcLength: number, sweepRadians: number) {\r\n return TransitionSpiral3d.curvatureToRadius(\r\n (2.0 * sweepRadians / arcLength) - TransitionSpiral3d.radiusToCurvature(radius1),\r\n );\r\n }\r\n /** Return the original defining properties (if any) saved by the constructor. */\r\n public get designProperties(): TransitionConditionalProperties | undefined {\r\n return this._designProperties;\r\n }\r\n /**\r\n * * If transformA is rigid with uniform scale, apply the rigid part of transformA to the localToWorld transform and\r\n * return the scale and rigid separation.\r\n * * If not rigid, do nothing and return undefined.\r\n * * Also apply the scale factor to the designProperties.\r\n * @param transformA\r\n */\r\n protected applyRigidPartOfTransform(transformA: Transform): { rigidAxes: Matrix3d, scale: number } | undefined {\r\n const rigidData = transformA.matrix.factorRigidWithSignedScale();\r\n if (rigidData !== undefined) {\r\n // [sQ a][R b] = [sQ*R sQb+a]\r\n // but we save it as [Q*R sQb+a] with spiral data scaled by s\r\n const transformC0 = transformA.multiplyTransformTransform(this.localToWorld);\r\n // but pull the scale part out of the matrix\r\n const matrixC = rigidData.rigidAxes.multiplyMatrixMatrix(this.localToWorld.matrix);\r\n this._localToWorld = Transform.createOriginAndMatrix(transformC0.origin, matrixC);\r\n if (this.designProperties)\r\n this.designProperties.applyScaleFactor(rigidData.scale);\r\n return rigidData;\r\n }\r\n return undefined;\r\n }\r\n /**\r\n * Construct an offset of the instance curve as viewed in the xy-plane (ignoring z).\r\n * * No attempt is made to join the offsets of smaller constituent primitives. To construct a fully joined offset for an\r\n * aggregate instance (e.g., LineString3d, CurveChainWithDistanceIndex), use RegionOps.constructCurveXYOffset() instead.\r\n * @param offsetDistanceOrOptions offset distance (positive to left of the instance curve), or options object.\r\n */\r\n public override constructOffsetXY(offsetDistanceOrOptions: number | OffsetOptions): BSplineCurve3d | undefined {\r\n const options = OffsetOptions.create(offsetDistanceOrOptions);\r\n const handler = new CurveOffsetXYHandler(this, options.leftOffsetDistance);\r\n this.emitStrokableParts(handler, options.strokeOptions);\r\n return handler.claimResult();\r\n }\r\n /** Extend the range by the strokes of the spiral. */\r\n public override extendRange(rangeToExtend: Range3d, transform?: Transform): void {\r\n rangeToExtend.extendRange(this.rangeBetweenFractions(0.0, 1.0, transform));\r\n }\r\n /**\r\n * Return the range of spiral between fractions of the activeStrokes.\r\n * * Use activeStrokes point count times interval factor for initial evaluation count, but do at least 5.\r\n */\r\n public override rangeBetweenFractions(fractionA: number, fractionB: number, transform?: Transform): Range3d {\r\n const strokes = this.activeStrokes;\r\n if (undefined === strokes)\r\n return Range3d.createNull();\r\n let count = Math.ceil(strokes.numPoints() * Math.abs(fractionB - fractionA));\r\n count = Geometry.clamp(5, count, 30);\r\n return this.rangeBetweenFractionsByCount(fractionA, fractionB, count, transform, 0.5);\r\n }\r\n /**\r\n * Project instance geometry (via dispatch) onto the given ray, and return the extreme fractional parameters of\r\n * projection.\r\n * @param ray ray onto which the instance is projected. A `Vector3d` is treated as a `Ray3d` with zero origin.\r\n * @param lowHigh optional receiver for output\r\n * @returns range of fractional projection parameters onto the ray, where 0.0 is start of the ray and 1.0 is the\r\n * end of the ray.\r\n */\r\n public override projectedParameterRange(ray: Vector3d | Ray3d, lowHigh?: Range1d): Range1d | undefined {\r\n return PlaneAltitudeRangeContext.findExtremeFractionsAlongDirection(this, ray, lowHigh);\r\n }\r\n}\r\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"XYCurveEvaluator.d.ts","sourceRoot":"","sources":["../../../../src/curve/spiral/XYCurveEvaluator.ts"],"names":[],"mappings":"AASA,OAAO,EAAE,yBAAyB,EAAE,MAAM,4CAA4C,CAAC;AACvF,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,kCAAkC,CAAC;AACrE,OAAO,EAAE,KAAK,EAAE,MAAM,wBAAwB,CAAC;AAI/C;;;;;;;GAOG;AACH,8BAAsB,gBAAgB;IACpC,2CAA2C;aAC3B,KAAK,IAAI,gBAAgB;IACzC,yCAAyC;aACzB,aAAa,CAAC,KAAK,EAAE,GAAG,GAAG,OAAO;IAClD,yCAAyC;aACzB,WAAW,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM;IACrD,yCAAyC;aACzB,WAAW,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM;IACrD,gFAAgF;aAChE,YAAY,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM;IACtD,gFAAgF;aAChE,YAAY,CAAC,QA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AI,IAAI;YACN,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,aAAa,CAAC,QAAQ,CAAC,EAAE,IAAI,CAAC,aAAa,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC,CAAC;IAC5E,CAAC;CAGF;AA7HD,4CA6HC;AACD,sDAAsD;AACtD,gBAAgB,CAAC,aAAa,EAAE,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n\n/** @packageDocumentation\n * @module Curve\n */\nimport { Geometry } from \"../../Geometry\";\nimport { Plane3dByOriginAndVectors } from \"../../geometry3d/Plane3dByOriginAndVectors\";\nimport { Point3d, Vector3d } from \"../../geometry3d/Point3dVector3d\";\nimport { Ray3d } from \"../../geometry3d/Ray3d\";\nimport { Quadrature } from \"../../numerics/Quadrature\";\nimport { SimpleNewton } from \"../../numerics/Newton\";\n\n/**\n * XYCurveEvaluator is an abstract with methods for evaluating X and Y parts of a curve parameterized by a fraction.\n * * The required methods call for independent X and Y evaluation.\n * * Base class methods package those (multiple) calls into point, ray, and plane structures.\n * * An implementation that has evaluation substantial cost that can be shared among x,y parts or between\n * primary functions and derivatives might choose to implement the point and derivative methods directly.\n * @internal\n */\nexport abstract class XYCurveEvaluator {\n /** Return a deep copy of the evaluator. */\n public abstract clone(): XYCurveEvaluator;\n /** Test for near identical evaluator. */\n public abstract isAlmostEqual(other: any): boolean;\n /** Evaluate X at fractional position. */\n public abstract fractionToX(fraction: number): number;\n /** Evaluate Y at fractional position. */\n public abstract fractionToY(fraction: number): number;\n /** Evaluate derivative of X with respect to fraction at fractional position. */\n public abstract fractionToDX(fraction: number): number;\n /** Evaluate derivative of Y with respect to fraction at fractional position. */\n public abstract fractionToDY(fraction: number): number;\n /** Evaluate second derivative of X with respect to fraction at fractional position. */\n public abstract fractionToDDX(fraction: number): number;\n /** Evaluate second derivative of Y with respect to fraction at fractional position. */\n public abstract fractionToDDY(fraction: number): number;\n /** Evaluate third derivative of X with respect to fraction at fractional position. */\n public abstract fractionToD3X(fraction: number): number;\n /** Evaluate third derivative of Y with respect to fraction at fractional position. */\n public abstract fractionToD3Y(fraction: number): number;\n /** Evaluate both X and Y at fractional coordinate, return bundled as a point. */\n public fractionToPoint(fraction: number, result?: Point3d): Point3d {\n return Point3d.create(this.fractionToX(fraction), this.fractionToY(fraction), 0.0, result);\n }\n /**\n * Evaluate both X and Y and their first derivatives at fractional coordinate, return bundled as origin and\n * (non-unit) direction vector.\n */\n public fractionToPointAndDerivative(fraction: number, result?: Ray3d): Ray3d {\n return Ray3d.createXYZUVW(this.fractionToX(fraction), this.fractionToY(fraction), 0.0,\n this.fractionToDX(fraction), this.fractionToDY(fraction), 0,\n result);\n }\n /**\n * Evaluate both X and Y and their second derivatives at fractional coordinate, return bundled as origin and\n * (non-unit) vectorU an vectorV.\n */\n public fractionToPointAnd2Derivatives(fraction: number, result?: Plane3dByOriginAndVectors): Plane3dByOriginAndVectors {\n return Plane3dByOriginAndVectors.createOriginAndVectorsXYZ(\n this.fractionToX(fraction), this.fractionToY(fraction), 0.0,\n this.fractionToDX(fraction), this.fractionToDY(fraction), 0,\n this.fractionToDDX(fraction), this.fractionToDDY(fraction), 0,\n result);\n }\n /**\n * Return the magnitude of the tangent vector at fraction.\n * @param fraction fractional position along the curve\n */\n public fractionToTangentMagnitude(fraction: number): number {\n const u = this.fractionToDX(fraction);\n const v = this.fractionToDY(fraction);\n return Geometry.hypotenuseXY(u, v);\n }\n /** Invert the fractionToX function for given X. */\n public abstract xToFraction(x: number): number | undefined;\n protected static _gaussX: Float64Array;\n protected static _gaussWeight: Float64Array;\n protected static _gaussMapper: (xA: number, xB: number, arrayX: Float64Array, arrayW: Float64Array) => number;\n /**\n * Initialize class level work arrays for 5 point Gaussian quadrature.\n * * These static variables are reused on calls to [[integrateDistanceBetweenFractions]].\n */\n public static initWorkSpace(): void {\n XYCurveEvaluator._gaussX = new Float64Array(5);\n XYCurveEvaluator._gaussWeight = new Float64Array(5);\n XYCurveEvaluator._gaussMapper = (xA, xB, xMapped, wMapped) => Quadrature.setupGauss5(xA, xB, xMapped, wMapped);\n }\n /**\n * Integrate between nominal fractions with default gauss rule.\n * * The caller is expected to choose nearby fractions so that the single gauss interval accuracy is good.\n */\n public integrateDistanceBetweenFractions(fraction0: number, fraction1: number): number {\n const gaussX = XYCurveEvaluator._gaussX;\n const gaussWeight = XYCurveEvaluator._gaussWeight;\n const numEval = XYCurveEvaluator._gaussMapper(fraction0, fraction1, gaussX, gaussWeight);\n let sum = 0;\n for (let k = 0; k < numEval; k++) {\n sum += gaussWeight[k] * this.fractionToTangentMagnitude(gaussX[k]);\n }\n return sum;\n }\n /**\n * Inverse integrated distance.\n * @param fraction0 start of fraction interval.\n * @param fraction1 end of fraction interval.\n * @param distance0 distance at start.\n * @param distance1 distance at end.\n * @param targetDistance intermediate distance.\n */\n public inverseDistanceFraction(\n fraction0: number, fraction1: number, distance0: number, distance1: number, targetDistance: number,\n ): number | undefined {\n const startFraction = Geometry.inverseInterpolate(fraction0, distance0, fraction1, distance1, targetDistance);\n if (startFraction !== undefined) {\n return SimpleNewton.runNewton1D(startFraction,\n (fraction: number) => {\n const d = this.integrateDistanceBetweenFractions(fraction0, fraction);\n return distance0 + d - targetDistance;\n },\n (fraction: number) => this.fractionToTangentMagnitude(fraction));\n }\n return undefined;\n }\n /**\n * Get the point and its derivatives at a given fraction.\n * @param fraction fractional position along x axis\n * @param xy xy coordinates of point on the curve\n * @param d1xy first derivative vector\n * @param d2xy second derivative vector\n * @param d3xy third derivative vector\n */\n public fractionToPointAnd3Derivatives(\n fraction: number, xy: Point3d, d1xy?: Vector3d, d2xy?: Vector3d, d3xy?: Vector3d,\n ): void {\n xy.set(this.fractionToX(fraction), this.fractionToY(fraction), 0);\n if (d1xy)\n d1xy.set(this.fractionToDX(fraction), this.fractionToDY(fraction), 0);\n if (d2xy)\n d2xy.set(this.fractionToDDX(fraction), this.fractionToDDY(fraction), 0);\n if (d3xy)\n d3xy.set(this.fractionToD3X(fraction), this.fractionToD3Y(fraction), 0);\n }\n /** Apply a uniform scale around the origin. */\n public abstract scaleInPlace(scaleFactor: number): void;\n}\n// at load time, initialize gauss quadrature workspace\nXYCurveEvaluator.initWorkSpace();\n"]}
1
+ {"version":3,"file":"XYCurveEvaluator.js","sourceRoot":"","sources":["../../../../src/curve/spiral/XYCurveEvaluator.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;;;AAE/F;;GAEG;AACH,6CAA0C;AAC1C,0FAAuF;AACvF,sEAAqE;AACrE,kDAA+C;AAC/C,0DAAuD;AACvD,kDAAqD;AAErD;;;;;;;GAOG;AACH,MAAsB,gBAAgB;IAqBpC,iFAAiF;IAC1E,eAAe,CAAC,QAAgB,EAAE,MAAgB;QACvD,OAAO,yBAAO,CAAC,MAAM,CAAC,IAAI,CAAC,WAAW,CAAC,QAAQ,CAAC,EAAE,IAAI,CAAC,WAAW,CAAC,QAAQ,CAAC,EAAE,GAAG,EAAE,MAAM,CAAC,CAAC;IAC7F,CAAC;IACD;;;OAGG;IACI,4BAA4B,CAAC,QAAgB,EAAE,MAAc;QAClE,OAAO,aAAK,CAAC,YAAY,CAAC,IAAI,CAAC,WAAW,CAAC,QAAQ,CAAC,EAAE,IAAI,CAAC,WAAW,CAAC,QAAQ,CAAC,EAAE,GAAG,EACnF,IAAI,CAAC,YAAY,CAAC,QAAQ,CAAC,EAAE,IAAI,CAAC,YAAY,CAAC,QAAQ,CAAC,EAAE,CAAC,EAC3D,MAAM,CAAC,CAAC;IACZ,CAAC;IACD;;;OAGG;IACI,8BAA8B,CAAC,QAAgB,EAAE,MAAkC;QACxF,OAAO,qDAAyB,CAAC,yBAAyB,CACxD,IAAI,CAAC,WAAW,CAAC,QAAQ,CAAC,EAAE,IAAI,CAAC,WAAW,CAAC,QAAQ,CAAC,EAAE,GAAG,EAC3D,IAAI,CAAC,YAAY,CAAC,QA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AI,IAAI;YACN,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,aAAa,CAAC,QAAQ,CAAC,EAAE,IAAI,CAAC,aAAa,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC,CAAC;QAC1E,IAAI,IAAI;YACN,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,aAAa,CAAC,QAAQ,CAAC,EAAE,IAAI,CAAC,aAAa,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC,CAAC;IAC5E,CAAC;CAGF;AA9HD,4CA8HC;AACD,sDAAsD;AACtD,gBAAgB,CAAC,aAAa,EAAE,CAAC","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 Curve\r\n */\r\nimport { Geometry } from \"../../Geometry\";\r\nimport { Plane3dByOriginAndVectors } from \"../../geometry3d/Plane3dByOriginAndVectors\";\r\nimport { Point3d, Vector3d } from \"../../geometry3d/Point3dVector3d\";\r\nimport { Ray3d } from \"../../geometry3d/Ray3d\";\r\nimport { Quadrature } from \"../../numerics/Quadrature\";\r\nimport { SimpleNewton } from \"../../numerics/Newton\";\r\n\r\n/**\r\n * XYCurveEvaluator is an abstract with methods for evaluating X and Y parts of a curve parameterized by a fraction.\r\n * * The required methods call for independent X and Y evaluation.\r\n * * Base class methods package those (multiple) calls into point, ray, and plane structures.\r\n * * An implementation that has evaluation substantial cost that can be shared among x,y parts or between\r\n * primary functions and derivatives might choose to implement the point and derivative methods directly.\r\n * @internal\r\n */\r\nexport abstract class XYCurveEvaluator {\r\n /** Return a deep copy of the evaluator. */\r\n public abstract clone(): XYCurveEvaluator;\r\n /** Test for near identical evaluator. */\r\n public abstract isAlmostEqual(other: any): boolean;\r\n /** Evaluate X at fractional position. */\r\n public abstract fractionToX(fraction: number): number;\r\n /** Evaluate Y at fractional position. */\r\n public abstract fractionToY(fraction: number): number;\r\n /** Evaluate derivative of X with respect to fraction at fractional position. */\r\n public abstract fractionToDX(fraction: number): number;\r\n /** Evaluate derivative of Y with respect to fraction at fractional position. */\r\n public abstract fractionToDY(fraction: number): number;\r\n /** Evaluate second derivative of X with respect to fraction at fractional position. */\r\n public abstract fractionToDDX(fraction: number): number;\r\n /** Evaluate second derivative of Y with respect to fraction at fractional position. */\r\n public abstract fractionToDDY(fraction: number): number;\r\n /** Evaluate third derivative of X with respect to fraction at fractional position. */\r\n public abstract fractionToD3X(fraction: number): number;\r\n /** Evaluate third derivative of Y with respect to fraction at fractional position. */\r\n public abstract fractionToD3Y(fraction: number): number;\r\n /** Evaluate both X and Y at fractional coordinate, return bundled as a point. */\r\n public fractionToPoint(fraction: number, result?: Point3d): Point3d {\r\n return Point3d.create(this.fractionToX(fraction), this.fractionToY(fraction), 0.0, result);\r\n }\r\n /**\r\n * Evaluate both X and Y and their first derivatives at fractional coordinate, return bundled as origin and\r\n * (non-unit) direction vector.\r\n */\r\n public fractionToPointAndDerivative(fraction: number, result?: Ray3d): Ray3d {\r\n return Ray3d.createXYZUVW(this.fractionToX(fraction), this.fractionToY(fraction), 0.0,\r\n this.fractionToDX(fraction), this.fractionToDY(fraction), 0,\r\n result);\r\n }\r\n /**\r\n * Evaluate both X and Y and their second derivatives at fractional coordinate, return bundled as origin and\r\n * (non-unit) vectorU an vectorV.\r\n */\r\n public fractionToPointAnd2Derivatives(fraction: number, result?: Plane3dByOriginAndVectors): Plane3dByOriginAndVectors {\r\n return Plane3dByOriginAndVectors.createOriginAndVectorsXYZ(\r\n this.fractionToX(fraction), this.fractionToY(fraction), 0.0,\r\n this.fractionToDX(fraction), this.fractionToDY(fraction), 0,\r\n this.fractionToDDX(fraction), this.fractionToDDY(fraction), 0,\r\n result,\r\n );\r\n }\r\n /**\r\n * Return the magnitude of the tangent vector at fraction.\r\n * @param fraction fractional position along the curve\r\n */\r\n public fractionToTangentMagnitude(fraction: number): number {\r\n const u = this.fractionToDX(fraction);\r\n const v = this.fractionToDY(fraction);\r\n return Geometry.hypotenuseXY(u, v);\r\n }\r\n /** Invert the fractionToX function for given X. */\r\n public abstract xToFraction(x: number): number | undefined;\r\n protected static _gaussX: Float64Array;\r\n protected static _gaussWeight: Float64Array;\r\n protected static _gaussMapper: (xA: number, xB: number, arrayX: Float64Array, arrayW: Float64Array) => number;\r\n /**\r\n * Initialize class level work arrays for 5 point Gaussian quadrature.\r\n * * These static variables are reused on calls to [[integrateDistanceBetweenFractions]].\r\n */\r\n public static initWorkSpace(): void {\r\n XYCurveEvaluator._gaussX = new Float64Array(5);\r\n XYCurveEvaluator._gaussWeight = new Float64Array(5);\r\n XYCurveEvaluator._gaussMapper = (xA, xB, xMapped, wMapped) => Quadrature.setupGauss5(xA, xB, xMapped, wMapped);\r\n }\r\n /**\r\n * Integrate between nominal fractions with default gauss rule.\r\n * * The caller is expected to choose nearby fractions so that the single gauss interval accuracy is good.\r\n */\r\n public integrateDistanceBetweenFractions(fraction0: number, fraction1: number): number {\r\n const gaussX = XYCurveEvaluator._gaussX;\r\n const gaussWeight = XYCurveEvaluator._gaussWeight;\r\n const numEval = XYCurveEvaluator._gaussMapper(fraction0, fraction1, gaussX, gaussWeight);\r\n let sum = 0;\r\n for (let k = 0; k < numEval; k++) {\r\n sum += gaussWeight[k] * this.fractionToTangentMagnitude(gaussX[k]);\r\n }\r\n return sum;\r\n }\r\n /**\r\n * Inverse integrated distance.\r\n * @param fraction0 start of fraction interval.\r\n * @param fraction1 end of fraction interval.\r\n * @param distance0 distance at start.\r\n * @param distance1 distance at end.\r\n * @param targetDistance intermediate distance.\r\n */\r\n public inverseDistanceFraction(\r\n fraction0: number, fraction1: number, distance0: number, distance1: number, targetDistance: number,\r\n ): number | undefined {\r\n const startFraction = Geometry.inverseInterpolate(fraction0, distance0, fraction1, distance1, targetDistance);\r\n if (startFraction !== undefined) {\r\n return SimpleNewton.runNewton1D(startFraction,\r\n (fraction: number) => {\r\n const d = this.integrateDistanceBetweenFractions(fraction0, fraction);\r\n return distance0 + d - targetDistance;\r\n },\r\n (fraction: number) => this.fractionToTangentMagnitude(fraction));\r\n }\r\n return undefined;\r\n }\r\n /**\r\n * Get the point and its derivatives at a given fraction.\r\n * @param fraction fractional position along x axis\r\n * @param xy xy coordinates of point on the curve\r\n * @param d1xy first derivative vector\r\n * @param d2xy second derivative vector\r\n * @param d3xy third derivative vector\r\n */\r\n public fractionToPointAnd3Derivatives(\r\n fraction: number, xy: Point3d, d1xy?: Vector3d, d2xy?: Vector3d, d3xy?: Vector3d,\r\n ): void {\r\n xy.set(this.fractionToX(fraction), this.fractionToY(fraction), 0);\r\n if (d1xy)\r\n d1xy.set(this.fractionToDX(fraction), this.fractionToDY(fraction), 0);\r\n if (d2xy)\r\n d2xy.set(this.fractionToDDX(fraction), this.fractionToDDY(fraction), 0);\r\n if (d3xy)\r\n d3xy.set(this.fractionToD3X(fraction), this.fractionToD3Y(fraction), 0);\r\n }\r\n /** Apply a uniform scale around the origin. */\r\n public abstract scaleInPlace(scaleFactor: number): void;\r\n}\r\n// at load time, initialize gauss quadrature workspace\r\nXYCurveEvaluator.initWorkSpace();\r\n"]}