@itwin/core-geometry 5.2.0-dev.26 → 5.2.0-dev.28

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 (495) 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.d.ts +10 -3
  20. package/lib/cjs/clipping/ClipPlane.d.ts.map +1 -1
  21. package/lib/cjs/clipping/ClipPlane.js +9 -2
  22. package/lib/cjs/clipping/ClipPlane.js.map +1 -1
  23. package/lib/cjs/clipping/ClipPrimitive.js.map +1 -1
  24. package/lib/cjs/clipping/ClipUtils.js.map +1 -1
  25. package/lib/cjs/clipping/ClipVector.js.map +1 -1
  26. package/lib/cjs/clipping/ConvexClipPlaneSet.d.ts +12 -9
  27. package/lib/cjs/clipping/ConvexClipPlaneSet.d.ts.map +1 -1
  28. package/lib/cjs/clipping/ConvexClipPlaneSet.js +17 -12
  29. package/lib/cjs/clipping/ConvexClipPlaneSet.js.map +1 -1
  30. package/lib/cjs/clipping/UnionOfConvexClipPlaneSets.d.ts +20 -3
  31. package/lib/cjs/clipping/UnionOfConvexClipPlaneSets.d.ts.map +1 -1
  32. package/lib/cjs/clipping/UnionOfConvexClipPlaneSets.js +22 -5
  33. package/lib/cjs/clipping/UnionOfConvexClipPlaneSets.js.map +1 -1
  34. package/lib/cjs/clipping/internalContexts/LineStringOffsetClipperContext.js.map +1 -1
  35. package/lib/cjs/core-geometry.js.map +1 -1
  36. package/lib/cjs/curve/Arc3d.js.map +1 -1
  37. package/lib/cjs/curve/ConstructCurveBetweenCurves.js.map +1 -1
  38. package/lib/cjs/curve/CoordinateXYZ.js.map +1 -1
  39. package/lib/cjs/curve/CurveChainWithDistanceIndex.js.map +1 -1
  40. package/lib/cjs/curve/CurveCollection.js.map +1 -1
  41. package/lib/cjs/curve/CurveCurve.js.map +1 -1
  42. package/lib/cjs/curve/CurveExtendMode.js.map +1 -1
  43. package/lib/cjs/curve/CurveFactory.js.map +1 -1
  44. package/lib/cjs/curve/CurveLocationDetail.js.map +1 -1
  45. package/lib/cjs/curve/CurveOps.js.map +1 -1
  46. package/lib/cjs/curve/CurvePrimitive.js.map +1 -1
  47. package/lib/cjs/curve/CurveProcessor.js.map +1 -1
  48. package/lib/cjs/curve/CurveTypes.js.map +1 -1
  49. package/lib/cjs/curve/CurveWireMomentsXYZ.js.map +1 -1
  50. package/lib/cjs/curve/GeometryQuery.js.map +1 -1
  51. package/lib/cjs/curve/LineSegment3d.js.map +1 -1
  52. package/lib/cjs/curve/LineString3d.js.map +1 -1
  53. package/lib/cjs/curve/Loop.js.map +1 -1
  54. package/lib/cjs/curve/OffsetOptions.js.map +1 -1
  55. package/lib/cjs/curve/ParityRegion.js.map +1 -1
  56. package/lib/cjs/curve/Path.js.map +1 -1
  57. package/lib/cjs/curve/PointString3d.js.map +1 -1
  58. package/lib/cjs/curve/ProxyCurve.js.map +1 -1
  59. package/lib/cjs/curve/Query/ConsolidateAdjacentPrimitivesContext.js.map +1 -1
  60. package/lib/cjs/curve/Query/CurveSplitContext.js.map +1 -1
  61. package/lib/cjs/curve/Query/CylindricalRange.js.map +1 -1
  62. package/lib/cjs/curve/Query/InOutTests.js.map +1 -1
  63. package/lib/cjs/curve/Query/PlanarSubdivision.js.map +1 -1
  64. package/lib/cjs/curve/Query/StrokeCountChain.js.map +1 -1
  65. package/lib/cjs/curve/Query/StrokeCountMap.js.map +1 -1
  66. package/lib/cjs/curve/RegionMomentsXY.js.map +1 -1
  67. package/lib/cjs/curve/RegionOps.js.map +1 -1
  68. package/lib/cjs/curve/RegionOpsClassificationSweeps.js.map +1 -1
  69. package/lib/cjs/curve/StrokeOptions.js.map +1 -1
  70. package/lib/cjs/curve/UnionRegion.js.map +1 -1
  71. package/lib/cjs/curve/internalContexts/AnnounceTangentStrokeHandler.js.map +1 -1
  72. package/lib/cjs/curve/internalContexts/AppendPlaneIntersectionStrokeHandler.js.map +1 -1
  73. package/lib/cjs/curve/internalContexts/ChainCollectorContext.js.map +1 -1
  74. package/lib/cjs/curve/internalContexts/CloneCurvesContext.js.map +1 -1
  75. package/lib/cjs/curve/internalContexts/CloneWithExpandedLineStrings.js.map +1 -1
  76. package/lib/cjs/curve/internalContexts/ClosestPointStrokeHandler.js.map +1 -1
  77. package/lib/cjs/curve/internalContexts/CountLinearPartsSearchContext.js.map +1 -1
  78. package/lib/cjs/curve/internalContexts/CurveCurveCloseApproachXY.js.map +1 -1
  79. package/lib/cjs/curve/internalContexts/CurveCurveIntersectXY.js.map +1 -1
  80. package/lib/cjs/curve/internalContexts/CurveCurveIntersectXYZ.js.map +1 -1
  81. package/lib/cjs/curve/internalContexts/CurveLengthContext.js.map +1 -1
  82. package/lib/cjs/curve/internalContexts/CurveOffsetXYHandler.js.map +1 -1
  83. package/lib/cjs/curve/internalContexts/EllipticalArcApproximationContext.js.map +1 -1
  84. package/lib/cjs/curve/internalContexts/GapSearchContext.js.map +1 -1
  85. package/lib/cjs/curve/internalContexts/MultiChainCollector.js.map +1 -1
  86. package/lib/cjs/curve/internalContexts/NewtonRtoRStrokeHandler.js.map +1 -1
  87. package/lib/cjs/curve/internalContexts/PlaneAltitudeRangeContext.js.map +1 -1
  88. package/lib/cjs/curve/internalContexts/PolygonOffsetContext.d.ts.map +1 -1
  89. package/lib/cjs/curve/internalContexts/PolygonOffsetContext.js +30 -50
  90. package/lib/cjs/curve/internalContexts/PolygonOffsetContext.js.map +1 -1
  91. package/lib/cjs/curve/internalContexts/SumLengthsContext.js.map +1 -1
  92. package/lib/cjs/curve/internalContexts/TransferWithSplitArcs.js.map +1 -1
  93. package/lib/cjs/curve/internalContexts/TransformInPlaceContext.js.map +1 -1
  94. package/lib/cjs/curve/spiral/AustralianRailCorpXYEvaluator.js.map +1 -1
  95. package/lib/cjs/curve/spiral/ClothoidSeries.js.map +1 -1
  96. package/lib/cjs/curve/spiral/CubicEvaluator.js.map +1 -1
  97. package/lib/cjs/curve/spiral/CzechSpiralEvaluator.js.map +1 -1
  98. package/lib/cjs/curve/spiral/DirectHalfCosineSpiralEvaluator.js.map +1 -1
  99. package/lib/cjs/curve/spiral/DirectSpiral3d.js.map +1 -1
  100. package/lib/cjs/curve/spiral/IntegratedSpiral3d.js.map +1 -1
  101. package/lib/cjs/curve/spiral/MXCubicAlongArcSpiralEvaluator.js.map +1 -1
  102. package/lib/cjs/curve/spiral/NormalizedTransition.js.map +1 -1
  103. package/lib/cjs/curve/spiral/PolishCubicSpiralEvaluator.js.map +1 -1
  104. package/lib/cjs/curve/spiral/TransitionConditionalProperties.js.map +1 -1
  105. package/lib/cjs/curve/spiral/TransitionSpiral3d.js.map +1 -1
  106. package/lib/cjs/curve/spiral/XYCurveEvaluator.js.map +1 -1
  107. package/lib/cjs/geometry3d/Angle.js.map +1 -1
  108. package/lib/cjs/geometry3d/AngleSweep.js.map +1 -1
  109. package/lib/cjs/geometry3d/BarycentricTriangle.js.map +1 -1
  110. package/lib/cjs/geometry3d/BilinearPatch.js.map +1 -1
  111. package/lib/cjs/geometry3d/CoincidentGeometryOps.js.map +1 -1
  112. package/lib/cjs/geometry3d/Ellipsoid.js.map +1 -1
  113. package/lib/cjs/geometry3d/FrameBuilder.js.map +1 -1
  114. package/lib/cjs/geometry3d/FrustumAnimation.js.map +1 -1
  115. package/lib/cjs/geometry3d/GeometryHandler.js.map +1 -1
  116. package/lib/cjs/geometry3d/GrowableBlockedArray.js.map +1 -1
  117. package/lib/cjs/geometry3d/GrowableFloat64Array.js.map +1 -1
  118. package/lib/cjs/geometry3d/GrowableXYArray.js.map +1 -1
  119. package/lib/cjs/geometry3d/GrowableXYZArray.js.map +1 -1
  120. package/lib/cjs/geometry3d/IndexedCollectionInterval.js.map +1 -1
  121. package/lib/cjs/geometry3d/IndexedXYCollection.js.map +1 -1
  122. package/lib/cjs/geometry3d/IndexedXYZCollection.js.map +1 -1
  123. package/lib/cjs/geometry3d/LongitudeLatitudeAltitude.js.map +1 -1
  124. package/lib/cjs/geometry3d/Matrix3d.js.map +1 -1
  125. package/lib/cjs/geometry3d/OrderedRotationAngles.js.map +1 -1
  126. package/lib/cjs/geometry3d/Plane3d.js.map +1 -1
  127. package/lib/cjs/geometry3d/Plane3dByOriginAndUnitNormal.js.map +1 -1
  128. package/lib/cjs/geometry3d/Plane3dByOriginAndVectors.js.map +1 -1
  129. package/lib/cjs/geometry3d/Point2dArrayCarrier.js.map +1 -1
  130. package/lib/cjs/geometry3d/Point2dVector2d.js.map +1 -1
  131. package/lib/cjs/geometry3d/Point3dArrayCarrier.js.map +1 -1
  132. package/lib/cjs/geometry3d/Point3dVector3d.js.map +1 -1
  133. package/lib/cjs/geometry3d/PointHelpers.js.map +1 -1
  134. package/lib/cjs/geometry3d/PointStreaming.js.map +1 -1
  135. package/lib/cjs/geometry3d/PolygonOps.d.ts +18 -9
  136. package/lib/cjs/geometry3d/PolygonOps.d.ts.map +1 -1
  137. package/lib/cjs/geometry3d/PolygonOps.js +53 -26
  138. package/lib/cjs/geometry3d/PolygonOps.js.map +1 -1
  139. package/lib/cjs/geometry3d/PolylineCompressionByEdgeOffset.js.map +1 -1
  140. package/lib/cjs/geometry3d/PolylineOps.js.map +1 -1
  141. package/lib/cjs/geometry3d/Range.js.map +1 -1
  142. package/lib/cjs/geometry3d/Ray2d.js.map +1 -1
  143. package/lib/cjs/geometry3d/Ray3d.js.map +1 -1
  144. package/lib/cjs/geometry3d/ReusableObjectCache.js.map +1 -1
  145. package/lib/cjs/geometry3d/Segment1d.js.map +1 -1
  146. package/lib/cjs/geometry3d/SortablePolygon.js.map +1 -1
  147. package/lib/cjs/geometry3d/Transform.js.map +1 -1
  148. package/lib/cjs/geometry3d/UVSurfaceOps.js.map +1 -1
  149. package/lib/cjs/geometry3d/XYZProps.js.map +1 -1
  150. package/lib/cjs/geometry3d/YawPitchRollAngles.js.map +1 -1
  151. package/lib/cjs/geometry4d/Map4d.js.map +1 -1
  152. package/lib/cjs/geometry4d/Matrix4d.d.ts +16 -0
  153. package/lib/cjs/geometry4d/Matrix4d.d.ts.map +1 -1
  154. package/lib/cjs/geometry4d/Matrix4d.js +26 -0
  155. package/lib/cjs/geometry4d/Matrix4d.js.map +1 -1
  156. package/lib/cjs/geometry4d/MomentData.js.map +1 -1
  157. package/lib/cjs/geometry4d/PlaneByOriginAndVectors4d.js.map +1 -1
  158. package/lib/cjs/geometry4d/Point4d.js.map +1 -1
  159. package/lib/cjs/numerics/BandedSystem.js.map +1 -1
  160. package/lib/cjs/numerics/BezierPolynomials.js.map +1 -1
  161. package/lib/cjs/numerics/ClusterableArray.js.map +1 -1
  162. package/lib/cjs/numerics/Complex.js.map +1 -1
  163. package/lib/cjs/numerics/ConvexPolygon2d.js.map +1 -1
  164. package/lib/cjs/numerics/Newton.js.map +1 -1
  165. package/lib/cjs/numerics/PascalCoefficients.js.map +1 -1
  166. package/lib/cjs/numerics/PolarData.js.map +1 -1
  167. package/lib/cjs/numerics/Polynomials.js.map +1 -1
  168. package/lib/cjs/numerics/Quadrature.js.map +1 -1
  169. package/lib/cjs/numerics/Range1dArray.js.map +1 -1
  170. package/lib/cjs/numerics/SmallSystem.js.map +1 -1
  171. package/lib/cjs/numerics/TriDiagonalSystem.js.map +1 -1
  172. package/lib/cjs/numerics/UnionFind.js.map +1 -1
  173. package/lib/cjs/numerics/UsageSums.js.map +1 -1
  174. package/lib/cjs/polyface/AuxData.js.map +1 -1
  175. package/lib/cjs/polyface/BoxTopology.js.map +1 -1
  176. package/lib/cjs/polyface/FacetFaceData.js.map +1 -1
  177. package/lib/cjs/polyface/FacetLocationDetail.js.map +1 -1
  178. package/lib/cjs/polyface/FacetOrientation.js.map +1 -1
  179. package/lib/cjs/polyface/GreedyTriangulationBetweenLineStrings.js.map +1 -1
  180. package/lib/cjs/polyface/IndexedEdgeMatcher.js.map +1 -1
  181. package/lib/cjs/polyface/IndexedPolyfaceVisitor.js.map +1 -1
  182. package/lib/cjs/polyface/IndexedPolyfaceWalker.js.map +1 -1
  183. package/lib/cjs/polyface/Polyface.d.ts +1 -3
  184. package/lib/cjs/polyface/Polyface.d.ts.map +1 -1
  185. package/lib/cjs/polyface/Polyface.js +2 -6
  186. package/lib/cjs/polyface/Polyface.js.map +1 -1
  187. package/lib/cjs/polyface/PolyfaceBuilder.js.map +1 -1
  188. package/lib/cjs/polyface/PolyfaceClip.js.map +1 -1
  189. package/lib/cjs/polyface/PolyfaceData.d.ts +2 -0
  190. package/lib/cjs/polyface/PolyfaceData.d.ts.map +1 -1
  191. package/lib/cjs/polyface/PolyfaceData.js +7 -3
  192. package/lib/cjs/polyface/PolyfaceData.js.map +1 -1
  193. package/lib/cjs/polyface/PolyfaceQuery.js.map +1 -1
  194. package/lib/cjs/polyface/RangeLengthData.js.map +1 -1
  195. package/lib/cjs/polyface/RangeTree/LineString3dRangeTreeContext.js.map +1 -1
  196. package/lib/cjs/polyface/RangeTree/MinimumValueTester.js.map +1 -1
  197. package/lib/cjs/polyface/RangeTree/Point3dArrayRangeTreeContext.js.map +1 -1
  198. package/lib/cjs/polyface/RangeTree/PolyfaceRangeTreeContext.js.map +1 -1
  199. package/lib/cjs/polyface/RangeTree/RangeTreeNode.js.map +1 -1
  200. package/lib/cjs/polyface/RangeTree/RangeTreeSearchHandlers.js.map +1 -1
  201. package/lib/cjs/polyface/TaggedNumericData.js.map +1 -1
  202. package/lib/cjs/polyface/TriangleCandidate.js.map +1 -1
  203. package/lib/cjs/polyface/multiclip/BuildAverageNormalsContext.js.map +1 -1
  204. package/lib/cjs/polyface/multiclip/GriddedRaggedRange2dSet.js.map +1 -1
  205. package/lib/cjs/polyface/multiclip/GriddedRaggedRange2dSetWithOverflow.js.map +1 -1
  206. package/lib/cjs/polyface/multiclip/LinearSearchRange2dArray.js.map +1 -1
  207. package/lib/cjs/polyface/multiclip/OffsetMeshContext.js.map +1 -1
  208. package/lib/cjs/polyface/multiclip/Range2dSearchInterface.js.map +1 -1
  209. package/lib/cjs/polyface/multiclip/RangeSearch.js.map +1 -1
  210. package/lib/cjs/polyface/multiclip/SweepLineStringToFacetContext.js.map +1 -1
  211. package/lib/cjs/polyface/multiclip/XYPointBuckets.js.map +1 -1
  212. package/lib/cjs/serialization/BGFBAccessors.js.map +1 -1
  213. package/lib/cjs/serialization/BGFBReader.js.map +1 -1
  214. package/lib/cjs/serialization/BGFBWriter.js.map +1 -1
  215. package/lib/cjs/serialization/BentleyGeometryFlatBuffer.js.map +1 -1
  216. package/lib/cjs/serialization/DeepCompare.js.map +1 -1
  217. package/lib/cjs/serialization/GeometrySamples.js.map +1 -1
  218. package/lib/cjs/serialization/IModelJsonSchema.js.map +1 -1
  219. package/lib/cjs/serialization/SerializationHelpers.js.map +1 -1
  220. package/lib/cjs/solid/Box.js.map +1 -1
  221. package/lib/cjs/solid/Cone.js.map +1 -1
  222. package/lib/cjs/solid/LinearSweep.js.map +1 -1
  223. package/lib/cjs/solid/RotationalSweep.js.map +1 -1
  224. package/lib/cjs/solid/RuledSweep.js.map +1 -1
  225. package/lib/cjs/solid/SolidPrimitive.js.map +1 -1
  226. package/lib/cjs/solid/Sphere.js.map +1 -1
  227. package/lib/cjs/solid/SweepContour.js.map +1 -1
  228. package/lib/cjs/solid/TorusPipe.js.map +1 -1
  229. package/lib/cjs/topology/ChainMerge.js.map +1 -1
  230. package/lib/cjs/topology/Graph.js.map +1 -1
  231. package/lib/cjs/topology/HalfEdgeGraphFromIndexedLoopsContext.js.map +1 -1
  232. package/lib/cjs/topology/HalfEdgeGraphSearch.js.map +1 -1
  233. package/lib/cjs/topology/HalfEdgeGraphSpineContext.js.map +1 -1
  234. package/lib/cjs/topology/HalfEdgeGraphValidation.js.map +1 -1
  235. package/lib/cjs/topology/HalfEdgeMarkSet.js.map +1 -1
  236. package/lib/cjs/topology/HalfEdgeNodeXYZUV.js.map +1 -1
  237. package/lib/cjs/topology/HalfEdgePointInGraphSearch.js.map +1 -1
  238. package/lib/cjs/topology/HalfEdgePositionDetail.js.map +1 -1
  239. package/lib/cjs/topology/HalfEdgePriorityQueue.js.map +1 -1
  240. package/lib/cjs/topology/InsertAndRetriangulateContext.js.map +1 -1
  241. package/lib/cjs/topology/MaskManager.js.map +1 -1
  242. package/lib/cjs/topology/Merging.js.map +1 -1
  243. package/lib/cjs/topology/RegularizeFace.js.map +1 -1
  244. package/lib/cjs/topology/SignedDataSummary.js.map +1 -1
  245. package/lib/cjs/topology/SpaceTriangulation.js.map +1 -1
  246. package/lib/cjs/topology/Triangulation.js.map +1 -1
  247. package/lib/cjs/topology/XYParitySearchContext.js.map +1 -1
  248. package/lib/esm/Constant.js.map +1 -1
  249. package/lib/esm/Geometry.js.map +1 -1
  250. package/lib/esm/bspline/AkimaCurve3d.js.map +1 -1
  251. package/lib/esm/bspline/BSpline1dNd.js.map +1 -1
  252. package/lib/esm/bspline/BSplineCurve.js.map +1 -1
  253. package/lib/esm/bspline/BSplineCurve3dH.js.map +1 -1
  254. package/lib/esm/bspline/BSplineCurveOps.js.map +1 -1
  255. package/lib/esm/bspline/BSplineSurface.js.map +1 -1
  256. package/lib/esm/bspline/Bezier1dNd.js.map +1 -1
  257. package/lib/esm/bspline/BezierCurve3d.js.map +1 -1
  258. package/lib/esm/bspline/BezierCurve3dH.js.map +1 -1
  259. package/lib/esm/bspline/BezierCurveBase.js.map +1 -1
  260. package/lib/esm/bspline/InterpolationCurve3d.js.map +1 -1
  261. package/lib/esm/bspline/KnotVector.js.map +1 -1
  262. package/lib/esm/bspline/SurfaceLocationDetail.js.map +1 -1
  263. package/lib/esm/clipping/AlternatingConvexClipTree.js.map +1 -1
  264. package/lib/esm/clipping/BooleanClipFactory.js.map +1 -1
  265. package/lib/esm/clipping/BooleanClipNode.js.map +1 -1
  266. package/lib/esm/clipping/ClipPlane.d.ts +10 -3
  267. package/lib/esm/clipping/ClipPlane.d.ts.map +1 -1
  268. package/lib/esm/clipping/ClipPlane.js +9 -2
  269. package/lib/esm/clipping/ClipPlane.js.map +1 -1
  270. package/lib/esm/clipping/ClipPrimitive.js.map +1 -1
  271. package/lib/esm/clipping/ClipUtils.js.map +1 -1
  272. package/lib/esm/clipping/ClipVector.js.map +1 -1
  273. package/lib/esm/clipping/ConvexClipPlaneSet.d.ts +12 -9
  274. package/lib/esm/clipping/ConvexClipPlaneSet.d.ts.map +1 -1
  275. package/lib/esm/clipping/ConvexClipPlaneSet.js +17 -12
  276. package/lib/esm/clipping/ConvexClipPlaneSet.js.map +1 -1
  277. package/lib/esm/clipping/UnionOfConvexClipPlaneSets.d.ts +20 -3
  278. package/lib/esm/clipping/UnionOfConvexClipPlaneSets.d.ts.map +1 -1
  279. package/lib/esm/clipping/UnionOfConvexClipPlaneSets.js +22 -5
  280. package/lib/esm/clipping/UnionOfConvexClipPlaneSets.js.map +1 -1
  281. package/lib/esm/clipping/internalContexts/LineStringOffsetClipperContext.js.map +1 -1
  282. package/lib/esm/core-geometry.js.map +1 -1
  283. package/lib/esm/curve/Arc3d.js.map +1 -1
  284. package/lib/esm/curve/ConstructCurveBetweenCurves.js.map +1 -1
  285. package/lib/esm/curve/CoordinateXYZ.js.map +1 -1
  286. package/lib/esm/curve/CurveChainWithDistanceIndex.js.map +1 -1
  287. package/lib/esm/curve/CurveCollection.js.map +1 -1
  288. package/lib/esm/curve/CurveCurve.js.map +1 -1
  289. package/lib/esm/curve/CurveExtendMode.js.map +1 -1
  290. package/lib/esm/curve/CurveFactory.js.map +1 -1
  291. package/lib/esm/curve/CurveLocationDetail.js.map +1 -1
  292. package/lib/esm/curve/CurveOps.js.map +1 -1
  293. package/lib/esm/curve/CurvePrimitive.js.map +1 -1
  294. package/lib/esm/curve/CurveProcessor.js.map +1 -1
  295. package/lib/esm/curve/CurveTypes.js.map +1 -1
  296. package/lib/esm/curve/CurveWireMomentsXYZ.js.map +1 -1
  297. package/lib/esm/curve/GeometryQuery.js.map +1 -1
  298. package/lib/esm/curve/LineSegment3d.js.map +1 -1
  299. package/lib/esm/curve/LineString3d.js.map +1 -1
  300. package/lib/esm/curve/Loop.js.map +1 -1
  301. package/lib/esm/curve/OffsetOptions.js.map +1 -1
  302. package/lib/esm/curve/ParityRegion.js.map +1 -1
  303. package/lib/esm/curve/Path.js.map +1 -1
  304. package/lib/esm/curve/PointString3d.js.map +1 -1
  305. package/lib/esm/curve/ProxyCurve.js.map +1 -1
  306. package/lib/esm/curve/Query/ConsolidateAdjacentPrimitivesContext.js.map +1 -1
  307. package/lib/esm/curve/Query/CurveSplitContext.js.map +1 -1
  308. package/lib/esm/curve/Query/CylindricalRange.js.map +1 -1
  309. package/lib/esm/curve/Query/InOutTests.js.map +1 -1
  310. package/lib/esm/curve/Query/PlanarSubdivision.js.map +1 -1
  311. package/lib/esm/curve/Query/StrokeCountChain.js.map +1 -1
  312. package/lib/esm/curve/Query/StrokeCountMap.js.map +1 -1
  313. package/lib/esm/curve/RegionMomentsXY.js.map +1 -1
  314. package/lib/esm/curve/RegionOps.js.map +1 -1
  315. package/lib/esm/curve/RegionOpsClassificationSweeps.js.map +1 -1
  316. package/lib/esm/curve/StrokeOptions.js.map +1 -1
  317. package/lib/esm/curve/UnionRegion.js.map +1 -1
  318. package/lib/esm/curve/internalContexts/AnnounceTangentStrokeHandler.js.map +1 -1
  319. package/lib/esm/curve/internalContexts/AppendPlaneIntersectionStrokeHandler.js.map +1 -1
  320. package/lib/esm/curve/internalContexts/ChainCollectorContext.js.map +1 -1
  321. package/lib/esm/curve/internalContexts/CloneCurvesContext.js.map +1 -1
  322. package/lib/esm/curve/internalContexts/CloneWithExpandedLineStrings.js.map +1 -1
  323. package/lib/esm/curve/internalContexts/ClosestPointStrokeHandler.js.map +1 -1
  324. package/lib/esm/curve/internalContexts/CountLinearPartsSearchContext.js.map +1 -1
  325. package/lib/esm/curve/internalContexts/CurveCurveCloseApproachXY.js.map +1 -1
  326. package/lib/esm/curve/internalContexts/CurveCurveIntersectXY.js.map +1 -1
  327. package/lib/esm/curve/internalContexts/CurveCurveIntersectXYZ.js.map +1 -1
  328. package/lib/esm/curve/internalContexts/CurveLengthContext.js.map +1 -1
  329. package/lib/esm/curve/internalContexts/CurveOffsetXYHandler.js.map +1 -1
  330. package/lib/esm/curve/internalContexts/EllipticalArcApproximationContext.js.map +1 -1
  331. package/lib/esm/curve/internalContexts/GapSearchContext.js.map +1 -1
  332. package/lib/esm/curve/internalContexts/MultiChainCollector.js.map +1 -1
  333. package/lib/esm/curve/internalContexts/NewtonRtoRStrokeHandler.js.map +1 -1
  334. package/lib/esm/curve/internalContexts/PlaneAltitudeRangeContext.js.map +1 -1
  335. package/lib/esm/curve/internalContexts/PolygonOffsetContext.d.ts.map +1 -1
  336. package/lib/esm/curve/internalContexts/PolygonOffsetContext.js +30 -50
  337. package/lib/esm/curve/internalContexts/PolygonOffsetContext.js.map +1 -1
  338. package/lib/esm/curve/internalContexts/SumLengthsContext.js.map +1 -1
  339. package/lib/esm/curve/internalContexts/TransferWithSplitArcs.js.map +1 -1
  340. package/lib/esm/curve/internalContexts/TransformInPlaceContext.js.map +1 -1
  341. package/lib/esm/curve/spiral/AustralianRailCorpXYEvaluator.js.map +1 -1
  342. package/lib/esm/curve/spiral/ClothoidSeries.js.map +1 -1
  343. package/lib/esm/curve/spiral/CubicEvaluator.js.map +1 -1
  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.js.map +1 -1
  347. package/lib/esm/curve/spiral/IntegratedSpiral3d.js.map +1 -1
  348. package/lib/esm/curve/spiral/MXCubicAlongArcSpiralEvaluator.js.map +1 -1
  349. package/lib/esm/curve/spiral/NormalizedTransition.js.map +1 -1
  350. package/lib/esm/curve/spiral/PolishCubicSpiralEvaluator.js.map +1 -1
  351. package/lib/esm/curve/spiral/TransitionConditionalProperties.js.map +1 -1
  352. package/lib/esm/curve/spiral/TransitionSpiral3d.js.map +1 -1
  353. package/lib/esm/curve/spiral/XYCurveEvaluator.js.map +1 -1
  354. package/lib/esm/geometry3d/Angle.js.map +1 -1
  355. package/lib/esm/geometry3d/AngleSweep.js.map +1 -1
  356. package/lib/esm/geometry3d/BarycentricTriangle.js.map +1 -1
  357. package/lib/esm/geometry3d/BilinearPatch.js.map +1 -1
  358. package/lib/esm/geometry3d/CoincidentGeometryOps.js.map +1 -1
  359. package/lib/esm/geometry3d/Ellipsoid.js.map +1 -1
  360. package/lib/esm/geometry3d/FrameBuilder.js.map +1 -1
  361. package/lib/esm/geometry3d/FrustumAnimation.js.map +1 -1
  362. package/lib/esm/geometry3d/GeometryHandler.js.map +1 -1
  363. package/lib/esm/geometry3d/GrowableBlockedArray.js.map +1 -1
  364. package/lib/esm/geometry3d/GrowableFloat64Array.js.map +1 -1
  365. package/lib/esm/geometry3d/GrowableXYArray.js.map +1 -1
  366. package/lib/esm/geometry3d/GrowableXYZArray.js.map +1 -1
  367. package/lib/esm/geometry3d/IndexedCollectionInterval.js.map +1 -1
  368. package/lib/esm/geometry3d/IndexedXYCollection.js.map +1 -1
  369. package/lib/esm/geometry3d/IndexedXYZCollection.js.map +1 -1
  370. package/lib/esm/geometry3d/LongitudeLatitudeAltitude.js.map +1 -1
  371. package/lib/esm/geometry3d/Matrix3d.js.map +1 -1
  372. package/lib/esm/geometry3d/OrderedRotationAngles.js.map +1 -1
  373. package/lib/esm/geometry3d/Plane3d.js.map +1 -1
  374. package/lib/esm/geometry3d/Plane3dByOriginAndUnitNormal.js.map +1 -1
  375. package/lib/esm/geometry3d/Plane3dByOriginAndVectors.js.map +1 -1
  376. package/lib/esm/geometry3d/Point2dArrayCarrier.js.map +1 -1
  377. package/lib/esm/geometry3d/Point2dVector2d.js.map +1 -1
  378. package/lib/esm/geometry3d/Point3dArrayCarrier.js.map +1 -1
  379. package/lib/esm/geometry3d/Point3dVector3d.js.map +1 -1
  380. package/lib/esm/geometry3d/PointHelpers.js.map +1 -1
  381. package/lib/esm/geometry3d/PointStreaming.js.map +1 -1
  382. package/lib/esm/geometry3d/PolygonOps.d.ts +18 -9
  383. package/lib/esm/geometry3d/PolygonOps.d.ts.map +1 -1
  384. package/lib/esm/geometry3d/PolygonOps.js +53 -26
  385. package/lib/esm/geometry3d/PolygonOps.js.map +1 -1
  386. package/lib/esm/geometry3d/PolylineCompressionByEdgeOffset.js.map +1 -1
  387. package/lib/esm/geometry3d/PolylineOps.js.map +1 -1
  388. package/lib/esm/geometry3d/Range.js.map +1 -1
  389. package/lib/esm/geometry3d/Ray2d.js.map +1 -1
  390. package/lib/esm/geometry3d/Ray3d.js.map +1 -1
  391. package/lib/esm/geometry3d/ReusableObjectCache.js.map +1 -1
  392. package/lib/esm/geometry3d/Segment1d.js.map +1 -1
  393. package/lib/esm/geometry3d/SortablePolygon.js.map +1 -1
  394. package/lib/esm/geometry3d/Transform.js.map +1 -1
  395. package/lib/esm/geometry3d/UVSurfaceOps.js.map +1 -1
  396. package/lib/esm/geometry3d/XYZProps.js.map +1 -1
  397. package/lib/esm/geometry3d/YawPitchRollAngles.js.map +1 -1
  398. package/lib/esm/geometry4d/Map4d.js.map +1 -1
  399. package/lib/esm/geometry4d/Matrix4d.d.ts +16 -0
  400. package/lib/esm/geometry4d/Matrix4d.d.ts.map +1 -1
  401. package/lib/esm/geometry4d/Matrix4d.js +26 -0
  402. package/lib/esm/geometry4d/Matrix4d.js.map +1 -1
  403. package/lib/esm/geometry4d/MomentData.js.map +1 -1
  404. package/lib/esm/geometry4d/PlaneByOriginAndVectors4d.js.map +1 -1
  405. package/lib/esm/geometry4d/Point4d.js.map +1 -1
  406. package/lib/esm/numerics/BandedSystem.js.map +1 -1
  407. package/lib/esm/numerics/BezierPolynomials.js.map +1 -1
  408. package/lib/esm/numerics/ClusterableArray.js.map +1 -1
  409. package/lib/esm/numerics/Complex.js.map +1 -1
  410. package/lib/esm/numerics/ConvexPolygon2d.js.map +1 -1
  411. package/lib/esm/numerics/Newton.js.map +1 -1
  412. package/lib/esm/numerics/PascalCoefficients.js.map +1 -1
  413. package/lib/esm/numerics/PolarData.js.map +1 -1
  414. package/lib/esm/numerics/Polynomials.js.map +1 -1
  415. package/lib/esm/numerics/Quadrature.js.map +1 -1
  416. package/lib/esm/numerics/Range1dArray.js.map +1 -1
  417. package/lib/esm/numerics/SmallSystem.js.map +1 -1
  418. package/lib/esm/numerics/TriDiagonalSystem.js.map +1 -1
  419. package/lib/esm/numerics/UnionFind.js.map +1 -1
  420. package/lib/esm/numerics/UsageSums.js.map +1 -1
  421. package/lib/esm/polyface/AuxData.js.map +1 -1
  422. package/lib/esm/polyface/BoxTopology.js.map +1 -1
  423. package/lib/esm/polyface/FacetFaceData.js.map +1 -1
  424. package/lib/esm/polyface/FacetLocationDetail.js.map +1 -1
  425. package/lib/esm/polyface/FacetOrientation.js.map +1 -1
  426. package/lib/esm/polyface/GreedyTriangulationBetweenLineStrings.js.map +1 -1
  427. package/lib/esm/polyface/IndexedEdgeMatcher.js.map +1 -1
  428. package/lib/esm/polyface/IndexedPolyfaceVisitor.js.map +1 -1
  429. package/lib/esm/polyface/IndexedPolyfaceWalker.js.map +1 -1
  430. package/lib/esm/polyface/Polyface.d.ts +1 -3
  431. package/lib/esm/polyface/Polyface.d.ts.map +1 -1
  432. package/lib/esm/polyface/Polyface.js +2 -6
  433. package/lib/esm/polyface/Polyface.js.map +1 -1
  434. package/lib/esm/polyface/PolyfaceBuilder.js.map +1 -1
  435. package/lib/esm/polyface/PolyfaceClip.js.map +1 -1
  436. package/lib/esm/polyface/PolyfaceData.d.ts +2 -0
  437. package/lib/esm/polyface/PolyfaceData.d.ts.map +1 -1
  438. package/lib/esm/polyface/PolyfaceData.js +7 -3
  439. package/lib/esm/polyface/PolyfaceData.js.map +1 -1
  440. package/lib/esm/polyface/PolyfaceQuery.js.map +1 -1
  441. package/lib/esm/polyface/RangeLengthData.js.map +1 -1
  442. package/lib/esm/polyface/RangeTree/LineString3dRangeTreeContext.js.map +1 -1
  443. package/lib/esm/polyface/RangeTree/MinimumValueTester.js.map +1 -1
  444. package/lib/esm/polyface/RangeTree/Point3dArrayRangeTreeContext.js.map +1 -1
  445. package/lib/esm/polyface/RangeTree/PolyfaceRangeTreeContext.js.map +1 -1
  446. package/lib/esm/polyface/RangeTree/RangeTreeNode.js.map +1 -1
  447. package/lib/esm/polyface/RangeTree/RangeTreeSearchHandlers.js.map +1 -1
  448. package/lib/esm/polyface/TaggedNumericData.js.map +1 -1
  449. package/lib/esm/polyface/TriangleCandidate.js.map +1 -1
  450. package/lib/esm/polyface/multiclip/BuildAverageNormalsContext.js.map +1 -1
  451. package/lib/esm/polyface/multiclip/GriddedRaggedRange2dSet.js.map +1 -1
  452. package/lib/esm/polyface/multiclip/GriddedRaggedRange2dSetWithOverflow.js.map +1 -1
  453. package/lib/esm/polyface/multiclip/LinearSearchRange2dArray.js.map +1 -1
  454. package/lib/esm/polyface/multiclip/OffsetMeshContext.js.map +1 -1
  455. package/lib/esm/polyface/multiclip/Range2dSearchInterface.js.map +1 -1
  456. package/lib/esm/polyface/multiclip/RangeSearch.js.map +1 -1
  457. package/lib/esm/polyface/multiclip/SweepLineStringToFacetContext.js.map +1 -1
  458. package/lib/esm/polyface/multiclip/XYPointBuckets.js.map +1 -1
  459. package/lib/esm/serialization/BGFBAccessors.js.map +1 -1
  460. package/lib/esm/serialization/BGFBReader.js.map +1 -1
  461. package/lib/esm/serialization/BGFBWriter.js.map +1 -1
  462. package/lib/esm/serialization/BentleyGeometryFlatBuffer.js.map +1 -1
  463. package/lib/esm/serialization/DeepCompare.js.map +1 -1
  464. package/lib/esm/serialization/GeometrySamples.js.map +1 -1
  465. package/lib/esm/serialization/IModelJsonSchema.js.map +1 -1
  466. package/lib/esm/serialization/SerializationHelpers.js.map +1 -1
  467. package/lib/esm/solid/Box.js.map +1 -1
  468. package/lib/esm/solid/Cone.js.map +1 -1
  469. package/lib/esm/solid/LinearSweep.js.map +1 -1
  470. package/lib/esm/solid/RotationalSweep.js.map +1 -1
  471. package/lib/esm/solid/RuledSweep.js.map +1 -1
  472. package/lib/esm/solid/SolidPrimitive.js.map +1 -1
  473. package/lib/esm/solid/Sphere.js.map +1 -1
  474. package/lib/esm/solid/SweepContour.js.map +1 -1
  475. package/lib/esm/solid/TorusPipe.js.map +1 -1
  476. package/lib/esm/topology/ChainMerge.js.map +1 -1
  477. package/lib/esm/topology/Graph.js.map +1 -1
  478. package/lib/esm/topology/HalfEdgeGraphFromIndexedLoopsContext.js.map +1 -1
  479. package/lib/esm/topology/HalfEdgeGraphSearch.js.map +1 -1
  480. package/lib/esm/topology/HalfEdgeGraphSpineContext.js.map +1 -1
  481. package/lib/esm/topology/HalfEdgeGraphValidation.js.map +1 -1
  482. package/lib/esm/topology/HalfEdgeMarkSet.js.map +1 -1
  483. package/lib/esm/topology/HalfEdgeNodeXYZUV.js.map +1 -1
  484. package/lib/esm/topology/HalfEdgePointInGraphSearch.js.map +1 -1
  485. package/lib/esm/topology/HalfEdgePositionDetail.js.map +1 -1
  486. package/lib/esm/topology/HalfEdgePriorityQueue.js.map +1 -1
  487. package/lib/esm/topology/InsertAndRetriangulateContext.js.map +1 -1
  488. package/lib/esm/topology/MaskManager.js.map +1 -1
  489. package/lib/esm/topology/Merging.js.map +1 -1
  490. package/lib/esm/topology/RegularizeFace.js.map +1 -1
  491. package/lib/esm/topology/SignedDataSummary.js.map +1 -1
  492. package/lib/esm/topology/SpaceTriangulation.js.map +1 -1
  493. package/lib/esm/topology/Triangulation.js.map +1 -1
  494. package/lib/esm/topology/XYParitySearchContext.js.map +1 -1
  495. package/package.json +3 -3
@@ -1 +1 @@
1
- {"version":3,"file":"ClothoidSeries.js","sourceRoot":"","sources":["../../../../src/curve/spiral/ClothoidSeries.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAE/F;;GAEG;AAEH,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAC1C,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACtD,OAAO,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AACrD;;;;;;;GAOG;AACH,MAAM,OAAO,yBAA0B,SAAQ,gBAAgB;IACtD,SAAS,CAAS;IAClB,SAAS,CAAS;IAClB,cAAc,CAAS;IACvB,cAAc,CAAS;IAC9B,YAAmB,cAAsB,EAAE,cAAsB,EAAE,YAAoB,CAAC,EAAE,YAAoB,CAAC;QAC7G,KAAK,EAAE,CAAC;QACR,IAAI,CAAC,cAAc,GAAG,cAAc,CAAC;QACrC,IAAI,CAAC,cAAc,GAAG,cAAc,CAAC;QACrC,IAAI,CAAC,SAAS,GAAG,SAAS,CAAC;QAC3B,IAAI,CAAC,SAAS,GAAG,SAAS,CAAC;IAC7B,CAAC;IACD,2BAA2B;IACpB,KAAK;QACV,OAAO,IAAI,yBAAyB,CAAC,IAAI,CAAC,cAAc,EAAE,IAAI,CAAC,cAAc,EAAE,IAAI,CAAC,SAAS,EAAE,IAAI,CAAC,SAAS,CAAC,CAAC;IACjH,CAAC;IACM,YAAY,CAAC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nC,eAAe;QACf,iFAAiF;QACjF,MAAM,CAAC,GAAG,QAAQ,GAAG,IAAI,CAAC,cAAc,CAAC;QACzC,MAAM,MAAM,GAAG,GAAG,GAAG,IAAI,CAAC,cAAc,GAAG,CAAC,CAAC;QAC7C,MAAM,OAAO,GAAG,GAAG,GAAG,IAAI,CAAC,cAAc,CAAC;QAC1C,oCAAoC;QACpC,6FAA6F;QAC7F,wEAAwE;QACxE,MAAM,MAAM,GAAG,IAAI,CAAC,cAAc,CAAC,QAAQ,EAAE,IAAI,CAAC,SAAS,CAAC,CAAC;QAC7D,MAAM,IAAI,GAAG,IAAI,CAAC,cAAc,CAAC,QAAQ,EAAE,IAAI,CAAC,SAAS,GAAG,CAAC,CAAC,CAAC;QAC/D,OAAO,CAAC,CAAC,IAAI,GAAG,MAAM,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,CAAC,GAAG,IAAI,CAAC,cAAc,GAAG,IAAI,CAAC,cAAc,CAAC;IAClG,CAAC;IAEM,WAAW,CAAC,CAAS;QAC1B,MAAM,SAAS,GAAG,CAAC,GAAG,IAAI,CAAC,cAAc,CAAC;QAC1C,MAAM,SAAS,GAAG,YAAY,CAAC,WAAW,CAAC,SAAS,EAClD,CAAC,CAAS,EAAE,EAAE,CAAC,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,EACxC,CAAC,CAAS,EAAE,EAAE,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC,CAAC;QACvC,IAAI,SAAS,KAAK,SAAS;YACzB,OAAO,SAAS,CAAC;QACnB,OAAO,SAAS,CAAC;IACnB,CAAC;CACF","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n\r\n/** @packageDocumentation\r\n * @module Curve\r\n */\r\n\r\nimport { Geometry } from \"../../Geometry\";\r\nimport { XYCurveEvaluator } from \"./XYCurveEvaluator\";\r\nimport { SimpleNewton } from \"../../numerics/Newton\";\r\n/**\r\n * Methods to evaluate caller-specified number of terms of the x and y series for a clothoid.\r\n * Each instance has\r\n * * Number of x and y terms to use.\r\n * * constant for theta=c * x * x\r\n * * This value is c=1/(2 R L) for curve length L measured from inflection to point with radius R.\r\n * @internal\r\n */\r\nexport class ClothoidSeriesRLEvaluator extends XYCurveEvaluator {\r\n public numXTerms: number;\r\n public numYTerms: number;\r\n public constantDiv2LR: number;\r\n public nominalLength1: number;\r\n public constructor(nominalLength1: number, constantDiv2LR: number, numXTerms: number = 4, numYTerms: number = 4) {\r\n super();\r\n this.nominalLength1 = nominalLength1;\r\n this.constantDiv2LR = constantDiv2LR;\r\n this.numXTerms = numXTerms;\r\n this.numYTerms = numYTerms;\r\n }\r\n /** Return a deep clone. */\r\n public clone(): ClothoidSeriesRLEvaluator {\r\n return new ClothoidSeriesRLEvaluator(this.nominalLength1, this.constantDiv2LR, this.numXTerms, this.numYTerms);\r\n }\r\n public scaleInPlace(scaleFactor: number) {\r\n this.nominalLength1 *= scaleFactor;\r\n this.constantDiv2LR /= (scaleFactor * scaleFactor);\r\n }\r\n /** Member by member matchup ... */\r\n public isAlmostEqual(other: any): boolean {\r\n if (other instanceof ClothoidSeriesRLEvaluator) {\r\n return this.numXTerms === other.numXTerms\r\n && this.numYTerms === other.numYTerms\r\n && Geometry.isAlmostEqualNumber(this.constantDiv2LR, other.constantDiv2LR)\r\n && Geometry.isSameCoordinate(this.nominalLength1, other.nominalLength1);\r\n }\r\n return false;\r\n }\r\n /**\r\n * Evaluate the X series at a nominal distance along the curve.\r\n * @param fraction fractional position along the curve.\r\n */\r\n public fractionToX(fraction: number): number { return this.fractionToXGo(fraction, this.numXTerms); }\r\n /**\r\n * Evaluate the Y series at a nominal distance along the curve.\r\n * @param fraction fractional position along the curve.\r\n */\r\n public fractionToY(fraction: number): number { return this.fractionToYGo(fraction, this.numYTerms); }\r\n\r\n /**\r\n * Evaluate the derivative of the X series at a nominal distance along the curve.\r\n * @param fraction fractional position along the curve.\r\n */\r\n public fractionToDX(fraction: number): number { return this.fractionToDXGo(fraction, this.numXTerms); }\r\n /**\r\n * Evaluate the derivative of the Y series at a nominal distance along the curve.\r\n * @param fraction fractional position along the curve.\r\n */\r\n public fractionToDY(fraction: number): number { return this.fractionToDYGo(fraction, this.numYTerms); }\r\n\r\n /**\r\n * Evaluate the derivative of the X series at a nominal distance along the curve.\r\n * @param fraction fractional position along the curve.\r\n */\r\n public fractionToDDX(fraction: number): number { return this.fractionToDDXGo(fraction, this.numXTerms); }\r\n /**\r\n * Evaluate the derivative of the Y series at a nominal distance along the curve.\r\n * @param fraction fractional position along the curve.\r\n */\r\n public fractionToDDY(fraction: number): number { return this.fractionToDDYGo(fraction, this.numYTerms); }\r\n\r\n /**\r\n * Evaluate the X series at a nominal distance along the curve.\r\n * @param fraction fractional position along the curve.\r\n * @param numTerms number of terms to use.\r\n */\r\n public fractionToXGo(fraction: number, numTerms: number): number {\r\n // Write the series for cos (theta)\r\n // replace theta by s*s*c\r\n // integrate wrt s\r\n // x = s - s^5 c^4/ 2 + s^9 c^8/(4!) - s^13 c^12 / 6!\r\n // x = s(1 - (s^4 c^2/2) ( 1/5 -s^4 c^2 / (3*4) ( 1/9 - ....) ) )\r\n const s = fraction * this.nominalLength1;\r\n let result = s;\r\n if (numTerms < 2)\r\n return result;\r\n const q1 = s * s * this.constantDiv2LR;\r\n const beta = - q1 * q1;\r\n let alpha = s;\r\n let m = 1;\r\n let n = 5;\r\n for (let i = 1; i < numTerms; i++) {\r\n alpha *= beta / (m * (m + 1));\r\n result += alpha / n;\r\n m += 2;\r\n n += 4;\r\n }\r\n return result;\r\n }\r\n public fractionToYGo(fraction: number, numTerms: number): number {\r\n // Write the series for sin (theta)\r\n // replace theta by s*s*c\r\n // integrate wrt s\r\n // x = s^3 c^2/ 3( (1/3)) - s^7 c^6/(3!) ((1/7)) - s^11 c^10 / 5! ((1/9) - ...)\r\n const s = fraction * this.nominalLength1;\r\n const q1 = s * s * this.constantDiv2LR;\r\n let result = q1 * s / 3;\r\n if (numTerms < 2)\r\n return result;\r\n const beta = - q1 * q1;\r\n let alpha = q1 * s;\r\n let m = 2;\r\n let n = 7;\r\n for (let i = 1; i < numTerms; i++) {\r\n alpha *= beta / (m * (m + 1));\r\n result += alpha / n;\r\n m += 2;\r\n n += 4;\r\n }\r\n return result;\r\n }\r\n public fractionToDXGo(fraction: number, numTerms: number): number {\r\n // Yes -- this does happen during derivatives of cosines with more than 0 terms !!\r\n if (numTerms <= 0)\r\n return 0;\r\n // dX = 1 - s^4c^2/2 + s^8 c^4 / 4! -\r\n // new Term = old Term * beta / (m(m+1))\r\n const s = fraction * this.nominalLength1;\r\n let result = 1;\r\n if (numTerms < 2) {\r\n return result * this.nominalLength1;\r\n }\r\n const q1 = s * s * this.constantDiv2LR;\r\n const beta = - q1 * q1;\r\n let alpha = 1.0;\r\n let m = 1;\r\n for (let i = 1; i < numTerms; i++) {\r\n alpha *= beta / (m * (m + 1));\r\n result += alpha;\r\n m += 2;\r\n }\r\n return result * this.nominalLength1;\r\n }\r\n public fractionToDYGo(fraction: number, numTerms: number): number {\r\n if (numTerms <= 0)\r\n return 0;\r\n // dY = q - q^3/3!\r\n // q = s^2 c\r\n // dY = s^2 c - s^6 c^3/3! + s^10 c^5/ 5!\r\n // recurrence advancing m by 2 alpha *= -(s^4 c^2) / (m(m+1))\r\n const s = fraction * this.nominalLength1;\r\n const q1 = s * s * this.constantDiv2LR;\r\n let result = q1;\r\n if (numTerms < 2)\r\n return result * this.nominalLength1;\r\n const beta = - q1 * q1;\r\n let alpha = q1;\r\n let m = 2;\r\n for (let i = 1; i < numTerms; i++) {\r\n alpha *= beta / (m * (m + 1));\r\n result += alpha;\r\n m += 2;\r\n }\r\n return result * this.nominalLength1;\r\n }\r\n\r\n public fractionToDDXGo(fraction: number, numTerms: number): number {\r\n // DX is \"cosine\"\r\n // DDX is \"- sine\" series times chain rule dTheta/ds = 2 * s * this.constantDivLR\r\n const s = fraction * this.nominalLength1;\r\n\r\n const dTheta = 2 * this.constantDiv2LR * s;\r\n const sine = this.fractionToDYGo(fraction, numTerms - 1);\r\n const resultA = (- dTheta * sine * this.nominalLength1);\r\n return resultA;\r\n }\r\n public fractionToDDYGo(fraction: number, numTerms: number): number {\r\n // DY is \"sine\"\r\n // DDY is \"cosine\" series times chain rule dTheta/ds = 2 * s * this.constantDivLR\r\n // BUT .... derivative of the cosine series leading term is zero ... use one less term!\r\n const s = fraction * this.nominalLength1;\r\n const dTheta = 2 * this.constantDiv2LR * s;\r\n const cosine = this.fractionToDXGo(fraction, numTerms);\r\n return cosine * dTheta * this.nominalLength1;\r\n }\r\n\r\n public fractionToD3X(fraction: number): number {\r\n if (this.numXTerms <= 1)\r\n return 0.0;\r\n // DX is \"cosine\"\r\n // DDX is \"- sine\" series times chain rule dTheta/ds = 2 * s * this.constantDivLR\r\n const s = fraction * this.nominalLength1;\r\n const dTheta = 2.0 * this.constantDiv2LR * s;\r\n const d2Theta = 2.0 * this.constantDiv2LR;\r\n const sine = this.fractionToDYGo(fraction, this.numXTerms - 1);\r\n const cosine = this.fractionToDXGo(fraction, this.numXTerms - 1);\r\n return (- cosine * dTheta * dTheta - sine * d2Theta) * this.nominalLength1 * this.nominalLength1;\r\n }\r\n public fractionToD3Y(fraction: number): number {\r\n // DY is \"sine\"\r\n // DDY is \"cosine\" series times chain rule dTheta/ds = 2 * s * this.constantDivLR\r\n const s = fraction * this.nominalLength1;\r\n const dTheta = 2.0 * this.constantDiv2LR * s;\r\n const d2Theta = 2.0 * this.constantDiv2LR;\r\n // dY is sine series with numYTerms.\r\n // ddY is cosine series. Leading term of sine series is non-constant, so numYTerms here also\r\n // d3Y is sine series. Derivative of preceding cosine killed first term.\r\n const cosine = this.fractionToDXGo(fraction, this.numYTerms);\r\n const sine = this.fractionToDYGo(fraction, this.numYTerms - 1);\r\n return (-sine * dTheta * dTheta + cosine * d2Theta) * this.nominalLength1 * this.nominalLength1;\r\n }\r\n\r\n public xToFraction(x: number): number | undefined {\r\n const fraction0 = x / this.nominalLength1;\r\n const fraction1 = SimpleNewton.runNewton1D(fraction0,\r\n (f: number) => (this.fractionToX(f) - x),\r\n (f: number) => this.fractionToDX(f));\r\n if (fraction1 === undefined)\r\n return undefined;\r\n return fraction1;\r\n }\r\n}\r\n"]}
1
+ {"version":3,"file":"ClothoidSeries.js","sourceRoot":"","sources":["../../../../src/curve/spiral/ClothoidSeries.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAE/F;;GAEG;AAEH,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAC1C,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACtD,OAAO,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AACrD;;;;;;;GAOG;AACH,MAAM,OAAO,yBAA0B,SAAQ,gBAAgB;IACtD,SAAS,CAAS;IAClB,SAAS,CAAS;IAClB,cAAc,CAAS;IACvB,cAAc,CAAS;IAC9B,YAAmB,cAAsB,EAAE,cAAsB,EAAE,YAAoB,CAAC,EAAE,YAAoB,CAAC;QAC7G,KAAK,EAAE,CAAC;QACR,IAAI,CAAC,cAAc,GAAG,cAAc,CAAC;QACrC,IAAI,CAAC,cAAc,GAAG,cAAc,CAAC;QACrC,IAAI,CAAC,SAAS,GAAG,SAAS,CAAC;QAC3B,IAAI,CAAC,SAAS,GAAG,SAAS,CAAC;IAC7B,CAAC;IACD,2BAA2B;IACpB,KAAK;QACV,OAAO,IAAI,yBAAyB,CAAC,IAAI,CAAC,cAAc,EAAE,IAAI,CAAC,cAAc,EAAE,IAAI,CAAC,SAAS,EAAE,IAAI,CAAC,SAAS,CAAC,CAAC;IACjH,CAAC;IACM,YAAY,CAAC,WAAmB;QACrC,IAAI,CAAC,cAAc,IAAI,WAAW,CAAC;QACnC,IAAI,CAAC,cAAc,IAAI,CAAC,WAAW,GAAG,WA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,GAAG,GAAG,GAAG,IAAI,CAAC,cAAc,GAAG,CAAC,CAAC;QAC7C,MAAM,OAAO,GAAG,GAAG,GAAG,IAAI,CAAC,cAAc,CAAC;QAC1C,oCAAoC;QACpC,6FAA6F;QAC7F,wEAAwE;QACxE,MAAM,MAAM,GAAG,IAAI,CAAC,cAAc,CAAC,QAAQ,EAAE,IAAI,CAAC,SAAS,CAAC,CAAC;QAC7D,MAAM,IAAI,GAAG,IAAI,CAAC,cAAc,CAAC,QAAQ,EAAE,IAAI,CAAC,SAAS,GAAG,CAAC,CAAC,CAAC;QAC/D,OAAO,CAAC,CAAC,IAAI,GAAG,MAAM,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,CAAC,GAAG,IAAI,CAAC,cAAc,GAAG,IAAI,CAAC,cAAc,CAAC;IAClG,CAAC;IAEM,WAAW,CAAC,CAAS;QAC1B,MAAM,SAAS,GAAG,CAAC,GAAG,IAAI,CAAC,cAAc,CAAC;QAC1C,MAAM,SAAS,GAAG,YAAY,CAAC,WAAW,CAAC,SAAS,EAClD,CAAC,CAAS,EAAE,EAAE,CAAC,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,EACxC,CAAC,CAAS,EAAE,EAAE,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC,CAAC;QACvC,IAAI,SAAS,KAAK,SAAS;YACzB,OAAO,SAAS,CAAC;QACnB,OAAO,SAAS,CAAC;IACnB,CAAC;CACF","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n\n/** @packageDocumentation\n * @module Curve\n */\n\nimport { Geometry } from \"../../Geometry\";\nimport { XYCurveEvaluator } from \"./XYCurveEvaluator\";\nimport { SimpleNewton } from \"../../numerics/Newton\";\n/**\n * Methods to evaluate caller-specified number of terms of the x and y series for a clothoid.\n * Each instance has\n * * Number of x and y terms to use.\n * * constant for theta=c * x * x\n * * This value is c=1/(2 R L) for curve length L measured from inflection to point with radius R.\n * @internal\n */\nexport class ClothoidSeriesRLEvaluator extends XYCurveEvaluator {\n public numXTerms: number;\n public numYTerms: number;\n public constantDiv2LR: number;\n public nominalLength1: number;\n public constructor(nominalLength1: number, constantDiv2LR: number, numXTerms: number = 4, numYTerms: number = 4) {\n super();\n this.nominalLength1 = nominalLength1;\n this.constantDiv2LR = constantDiv2LR;\n this.numXTerms = numXTerms;\n this.numYTerms = numYTerms;\n }\n /** Return a deep clone. */\n public clone(): ClothoidSeriesRLEvaluator {\n return new ClothoidSeriesRLEvaluator(this.nominalLength1, this.constantDiv2LR, this.numXTerms, this.numYTerms);\n }\n public scaleInPlace(scaleFactor: number) {\n this.nominalLength1 *= scaleFactor;\n this.constantDiv2LR /= (scaleFactor * scaleFactor);\n }\n /** Member by member matchup ... */\n public isAlmostEqual(other: any): boolean {\n if (other instanceof ClothoidSeriesRLEvaluator) {\n return this.numXTerms === other.numXTerms\n && this.numYTerms === other.numYTerms\n && Geometry.isAlmostEqualNumber(this.constantDiv2LR, other.constantDiv2LR)\n && Geometry.isSameCoordinate(this.nominalLength1, other.nominalLength1);\n }\n return false;\n }\n /**\n * Evaluate the X series at a nominal distance along the curve.\n * @param fraction fractional position along the curve.\n */\n public fractionToX(fraction: number): number { return this.fractionToXGo(fraction, this.numXTerms); }\n /**\n * Evaluate the Y series at a nominal distance along the curve.\n * @param fraction fractional position along the curve.\n */\n public fractionToY(fraction: number): number { return this.fractionToYGo(fraction, this.numYTerms); }\n\n /**\n * Evaluate the derivative of the X series at a nominal distance along the curve.\n * @param fraction fractional position along the curve.\n */\n public fractionToDX(fraction: number): number { return this.fractionToDXGo(fraction, this.numXTerms); }\n /**\n * Evaluate the derivative of the Y series at a nominal distance along the curve.\n * @param fraction fractional position along the curve.\n */\n public fractionToDY(fraction: number): number { return this.fractionToDYGo(fraction, this.numYTerms); }\n\n /**\n * Evaluate the derivative of the X series at a nominal distance along the curve.\n * @param fraction fractional position along the curve.\n */\n public fractionToDDX(fraction: number): number { return this.fractionToDDXGo(fraction, this.numXTerms); }\n /**\n * Evaluate the derivative of the Y series at a nominal distance along the curve.\n * @param fraction fractional position along the curve.\n */\n public fractionToDDY(fraction: number): number { return this.fractionToDDYGo(fraction, this.numYTerms); }\n\n /**\n * Evaluate the X series at a nominal distance along the curve.\n * @param fraction fractional position along the curve.\n * @param numTerms number of terms to use.\n */\n public fractionToXGo(fraction: number, numTerms: number): number {\n // Write the series for cos (theta)\n // replace theta by s*s*c\n // integrate wrt s\n // x = s - s^5 c^4/ 2 + s^9 c^8/(4!) - s^13 c^12 / 6!\n // x = s(1 - (s^4 c^2/2) ( 1/5 -s^4 c^2 / (3*4) ( 1/9 - ....) ) )\n const s = fraction * this.nominalLength1;\n let result = s;\n if (numTerms < 2)\n return result;\n const q1 = s * s * this.constantDiv2LR;\n const beta = - q1 * q1;\n let alpha = s;\n let m = 1;\n let n = 5;\n for (let i = 1; i < numTerms; i++) {\n alpha *= beta / (m * (m + 1));\n result += alpha / n;\n m += 2;\n n += 4;\n }\n return result;\n }\n public fractionToYGo(fraction: number, numTerms: number): number {\n // Write the series for sin (theta)\n // replace theta by s*s*c\n // integrate wrt s\n // x = s^3 c^2/ 3( (1/3)) - s^7 c^6/(3!) ((1/7)) - s^11 c^10 / 5! ((1/9) - ...)\n const s = fraction * this.nominalLength1;\n const q1 = s * s * this.constantDiv2LR;\n let result = q1 * s / 3;\n if (numTerms < 2)\n return result;\n const beta = - q1 * q1;\n let alpha = q1 * s;\n let m = 2;\n let n = 7;\n for (let i = 1; i < numTerms; i++) {\n alpha *= beta / (m * (m + 1));\n result += alpha / n;\n m += 2;\n n += 4;\n }\n return result;\n }\n public fractionToDXGo(fraction: number, numTerms: number): number {\n // Yes -- this does happen during derivatives of cosines with more than 0 terms !!\n if (numTerms <= 0)\n return 0;\n // dX = 1 - s^4c^2/2 + s^8 c^4 / 4! -\n // new Term = old Term * beta / (m(m+1))\n const s = fraction * this.nominalLength1;\n let result = 1;\n if (numTerms < 2) {\n return result * this.nominalLength1;\n }\n const q1 = s * s * this.constantDiv2LR;\n const beta = - q1 * q1;\n let alpha = 1.0;\n let m = 1;\n for (let i = 1; i < numTerms; i++) {\n alpha *= beta / (m * (m + 1));\n result += alpha;\n m += 2;\n }\n return result * this.nominalLength1;\n }\n public fractionToDYGo(fraction: number, numTerms: number): number {\n if (numTerms <= 0)\n return 0;\n // dY = q - q^3/3!\n // q = s^2 c\n // dY = s^2 c - s^6 c^3/3! + s^10 c^5/ 5!\n // recurrence advancing m by 2 alpha *= -(s^4 c^2) / (m(m+1))\n const s = fraction * this.nominalLength1;\n const q1 = s * s * this.constantDiv2LR;\n let result = q1;\n if (numTerms < 2)\n return result * this.nominalLength1;\n const beta = - q1 * q1;\n let alpha = q1;\n let m = 2;\n for (let i = 1; i < numTerms; i++) {\n alpha *= beta / (m * (m + 1));\n result += alpha;\n m += 2;\n }\n return result * this.nominalLength1;\n }\n\n public fractionToDDXGo(fraction: number, numTerms: number): number {\n // DX is \"cosine\"\n // DDX is \"- sine\" series times chain rule dTheta/ds = 2 * s * this.constantDivLR\n const s = fraction * this.nominalLength1;\n\n const dTheta = 2 * this.constantDiv2LR * s;\n const sine = this.fractionToDYGo(fraction, numTerms - 1);\n const resultA = (- dTheta * sine * this.nominalLength1);\n return resultA;\n }\n public fractionToDDYGo(fraction: number, numTerms: number): number {\n // DY is \"sine\"\n // DDY is \"cosine\" series times chain rule dTheta/ds = 2 * s * this.constantDivLR\n // BUT .... derivative of the cosine series leading term is zero ... use one less term!\n const s = fraction * this.nominalLength1;\n const dTheta = 2 * this.constantDiv2LR * s;\n const cosine = this.fractionToDXGo(fraction, numTerms);\n return cosine * dTheta * this.nominalLength1;\n }\n\n public fractionToD3X(fraction: number): number {\n if (this.numXTerms <= 1)\n return 0.0;\n // DX is \"cosine\"\n // DDX is \"- sine\" series times chain rule dTheta/ds = 2 * s * this.constantDivLR\n const s = fraction * this.nominalLength1;\n const dTheta = 2.0 * this.constantDiv2LR * s;\n const d2Theta = 2.0 * this.constantDiv2LR;\n const sine = this.fractionToDYGo(fraction, this.numXTerms - 1);\n const cosine = this.fractionToDXGo(fraction, this.numXTerms - 1);\n return (- cosine * dTheta * dTheta - sine * d2Theta) * this.nominalLength1 * this.nominalLength1;\n }\n public fractionToD3Y(fraction: number): number {\n // DY is \"sine\"\n // DDY is \"cosine\" series times chain rule dTheta/ds = 2 * s * this.constantDivLR\n const s = fraction * this.nominalLength1;\n const dTheta = 2.0 * this.constantDiv2LR * s;\n const d2Theta = 2.0 * this.constantDiv2LR;\n // dY is sine series with numYTerms.\n // ddY is cosine series. Leading term of sine series is non-constant, so numYTerms here also\n // d3Y is sine series. Derivative of preceding cosine killed first term.\n const cosine = this.fractionToDXGo(fraction, this.numYTerms);\n const sine = this.fractionToDYGo(fraction, this.numYTerms - 1);\n return (-sine * dTheta * dTheta + cosine * d2Theta) * this.nominalLength1 * this.nominalLength1;\n }\n\n public xToFraction(x: number): number | undefined {\n const fraction0 = x / this.nominalLength1;\n const fraction1 = SimpleNewton.runNewton1D(fraction0,\n (f: number) => (this.fractionToX(f) - x),\n (f: number) => this.fractionToDX(f));\n if (fraction1 === undefined)\n return undefined;\n return fraction1;\n }\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"CubicEvaluator.js","sourceRoot":"","sources":["../../../../src/curve/spiral/CubicEvaluator.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAE/F;;GAEG;AACH,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACtD;;;;GAIG;AACH,MAAM,OAAgB,cAAe,SAAQ,gBAAgB;IACjD,OAAO,CAAS;IAChB,WAAW,CAAS;IAC9B,YAAsB,UAAkB,EAAE,MAAc;QACtD,KAAK,EAAE,CAAC;QACR,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC;QACtB,IAAI,CAAC,WAAW,GAAG,UAA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aAAa,CAAC,QAAgB;QACnC,MAAM,CAAC,GAAG,QAAQ,GAAG,IAAI,CAAC,WAAW,CAAC;QACtC,OAAO,GAAG,GAAG,IAAI,CAAC,OAAO,GAAG,CAAC,GAAG,IAAI,CAAC,WAAW,GAAG,IAAI,CAAC,WAAW,CAAC;IACtE,CAAC;IACD,+DAA+D;IACxD,aAAa,CAAC,SAAiB;QACpC,OAAO,GAAG,GAAG,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC,WAAW,GAAG,IAAI,CAAC,WAAW,GAAG,IAAI,CAAC,WAAW,CAAC;IACrF,CAAC;IACD,8BAA8B;IACvB,WAAW,CAAC,CAAS,IAAY,OAAO,CAAC,GAAG,IAAI,CAAC,WAAW,CAAC,CAAC,CAAC;CACvE","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 { XYCurveEvaluator } from \"./XYCurveEvaluator\";\r\n/** Intermediate class for evaluation of bare cubic spirals `y = m ^x^3` with x axis from [0..xLength]\r\n * * This implements all the computations among fraction, x, and y.\r\n * * Derived classes implement specialized logic such as (a) precomputing `m` and (b) domain-specific fraction-to-distance approximations.\r\n * @internal\r\n */\r\nexport abstract class CubicEvaluator extends XYCurveEvaluator {\r\n protected _cubicM: number;\r\n protected _axisLength: number;\r\n protected constructor(axisLength: number, cubicM: number) {\r\n super();\r\n this._cubicM = cubicM;\r\n this._axisLength = axisLength;\r\n }\r\n /** Update both constants. */\r\n public setConstants(axisLength: number, cubicM: number) {\r\n this._axisLength = axisLength;\r\n this._cubicM = cubicM;\r\n }\r\n public get axisLength() { return this._axisLength; }\r\n public get cubicM() { return this._cubicM; }\r\n /**\r\n * Apply `scaleFactor` to the xLength and cubicM.\r\n * * Derived classes commonly call this as `super.scaleInPlace()`, and additionally apply the scale to their members.\r\n * @param scaleFactor\r\n */\r\n public scaleInPlace(scaleFactor: number) {\r\n this._axisLength *= scaleFactor;\r\n // \"x\" arriving at \"m * x^3\" will be scaled. \"m\" has to be divided by the scale to cancel 2 of the 3 . .\r\n this._cubicM /= (scaleFactor * scaleFactor);\r\n }\r\n /** Evaluate X at fraction. */\r\n public fractionToX(fraction: number): number { return fraction * this._axisLength; }\r\n /** Evaluate derivative of X with respect to fraction */\r\n public fractionToDX(_fraction: number): number { return this._axisLength; }\r\n /** Evaluate second derivative of X with respect to fraction */\r\n public fractionToDDX(_fraction: number): number { return 0.0; }\r\n /** Evaluate third derivative of X with respect to fraction */\r\n public fractionToD3X(_fraction: number): number { return 0.0; }\r\n /** Evaluate Y at fraction. */\r\n public fractionToY(fraction: number): number {\r\n const x = fraction * this._axisLength;\r\n return this._cubicM * x * x * x;\r\n }\r\n /** Evaluate derivative of Y with respect to fraction. */\r\n public fractionToDY(fraction: number): number {\r\n const x = fraction * this._axisLength;\r\n return 3.0 * this._cubicM * x * x * this._axisLength;\r\n }\r\n /** Evaluate second derivative of Y with respect to fraction. */\r\n public fractionToDDY(fraction: number): number {\r\n const x = fraction * this._axisLength;\r\n return 6.0 * this._cubicM * x * this._axisLength * this._axisLength;\r\n }\r\n /** Evaluate third derivative of Y with respect to fraction. */\r\n public fractionToD3Y(_fraction: number): number {\r\n return 6.0 * this._cubicM * this._axisLength * this._axisLength * this._axisLength;\r\n }\r\n /** Evaluate fraction at x. */\r\n public xToFraction(x: number): number { return x / this._axisLength; }\r\n}\r\n"]}
1
+ {"version":3,"file":"CubicEvaluator.js","sourceRoot":"","sources":["../../../../src/curve/spiral/CubicEvaluator.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAE/F;;GAEG;AACH,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACtD;;;;GAIG;AACH,MAAM,OAAgB,cAAe,SAAQ,gBAAgB;IACjD,OAAO,CAAS;IAChB,WAAW,CAAS;IAC9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QACtC,OAAO,GAAG,GAAG,IAAI,CAAC,OAAO,GAAG,CAAC,GAAG,CAAC,GAAG,IAAI,CAAC,WAAW,CAAC;IACvD,CAAC;IACD,gEAAgE;IACzD,aAAa,CAAC,QAAgB;QACnC,MAAM,CAAC,GAAG,QAAQ,GAAG,IAAI,CAAC,WAAW,CAAC;QACtC,OAAO,GAAG,GAAG,IAAI,CAAC,OAAO,GAAG,CAAC,GAAG,IAAI,CAAC,WAAW,GAAG,IAAI,CAAC,WAAW,CAAC;IACtE,CAAC;IACD,+DAA+D;IACxD,aAAa,CAAC,SAAiB;QACpC,OAAO,GAAG,GAAG,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC,WAAW,GAAG,IAAI,CAAC,WAAW,GAAG,IAAI,CAAC,WAAW,CAAC;IACrF,CAAC;IACD,8BAA8B;IACvB,WAAW,CAAC,CAAS,IAAY,OAAO,CAAC,GAAG,IAAI,CAAC,WAAW,CAAC,CAAC,CAAC;CACvE","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 { XYCurveEvaluator } from \"./XYCurveEvaluator\";\n/** Intermediate class for evaluation of bare cubic spirals `y = m ^x^3` with x axis from [0..xLength]\n * * This implements all the computations among fraction, x, and y.\n * * Derived classes implement specialized logic such as (a) precomputing `m` and (b) domain-specific fraction-to-distance approximations.\n * @internal\n */\nexport abstract class CubicEvaluator extends XYCurveEvaluator {\n protected _cubicM: number;\n protected _axisLength: number;\n protected constructor(axisLength: number, cubicM: number) {\n super();\n this._cubicM = cubicM;\n this._axisLength = axisLength;\n }\n /** Update both constants. */\n public setConstants(axisLength: number, cubicM: number) {\n this._axisLength = axisLength;\n this._cubicM = cubicM;\n }\n public get axisLength() { return this._axisLength; }\n public get cubicM() { return this._cubicM; }\n /**\n * Apply `scaleFactor` to the xLength and cubicM.\n * * Derived classes commonly call this as `super.scaleInPlace()`, and additionally apply the scale to their members.\n * @param scaleFactor\n */\n public scaleInPlace(scaleFactor: number) {\n this._axisLength *= scaleFactor;\n // \"x\" arriving at \"m * x^3\" will be scaled. \"m\" has to be divided by the scale to cancel 2 of the 3 . .\n this._cubicM /= (scaleFactor * scaleFactor);\n }\n /** Evaluate X at fraction. */\n public fractionToX(fraction: number): number { return fraction * this._axisLength; }\n /** Evaluate derivative of X with respect to fraction */\n public fractionToDX(_fraction: number): number { return this._axisLength; }\n /** Evaluate second derivative of X with respect to fraction */\n public fractionToDDX(_fraction: number): number { return 0.0; }\n /** Evaluate third derivative of X with respect to fraction */\n public fractionToD3X(_fraction: number): number { return 0.0; }\n /** Evaluate Y at fraction. */\n public fractionToY(fraction: number): number {\n const x = fraction * this._axisLength;\n return this._cubicM * x * x * x;\n }\n /** Evaluate derivative of Y with respect to fraction. */\n public fractionToDY(fraction: number): number {\n const x = fraction * this._axisLength;\n return 3.0 * this._cubicM * x * x * this._axisLength;\n }\n /** Evaluate second derivative of Y with respect to fraction. */\n public fractionToDDY(fraction: number): number {\n const x = fraction * this._axisLength;\n return 6.0 * this._cubicM * x * this._axisLength * this._axisLength;\n }\n /** Evaluate third derivative of Y with respect to fraction. */\n public fractionToD3Y(_fraction: number): number {\n return 6.0 * this._cubicM * this._axisLength * this._axisLength * this._axisLength;\n }\n /** Evaluate fraction at x. */\n public xToFraction(x: number): number { return x / this._axisLength; }\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"CzechSpiralEvaluator.js","sourceRoot":"","sources":["../../../../src/curve/spiral/CzechSpiralEvaluator.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAE/F;;GAEG;AACH,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAC1C,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AACrD;;;;;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;YAC5C,OAAO,QAAQ,CAAC,gBAAgB,CAAC,IAAI,CAAC,cAAc,EAAE,KAAK,CAAC,cAAc,CAAC;mBACtE,QAAQ,CAAC,gBAAgB,CAAC,IAAI,CAAC,cAAc,EAAE,KAAK,CAAC,cAAc,CAAC,CAAC;QAC5E,CAAC;QACD,OAAO,KAAK,CAAC;IACf,CAAC;IACD;;;;;SAKK;IACE,6BAA6B,CAAC,CAAS;QAC5C,OAAO,oBAAoB,CAAC,cAAc,CAAC,CAAC,EAAE,CAAC,GAAG,EAAE,IAAI,CAAC,cAAc,EAAE,IAAI,CAAC,cAAc,CAAC,CAAC;IAChG,CAAC;IACD;;;;;OAKG;IACI,6BAA6B,CAAC,CAAS;QAC5C,OAAO,oBAAoB,CAAC,cAAc,CAAC,CAAC,EAAE,CAAC,GAAG,EAAE,IAAI,CAAC,cAAc,EAAE,IAAI,CAAC,cAAc,CAAC,CAAC;IAChG,CAAC;CACF","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n\r\n/** @packageDocumentation\r\n * @module Curve\r\n */\r\nimport { Geometry } from \"../../Geometry\";\r\nimport { CubicEvaluator } from \"./CubicEvaluator\";\r\nimport { SimpleNewton } from \"../../numerics/Newton\";\r\n/**\r\n * Czech cubic.\r\n * This is y= m*x^3 with\r\n * * x any point on the x axis\r\n * * `fraction` along the spiral goes to `x = fraction * L`\r\n * * m is gamma / (6RL)\r\n * * 1/(6RL) is the leading term of the sine series.\r\n * * `gamma = 2R/sqrt (4RR-LL)` pushes y down a little bit to simulate the lost series terms.\r\n * @param localToWorld\r\n * @param nominalL1\r\n * @param nominalR1\r\n * @param activeInterval\r\n * @internal\r\n */\r\nexport class CzechSpiralEvaluator extends CubicEvaluator {\r\n public nominalLength1: number;\r\n public nominalRadius1: number;\r\n\r\n /** Constructor is private. Caller responsible for cubicM validity. */\r\n private constructor(length1: number, radius1: number, cubicM: number) {\r\n super(length1, cubicM);\r\n this.nominalLength1 = length1;\r\n this.nominalRadius1 = radius1;\r\n }\r\n /**\r\n * Return the scale factor between simple x^3 / (6RL) cubic and the czech correction.\r\n * * For typical case with l1/R1 smallish, this is just less than 1.0:\r\n * (0.25==>0.99215), (0.15==>0.997184), (0.10==>0.998749), (0.05==>999687)\r\n * @param length1\r\n * @param radius1\r\n */\r\n public static gammaConstant(length1: number, radius1: number): number | undefined {\r\n return 2.0 * radius1 / Math.sqrt(4.0 * radius1 * radius1 - length1 * length1);\r\n }\r\n /** Compute the czech cubic constant. */\r\n public static computeCubicM(length1: number, radius1: number): number | undefined {\r\n const gamma = CzechSpiralEvaluator.gammaConstant(length1, radius1);\r\n // In the private update method, the LR values should have been vetted.\r\n if (gamma === undefined)\r\n return undefined;\r\n // If radius is negative, it shows up in gamma. But the a signed denominator undoes it. So take abs of denominator.\r\n return gamma / Math.abs((6.0 * radius1 * length1));\r\n }\r\n\r\n public static create(length1: number, radius1: number): CzechSpiralEvaluator | undefined {\r\n const m = this.computeCubicM(length1, radius1);\r\n if (m === undefined)\r\n return undefined;\r\n return new CzechSpiralEvaluator(length1, radius1, m);\r\n }\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(): CzechSpiralEvaluator { return new CzechSpiralEvaluator(this.nominalLength1, this.nominalRadius1, this.cubicM); }\r\n /** Member by member matchup ... */\r\n public isAlmostEqual(other: any): boolean {\r\n if (other instanceof CzechSpiralEvaluator) {\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\r\n /**\r\n * Return a (fast but mediocre) approximation of spiral length as a function of x axis position.\r\n * * This x-to-distance relation is not as precise as the CurvePrimitive method moveSignedDistanceFromFraction.\r\n * * It is supported here for users interested in replicating the Czech distance mapping rather than the more accurate CurvePrimitive measurements.\r\n * @param x distance along the x axis.\r\n */\r\n public xToCzechApproximateDistance(x: number): number {\r\n return CzechSpiralEvaluator.forwardL2R2Map(x, 1.0, this.nominalLength1, this.nominalRadius1);\r\n }\r\n /**\r\n * Return the inverse of the `forwardL2R2Map` function.\r\n * * The undefined result can only occur for distances outside the usual spirals.\r\n * @param s (approximate) distance along the spiral.\r\n *\r\n */\r\n public czechApproximateDistanceToX(d: number): number | undefined {\r\n return CzechSpiralEvaluator.inverseL2R2Map(d, 1.0, this.nominalLength1, this.nominalRadius1);\r\n }\r\n\r\n /**\r\n * evaluate a series expansion that is used with varying signs (plus or minus 1) in czech and italian spirals.\r\n * @param x distance along the x axis.\r\n */\r\n public static forwardL2R2Map(x: number, sign: number, length: number, radius: number): number {\r\n const l2 = length * length;\r\n const r2 = radius * radius;\r\n const Q = 4.0 * r2 - l2;\r\n const xx = x * x;\r\n return x * (1.0 + sign * xx * xx / (10.0 * Q * l2));\r\n }\r\n /**\r\n * Return the inverse of the `forwardL2R2Map` function.\r\n * * The undefined result can only occur for distances outside the usual spirals.\r\n * @param s (approximate) distance along the spiral.\r\n *\r\n */\r\n public static inverseL2R2Map(b: number, sign: number, length: number, radius: number): number | undefined {\r\n const l2 = length * length;\r\n const r2 = radius * radius;\r\n const Q = 4.0 * r2 - l2;\r\n const a = sign / (10.0 * Q * l2);\r\n return SimpleNewton.runNewton1D(b,\r\n (x: number) => {\r\n const xx = x * x;\r\n return x * (1.0 + xx * xx * a) - b;\r\n },\r\n (x: number) => {\r\n const xx = x * x;\r\n return 1.0 + 5 * xx * xx * a;\r\n });\r\n }\r\n}\r\n/**\r\n * Italian cubic.\r\n * This is y= m*x^3 with\r\n * * x any point on the x axis\r\n * * `fraction` along the spiral goes to `x = fraction * L`\r\n * * m is gamma / (6RL)\r\n * * 1/(6RL) is the leading term of the sine series.\r\n * * `gamma = 2R/sqrt (4RR-LL)` pushes y down a little bit to simulate the lost series terms.\r\n * @param localToWorld\r\n * @param nominalL1\r\n * @param nominalR1\r\n * @param activeInterval\r\n * @internal\r\n */\r\nexport class ItalianSpiralEvaluator extends CubicEvaluator {\r\n public nominalLength1: number;\r\n public nominalRadius1: number;\r\n\r\n /** Compute the czech cubic constant.\r\n * ** funky mixture of lengths ....\r\n */\r\n private static computeCubicM(lengthXByForward: number, radius1: number): number | undefined {\r\n const gamma = CzechSpiralEvaluator.gammaConstant(lengthXByForward, radius1);\r\n // In the private update method, the LR values should have been vetted.\r\n if (gamma === undefined)\r\n return undefined;\r\n // If radius is negative, it shows up in gamma. But the a signed denominator undoes it. So take abs of denominator.\r\n return gamma / Math.abs((6.0 * radius1 * lengthXByForward));\r\n }\r\n\r\n /** Constructor is private. Caller responsible for cubicM validity. */\r\n private constructor(length1: number, radius1: number, lengthX: number, cubicM: number) {\r\n super(lengthX, cubicM);\r\n this.nominalLength1 = length1;\r\n this.nominalRadius1 = radius1;\r\n }\r\n public static create(length1: number, radius1: number): ItalianSpiralEvaluator | undefined {\r\n // um ... this seems goofy. lengthX from forward, then invert for another . But that's what the native code does ...\r\n const lengthX = CzechSpiralEvaluator.forwardL2R2Map(length1, -1.0, length1, radius1);\r\n const lengthX1 = CzechSpiralEvaluator.inverseL2R2Map(length1, 1.0, lengthX, radius1);\r\n if (lengthX1 === undefined)\r\n return undefined;\r\n const m = ItalianSpiralEvaluator.computeCubicM(lengthX, radius1);\r\n if (m === undefined)\r\n return undefined;\r\n return new ItalianSpiralEvaluator(length1, radius1, lengthX1, m);\r\n }\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(): ItalianSpiralEvaluator { return new ItalianSpiralEvaluator(this.nominalLength1, this.nominalRadius1, super.axisLength, this.cubicM); }\r\n /** Member by member matchup ... */\r\n public isAlmostEqual(other: any): boolean {\r\n if (other instanceof ItalianSpiralEvaluator) {\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 /**\r\n * Return a (fast but mediocre) approximation of spiral length as a function of x axis position.\r\n * * This x-to-distance relation is not as precise as the CurvePrimitive method moveSignedDistanceFromFraction.\r\n * * It is supported here for users interested in replicating the Czech distance mapping rather than the more accurate CurvePrimitive measurements.\r\n * @param x distance along the x axis.\r\n */\r\n public distanceToItalianApproximateX(x: number): number {\r\n return CzechSpiralEvaluator.forwardL2R2Map(x, -1.0, this.nominalLength1, this.nominalRadius1);\r\n }\r\n /**\r\n * Return the inverse of the `forwardL2R2Map` function.\r\n * * The undefined result can only occur for distances outside the usual spirals.\r\n * @param s (approximate) distance along the spiral.\r\n *\r\n */\r\n public xToItalianApproximateDistance(d: number): number | undefined {\r\n return CzechSpiralEvaluator.inverseL2R2Map(d, -1.0, this.nominalLength1, this.nominalRadius1);\r\n }\r\n}\r\n"]}
1
+ {"version":3,"file":"CzechSpiralEvaluator.js","sourceRoot":"","sources":["../../../../src/curve/spiral/CzechSpiralEvaluator.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAE/F;;GAEG;AACH,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAC1C,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AACrD;;;;;;;;;;;;;GAaG;AACH,MAAM,OAAO,oBAAqB,SAAQ,cAAc;IAC/C,cAAc,CAAS;IACvB,cAAc,CAAS;IAE9B,uEAAuE;IACvE,YAAoB,OAAe,EAAE,OAAe,EAAE,MAAc;QAClE,KAAK,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC;QACvB,IAAI,CAAC,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ACf,CAAC;IACD;;;;;SAKK;IACE,6BAA6B,CAAC,CAAS;QAC5C,OAAO,oBAAoB,CAAC,cAAc,CAAC,CAAC,EAAE,CAAC,GAAG,EAAE,IAAI,CAAC,cAAc,EAAE,IAAI,CAAC,cAAc,CAAC,CAAC;IAChG,CAAC;IACD;;;;;OAKG;IACI,6BAA6B,CAAC,CAAS;QAC5C,OAAO,oBAAoB,CAAC,cAAc,CAAC,CAAC,EAAE,CAAC,GAAG,EAAE,IAAI,CAAC,cAAc,EAAE,IAAI,CAAC,cAAc,CAAC,CAAC;IAChG,CAAC;CACF","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n\n/** @packageDocumentation\n * @module Curve\n */\nimport { Geometry } from \"../../Geometry\";\nimport { CubicEvaluator } from \"./CubicEvaluator\";\nimport { SimpleNewton } from \"../../numerics/Newton\";\n/**\n * Czech cubic.\n * This is y= m*x^3 with\n * * x any point on the x axis\n * * `fraction` along the spiral goes to `x = fraction * L`\n * * m is gamma / (6RL)\n * * 1/(6RL) is the leading term of the sine series.\n * * `gamma = 2R/sqrt (4RR-LL)` pushes y down a little bit to simulate the lost series terms.\n * @param localToWorld\n * @param nominalL1\n * @param nominalR1\n * @param activeInterval\n * @internal\n */\nexport class CzechSpiralEvaluator extends CubicEvaluator {\n public nominalLength1: number;\n public nominalRadius1: number;\n\n /** Constructor is private. Caller responsible for cubicM validity. */\n private constructor(length1: number, radius1: number, cubicM: number) {\n super(length1, cubicM);\n this.nominalLength1 = length1;\n this.nominalRadius1 = radius1;\n }\n /**\n * Return the scale factor between simple x^3 / (6RL) cubic and the czech correction.\n * * For typical case with l1/R1 smallish, this is just less than 1.0:\n * (0.25==>0.99215), (0.15==>0.997184), (0.10==>0.998749), (0.05==>999687)\n * @param length1\n * @param radius1\n */\n public static gammaConstant(length1: number, radius1: number): number | undefined {\n return 2.0 * radius1 / Math.sqrt(4.0 * radius1 * radius1 - length1 * length1);\n }\n /** Compute the czech cubic constant. */\n public static computeCubicM(length1: number, radius1: number): number | undefined {\n const gamma = CzechSpiralEvaluator.gammaConstant(length1, radius1);\n // In the private update method, the LR values should have been vetted.\n if (gamma === undefined)\n return undefined;\n // If radius is negative, it shows up in gamma. But the a signed denominator undoes it. So take abs of denominator.\n return gamma / Math.abs((6.0 * radius1 * length1));\n }\n\n public static create(length1: number, radius1: number): CzechSpiralEvaluator | undefined {\n const m = this.computeCubicM(length1, radius1);\n if (m === undefined)\n return undefined;\n return new CzechSpiralEvaluator(length1, radius1, m);\n }\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(): CzechSpiralEvaluator { return new CzechSpiralEvaluator(this.nominalLength1, this.nominalRadius1, this.cubicM); }\n /** Member by member matchup ... */\n public isAlmostEqual(other: any): boolean {\n if (other instanceof CzechSpiralEvaluator) {\n return Geometry.isSameCoordinate(this.nominalLength1, other.nominalLength1)\n && Geometry.isSameCoordinate(this.nominalRadius1, other.nominalRadius1);\n }\n return false;\n }\n\n /**\n * Return a (fast but mediocre) approximation of spiral length as a function of x axis position.\n * * This x-to-distance relation is not as precise as the CurvePrimitive method moveSignedDistanceFromFraction.\n * * It is supported here for users interested in replicating the Czech distance mapping rather than the more accurate CurvePrimitive measurements.\n * @param x distance along the x axis.\n */\n public xToCzechApproximateDistance(x: number): number {\n return CzechSpiralEvaluator.forwardL2R2Map(x, 1.0, this.nominalLength1, this.nominalRadius1);\n }\n /**\n * Return the inverse of the `forwardL2R2Map` function.\n * * The undefined result can only occur for distances outside the usual spirals.\n * @param s (approximate) distance along the spiral.\n *\n */\n public czechApproximateDistanceToX(d: number): number | undefined {\n return CzechSpiralEvaluator.inverseL2R2Map(d, 1.0, this.nominalLength1, this.nominalRadius1);\n }\n\n /**\n * evaluate a series expansion that is used with varying signs (plus or minus 1) in czech and italian spirals.\n * @param x distance along the x axis.\n */\n public static forwardL2R2Map(x: number, sign: number, length: number, radius: number): number {\n const l2 = length * length;\n const r2 = radius * radius;\n const Q = 4.0 * r2 - l2;\n const xx = x * x;\n return x * (1.0 + sign * xx * xx / (10.0 * Q * l2));\n }\n /**\n * Return the inverse of the `forwardL2R2Map` function.\n * * The undefined result can only occur for distances outside the usual spirals.\n * @param s (approximate) distance along the spiral.\n *\n */\n public static inverseL2R2Map(b: number, sign: number, length: number, radius: number): number | undefined {\n const l2 = length * length;\n const r2 = radius * radius;\n const Q = 4.0 * r2 - l2;\n const a = sign / (10.0 * Q * l2);\n return SimpleNewton.runNewton1D(b,\n (x: number) => {\n const xx = x * x;\n return x * (1.0 + xx * xx * a) - b;\n },\n (x: number) => {\n const xx = x * x;\n return 1.0 + 5 * xx * xx * a;\n });\n }\n}\n/**\n * Italian cubic.\n * This is y= m*x^3 with\n * * x any point on the x axis\n * * `fraction` along the spiral goes to `x = fraction * L`\n * * m is gamma / (6RL)\n * * 1/(6RL) is the leading term of the sine series.\n * * `gamma = 2R/sqrt (4RR-LL)` pushes y down a little bit to simulate the lost series terms.\n * @param localToWorld\n * @param nominalL1\n * @param nominalR1\n * @param activeInterval\n * @internal\n */\nexport class ItalianSpiralEvaluator extends CubicEvaluator {\n public nominalLength1: number;\n public nominalRadius1: number;\n\n /** Compute the czech cubic constant.\n * ** funky mixture of lengths ....\n */\n private static computeCubicM(lengthXByForward: number, radius1: number): number | undefined {\n const gamma = CzechSpiralEvaluator.gammaConstant(lengthXByForward, radius1);\n // In the private update method, the LR values should have been vetted.\n if (gamma === undefined)\n return undefined;\n // If radius is negative, it shows up in gamma. But the a signed denominator undoes it. So take abs of denominator.\n return gamma / Math.abs((6.0 * radius1 * lengthXByForward));\n }\n\n /** Constructor is private. Caller responsible for cubicM validity. */\n private constructor(length1: number, radius1: number, lengthX: number, cubicM: number) {\n super(lengthX, cubicM);\n this.nominalLength1 = length1;\n this.nominalRadius1 = radius1;\n }\n public static create(length1: number, radius1: number): ItalianSpiralEvaluator | undefined {\n // um ... this seems goofy. lengthX from forward, then invert for another . But that's what the native code does ...\n const lengthX = CzechSpiralEvaluator.forwardL2R2Map(length1, -1.0, length1, radius1);\n const lengthX1 = CzechSpiralEvaluator.inverseL2R2Map(length1, 1.0, lengthX, radius1);\n if (lengthX1 === undefined)\n return undefined;\n const m = ItalianSpiralEvaluator.computeCubicM(lengthX, radius1);\n if (m === undefined)\n return undefined;\n return new ItalianSpiralEvaluator(length1, radius1, lengthX1, m);\n }\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(): ItalianSpiralEvaluator { return new ItalianSpiralEvaluator(this.nominalLength1, this.nominalRadius1, super.axisLength, this.cubicM); }\n /** Member by member matchup ... */\n public isAlmostEqual(other: any): boolean {\n if (other instanceof ItalianSpiralEvaluator) {\n return Geometry.isSameCoordinate(this.nominalLength1, other.nominalLength1)\n && Geometry.isSameCoordinate(this.nominalRadius1, other.nominalRadius1);\n }\n return false;\n }\n /**\n * Return a (fast but mediocre) approximation of spiral length as a function of x axis position.\n * * This x-to-distance relation is not as precise as the CurvePrimitive method moveSignedDistanceFromFraction.\n * * It is supported here for users interested in replicating the Czech distance mapping rather than the more accurate CurvePrimitive measurements.\n * @param x distance along the x axis.\n */\n public distanceToItalianApproximateX(x: number): number {\n return CzechSpiralEvaluator.forwardL2R2Map(x, -1.0, this.nominalLength1, this.nominalRadius1);\n }\n /**\n * Return the inverse of the `forwardL2R2Map` function.\n * * The undefined result can only occur for distances outside the usual spirals.\n * @param s (approximate) distance along the spiral.\n *\n */\n public xToItalianApproximateDistance(d: number): number | undefined {\n return CzechSpiralEvaluator.inverseL2R2Map(d, -1.0, this.nominalLength1, this.nominalRadius1);\n }\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"DirectHalfCosineSpiralEvaluator.js","sourceRoot":"","sources":["../../../../src/curve/spiral/DirectHalfCosineSpiralEvaluator.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAE/F;;GAEG;AACH,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAC1C,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACtD,OAAO,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AACrD;;GAEG;AACH,MAAM,OAAO,+BAAgC,SAAQ,gBAAgB;IAC5D,cAAc,CAAS;IACvB,cAAc,CAAS;IACtB,EAAE,CAAS;IACX,GAAG,CAAS;IACZ,GAAG,CAAS;IACpB,YAAmB,OAAe,EAAE,OAAe;QACjD,KAAK,EAAE,CAAC;QACR,IAAI,CAAC,cAAc,GAAG,OAAO,CAAC;QAC9B,IAAI,CAAC,cAAc,GAAG,OAAO,CAAC;QAC9B,MAAM,EAAE,GAAG,IAAI,CAAC,EAAE,CAAC;QACnB,IAAI,CAAC,GAAG,GAAG,GAAG,GAAG,CAAC,GAAG,GAAG,EAAE,GAAG,EAAE,CAAC,CAAC;QACjC,IAAI,CAAC,GAAG,GAAG,IAAI,CAAC;QAChB,IAAI,CAAC,EAAE,GAAG,GAAG,CAAC,CAAC,sBAAsB;QACrC,IAAI,CAAC,eAAe,EAAE,CAAC;IACzB,CAAC;IAEO,eAAe;QACrB,IAAI,CAAC,EAAE,GAAG,IAAI,CAAC,cAAc,GAAG,IAAI,CAAC,cAAc,GAAG,IAAI,CAAC,cAAc,CAAC;IAC5E,CAAC;IACM,YAAY,CAAC,WAAmB;QACrC,IAAI,CAAC,cAAc,IAAI,WAAW,CAAC;QACnC,IAAI,CAAC,cAAc,IAAI,WAAW,CAAC;QACnC,IAAI,CAAC,eAAe,EAAE,CAAC;IACzB,CAAC;IACD,0CAA0C;IACnC,KAAK,KAAsC,OAAO,IAAI,+BAA+B,CAAC,IAAI,CAAC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AAC,CAAC,CAAC,CAAC;QACvC,IAAI,SAAS,KAAK,SAAS;YACzB,OAAO,SAAS,CAAC;QACnB,OAAO,SAAS,CAAC;IAEnB,CAAC;CACF","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n\r\n/** @packageDocumentation\r\n * @module Curve\r\n */\r\nimport { Geometry } from \"../../Geometry\";\r\nimport { XYCurveEvaluator } from \"./XYCurveEvaluator\";\r\nimport { SimpleNewton } from \"../../numerics/Newton\";\r\n/**\r\n * @internal\r\n */\r\nexport class DirectHalfCosineSpiralEvaluator extends XYCurveEvaluator {\r\n public nominalLength1: number;\r\n public nominalRadius1: number;\r\n private _c: number;\r\n private _c1: number;\r\n private _c2: number;\r\n public constructor(length1: number, radius1: number) {\r\n super();\r\n this.nominalLength1 = length1;\r\n this.nominalRadius1 = radius1;\r\n const pi = Math.PI;\r\n this._c1 = 1.0 / (2.0 * pi * pi);\r\n this._c2 = 0.25;\r\n this._c = 0.0; // TO BE UPDATED BELOW\r\n this.updateConstants();\r\n }\r\n\r\n private updateConstants() {\r\n this._c = this.nominalLength1 * this.nominalLength1 / this.nominalRadius1;\r\n }\r\n public scaleInPlace(scaleFactor: number) {\r\n this.nominalLength1 *= scaleFactor;\r\n this.nominalRadius1 *= scaleFactor;\r\n this.updateConstants();\r\n }\r\n /** return a deep copy of the evaluator */\r\n public clone(): DirectHalfCosineSpiralEvaluator { return new DirectHalfCosineSpiralEvaluator(this.nominalLength1, this.nominalRadius1); }\r\n /** Member by member matchup ... */\r\n public isAlmostEqual(other: any): boolean {\r\n if (other instanceof DirectHalfCosineSpiralEvaluator) {\r\n return Geometry.isSameCoordinate(this.nominalLength1, other.nominalLength1)\r\n && Geometry.isSameCoordinate(this.nominalRadius1, other.nominalRadius1);\r\n // remark: c,c1,c2 are computed, need not be tested.\r\n }\r\n return false;\r\n }\r\n /** Evaluate X at fractional position. */\r\n public fractionToX(fraction: number): number { return fraction * this.nominalLength1; }\r\n /** Evaluate Y at fractional position. */\r\n public fractionToY(fraction: number): number {\r\n const theta = fraction * Math.PI;\r\n return this._c * (this._c2 * fraction * fraction - this._c1 * (1.0 - Math.cos(theta)));\r\n }\r\n /** Evaluate derivative of X with respect to fraction at fractional position. */\r\n public fractionToDX(_fraction: number): number { return this.nominalLength1; }\r\n\r\n /** Evaluate derivative of Y with respect to fraction at fractional position. */\r\n\r\n public fractionToDY(fraction: number): number {\r\n const pi = Math.PI;\r\n const theta = fraction * pi;\r\n return this._c * (2.0 * this._c2 * fraction - this._c1 * pi * Math.sin(theta));\r\n }\r\n /** Evaluate second derivative of X with respect to fraction at fractional position. */\r\n public fractionToDDX(_fraction: number): number { return 0.0; }\r\n\r\n /** Evaluate third derivative of Y with respect to fraction at fractional position. */\r\n\r\n public fractionToDDY(fraction: number): number {\r\n const pi = Math.PI;\r\n const theta = fraction * pi;\r\n return this._c * (2.0 * this._c2 - this._c1 * pi * pi * Math.cos(theta));\r\n }\r\n /** Evaluate second derivative of X with respect to fraction at fractional position. */\r\n public fractionToD3X(_fraction: number): number { return 0.0; }\r\n\r\n /** Evaluate third derivative of Y with respect to fraction at fractional position. */\r\n\r\n public fractionToD3Y(fraction: number): number {\r\n const pi = Math.PI;\r\n const theta = fraction * pi;\r\n return this._c * this._c1 * pi * pi * pi * Math.sin(theta);\r\n }\r\n\r\n /** Return the magnitude of the first vector at fractional coordinate. */\r\n\r\n public override fractionToTangentMagnitude(fraction: number): number {\r\n return Geometry.hypotenuseXY(this.fractionToDX(fraction), this.fractionToDY(fraction));\r\n\r\n }\r\n /** Invert the fractionToX function for given X. */\r\n public xToFraction(x: number): number | undefined {\r\n const fraction0 = x / this.nominalLength1;\r\n const fraction1 = SimpleNewton.runNewton1D(fraction0,\r\n (f: number) => (this.fractionToX(f) - x),\r\n (f: number) => this.fractionToDX(f));\r\n if (fraction1 === undefined)\r\n return undefined;\r\n return fraction1;\r\n\r\n }\r\n}\r\n"]}
1
+ {"version":3,"file":"DirectHalfCosineSpiralEvaluator.js","sourceRoot":"","sources":["../../../../src/curve/spiral/DirectHalfCosineSpiralEvaluator.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAE/F;;GAEG;AACH,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAC1C,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACtD,OAAO,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AACrD;;GAEG;AACH,MAAM,OAAO,+BAAgC,SAAQ,gBAAgB;IAC5D,cAAc,CAAS;IACvB,cAAc,CAAS;IACtB,EAAE,CAAS;IACX,GAAG,CAAS;IACZ,GAAG,CAAS;IACpB,YAAmB,OAAe,EAAE,OAAe;QACjD,KAAK,EAAE,CAAC;QACR,IAAI,CAAC,cAAc,GAAG,OAAO,CAAC;QAC9B,IAAI,CAAC,cAAc,GAAG,OAAO,CAAC;QAC9B,MAAM,EAAE,GAAG,IAAI,CAAC,EAAE,CAAC;QACnB,IAAI,CAAC,GAAG,GAAG,GAAG,GAAG,CAAC,GAAG,GAAG,EAAE,GAAG,EAAE,CAAC,CAAC;QACjC,IAAI,CAAC,GAAG,GAAG,IAAI,CAAC;QAChB,IAAI,CAAC,EAAE,GAAG,GAAG,CAAC,CAAC,sBAAsB;QACrC,IAAI,CAAC,eAAe,EAAE,CAAC;IACzB,CAAC;IAEO,eAAe;QACrB,IAAI,CAAC,EAAE,GAAG,IAAI,CAAC,cAAc,GAAG,IAAI,CAAC,cAAc,GAAG,IAAI,CAAC,cAAc,CAAC;IAC5E,CAAC;IACM,YAAY,CAAC,WAAmB;QACrC,IAAI,CAAC,cAAc,IAAI,WAAW,CAAC;QACnC,IAAI,CAAC,cAAc,IAAI,WAAW,CAAC;QACnC,IAAI,CAAC,eAAe,EAAE,CAAC;IACzB,CAAC;IACD,0CAA0C;IACnC,KAAK,K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EAAE,EAAE,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC,CAAC;QACvC,IAAI,SAAS,KAAK,SAAS;YACzB,OAAO,SAAS,CAAC;QACnB,OAAO,SAAS,CAAC;IAEnB,CAAC;CACF","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n\n/** @packageDocumentation\n * @module Curve\n */\nimport { Geometry } from \"../../Geometry\";\nimport { XYCurveEvaluator } from \"./XYCurveEvaluator\";\nimport { SimpleNewton } from \"../../numerics/Newton\";\n/**\n * @internal\n */\nexport class DirectHalfCosineSpiralEvaluator extends XYCurveEvaluator {\n public nominalLength1: number;\n public nominalRadius1: number;\n private _c: number;\n private _c1: number;\n private _c2: number;\n public constructor(length1: number, radius1: number) {\n super();\n this.nominalLength1 = length1;\n this.nominalRadius1 = radius1;\n const pi = Math.PI;\n this._c1 = 1.0 / (2.0 * pi * pi);\n this._c2 = 0.25;\n this._c = 0.0; // TO BE UPDATED BELOW\n this.updateConstants();\n }\n\n private updateConstants() {\n this._c = this.nominalLength1 * this.nominalLength1 / this.nominalRadius1;\n }\n public scaleInPlace(scaleFactor: number) {\n this.nominalLength1 *= scaleFactor;\n this.nominalRadius1 *= scaleFactor;\n this.updateConstants();\n }\n /** return a deep copy of the evaluator */\n public clone(): DirectHalfCosineSpiralEvaluator { return new DirectHalfCosineSpiralEvaluator(this.nominalLength1, this.nominalRadius1); }\n /** Member by member matchup ... */\n public isAlmostEqual(other: any): boolean {\n if (other instanceof DirectHalfCosineSpiralEvaluator) {\n return Geometry.isSameCoordinate(this.nominalLength1, other.nominalLength1)\n && Geometry.isSameCoordinate(this.nominalRadius1, other.nominalRadius1);\n // remark: c,c1,c2 are computed, need not be tested.\n }\n return false;\n }\n /** Evaluate X at fractional position. */\n public fractionToX(fraction: number): number { return fraction * this.nominalLength1; }\n /** Evaluate Y at fractional position. */\n public fractionToY(fraction: number): number {\n const theta = fraction * Math.PI;\n return this._c * (this._c2 * fraction * fraction - this._c1 * (1.0 - Math.cos(theta)));\n }\n /** Evaluate derivative of X with respect to fraction at fractional position. */\n public fractionToDX(_fraction: number): number { return this.nominalLength1; }\n\n /** Evaluate derivative of Y with respect to fraction at fractional position. */\n\n public fractionToDY(fraction: number): number {\n const pi = Math.PI;\n const theta = fraction * pi;\n return this._c * (2.0 * this._c2 * fraction - this._c1 * pi * Math.sin(theta));\n }\n /** Evaluate second derivative of X with respect to fraction at fractional position. */\n public fractionToDDX(_fraction: number): number { return 0.0; }\n\n /** Evaluate third derivative of Y with respect to fraction at fractional position. */\n\n public fractionToDDY(fraction: number): number {\n const pi = Math.PI;\n const theta = fraction * pi;\n return this._c * (2.0 * this._c2 - this._c1 * pi * pi * Math.cos(theta));\n }\n /** Evaluate second derivative of X with respect to fraction at fractional position. */\n public fractionToD3X(_fraction: number): number { return 0.0; }\n\n /** Evaluate third derivative of Y with respect to fraction at fractional position. */\n\n public fractionToD3Y(fraction: number): number {\n const pi = Math.PI;\n const theta = fraction * pi;\n return this._c * this._c1 * pi * pi * pi * Math.sin(theta);\n }\n\n /** Return the magnitude of the first vector at fractional coordinate. */\n\n public override fractionToTangentMagnitude(fraction: number): number {\n return Geometry.hypotenuseXY(this.fractionToDX(fraction), this.fractionToDY(fraction));\n\n }\n /** Invert the fractionToX function for given X. */\n public xToFraction(x: number): number | undefined {\n const fraction0 = x / this.nominalLength1;\n const fraction1 = SimpleNewton.runNewton1D(fraction0,\n (f: number) => (this.fractionToX(f) - x),\n (f: number) => this.fractionToDX(f));\n if (fraction1 === undefined)\n return undefined;\n return fraction1;\n\n }\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"DirectSpiral3d.js","sourceRoot":"","sources":["../../../../src/curve/spiral/DirectSpiral3d.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AACH,OAAO,EAAE,QAAQ,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,QAAQ,CAAC,gBAAgB,CAAC,IAAI,CAAC,UAAU,EAAE,KAAK,CAAC,UAAU,CAAC;mBAC5D,IAAI,CAAC,YAAY,CAAC,aAAa,CAAC,KAAK,CAAC,YAAY,CAAC;mBACnD,IAAI,CAAC,uBAAuB,CAAC,aAAa,CAAC,KAAK,CAAC,uBAAuB,CAAC;mBACzE,IAAI,CAAC,UAAU,CAAC,aAAa,CAAC,KAAK,CAAC,UAAU,CAAC,CAAC;QACvD,CAAC;QACD,OAAO,KAAK,CAAC;IACf,CAAC;CACF","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module Curve\r\n */\r\nimport { Geometry } from \"../../Geometry\";\r\nimport { Angle } from \"../../geometry3d/Angle\";\r\nimport { GeometryHandler, IStrokeHandler } from \"../../geometry3d/GeometryHandler\";\r\nimport { Plane3dByOriginAndUnitNormal } from \"../../geometry3d/Plane3dByOriginAndUnitNormal\";\r\nimport { Plane3dByOriginAndVectors } from \"../../geometry3d/Plane3dByOriginAndVectors\";\r\nimport { Point3d } from \"../../geometry3d/Point3dVector3d\";\r\nimport { Ray3d } from \"../../geometry3d/Ray3d\";\r\nimport { Segment1d } from \"../../geometry3d/Segment1d\";\r\nimport { Transform } from \"../../geometry3d/Transform\";\r\nimport { CurveLengthContext } from \"../internalContexts/CurveLengthContext\";\r\nimport { LineString3d } from \"../LineString3d\";\r\nimport { StrokeOptions } from \"../StrokeOptions\";\r\nimport { AustralianRailCorpXYEvaluator } from \"./AustralianRailCorpXYEvaluator\";\r\nimport { ClothoidSeriesRLEvaluator } from \"./ClothoidSeries\";\r\nimport { CzechSpiralEvaluator, ItalianSpiralEvaluator } from \"./CzechSpiralEvaluator\";\r\nimport { DirectHalfCosineSpiralEvaluator } from \"./DirectHalfCosineSpiralEvaluator\";\r\nimport { MXCubicAlongArcEvaluator } from \"./MXCubicAlongArcSpiralEvaluator\";\r\nimport { PolishCubicEvaluator } from \"./PolishCubicSpiralEvaluator\";\r\nimport { TransitionConditionalProperties } from \"./TransitionConditionalProperties\";\r\nimport { TransitionSpiral3d } from \"./TransitionSpiral3d\";\r\nimport { XYCurveEvaluator } from \"./XYCurveEvaluator\";\r\n\r\n/**\r\n* DirectSpiral3d acts like a TransitionSpiral3d for serialization purposes, but implements spiral types that have \"direct\" xy calculations without the integrations required\r\n* for IntegratedSpiral3d.\r\n* * Each DirectSpiral3d carries an XYCurveEvaluator to give it specialized behavior.\r\n* * Direct spirals that flow through serialization to native imodel02 are create with these static methods:\r\n* * createArema\r\n* * createJapaneseCubic\r\n* * createAustralianRail\r\n* * createDirectHalfCosine\r\n* * createChineseCubic\r\n* * createCzechCubic\r\n* * createPolishCubic\r\n* * createItalian\r\n* * createWesternAustralian\r\n* @public\r\n*/\r\nexport class DirectSpiral3d extends TransitionSpiral3d {\r\n\r\n /** String name for schema properties */\r\n\r\n public readonly curvePrimitiveType = \"transitionSpiral\";\r\n\r\n /** stroked approximation of entire spiral. This is AFTER the localToWorld transform ... */\r\n private _globalStrokes: LineString3d;\r\n /** stroked approximation of active spiral. This is AFTER the localToWorld transfomr ...\r\n * * Same count as global -- possibly overly fine, but it gives some consistency between same clothoid constructed as partial versus complete.\r\n * * If no trimming, this points to the same place as the _globalStrokes !!! Don't double transform!!!\r\n */\r\n private _activeStrokes?: LineString3d;\r\n /** Return the internal stroked form of the (possibly partial) spiral */\r\n public get activeStrokes(): LineString3d { return this._activeStrokes !== undefined ? this._activeStrokes : this._globalStrokes; }\r\n\r\n private _nominalL1: number;\r\n private _nominalR1: number;\r\n private _evaluator: XYCurveEvaluator;\r\n\r\n /** Return the nominal end radius. */\r\n public get nominalR1(): number { return this._nominalR1; }\r\n /** Return the nominal distance from inflection to endpoint. */\r\n public get nominalL1(): number { return this._nominalL1; }\r\n /** Return the nominal end curvature */\r\n public get nominalCurvature1(): number { return TransitionSpiral3d.radiusToCurvature(this._nominalR1); }\r\n /** Return the low level evaluator\r\n * @internal\r\n */\r\n public get evaluator(): XYCurveEvaluator { return this._evaluator; }\r\n\r\n // constructor demands radius1 and distance1 for nominal construction.\r\n // caller is responsible for managing intervals of partial spiral\r\n constructor(\r\n localToWorld: Transform,\r\n spiralType: string | undefined,\r\n originalProperties: TransitionConditionalProperties | undefined,\r\n nominalL1: number,\r\n nominalR1: number,\r\n activeFractionInterval: Segment1d | undefined,\r\n evaluator: XYCurveEvaluator) {\r\n super(spiralType, localToWorld, activeFractionInterval, originalProperties);\r\n this._nominalL1 = nominalL1;\r\n this._nominalR1 = nominalR1;\r\n this._evaluator = evaluator;\r\n this._globalStrokes = LineString3d.create();\r\n this._activeStrokes = LineString3d.create();\r\n // initialize for compiler -- but this will be recomputed in refreshComputeProperties ...\r\n this.refreshComputedProperties();\r\n }\r\n /**\r\n * Compute stroke data in an interval.\r\n * @param strokes strokes to clear and refill.\r\n * @param fraction0 start fraction\r\n * @param fraction1 end fraction\r\n */\r\n private computeStrokes(strokes: LineString3d, fractionA: number, fractionB: number, numInterval: number, applyLocalToWorld: boolean = true) {\r\n if (numInterval < 1)\r\n numInterval = 1;\r\n strokes.clear();\r\n strokes.ensureEmptyUVParams();\r\n strokes.ensureEmptyFractions();\r\n const distances = strokes.packedUVParams!;\r\n const nominalIntervalLength = Math.abs(fractionB - fractionA) * this._nominalL1;\r\n for (let i = 0; i <= numInterval; i++) {\r\n const fraction = Geometry.interpolate(fractionA, i / numInterval, fractionB);\r\n const nominalDistanceAlong = fraction * nominalIntervalLength;\r\n strokes.packedPoints.pushXYZ(this._evaluator.fractionToX(fraction),\r\n this._evaluator.fractionToY(fraction), 0);\r\n distances.pushXY(fraction, nominalDistanceAlong); // the second distance will be updated below\r\n }\r\n if (applyLocalToWorld)\r\n strokes.tryTransformInPlace (this._localToWorld);\r\n let fraction0 = distances.getXAtUncheckedPointIndex(0);\r\n let trueDistance0 = distances.getYAtUncheckedPointIndex(0); // whatever was assigned as start distance is fine\r\n let trueDistance1, fraction1;\r\n for (let i = 1; i <= numInterval; i++) {\r\n fraction1 = distances.getXAtUncheckedPointIndex(i);\r\n trueDistance1 = trueDistance0 + this._evaluator.integrateDistanceBetweenFractions(fraction0, fraction1);\r\n distances.setXYAtCheckedPointIndex(i, fraction1, trueDistance1);\r\n fraction0 = fraction1;\r\n trueDistance0 = trueDistance1;\r\n }\r\n\r\n }\r\n /** Recompute strokes */\r\n public override refreshComputedProperties() {\r\n const sweepRadians = this.nominalL1 / (2.0 * this.nominalR1);\r\n const radiansStep = 0.02;\r\n const numInterval = StrokeOptions.applyAngleTol(undefined, 4, sweepRadians, radiansStep);\r\n this.computeStrokes(this._globalStrokes, 0, 1, numInterval);\r\n const numActiveInterval = Math.ceil(this._activeFractionInterval.absoluteDelta() * numInterval);\r\n this._activeStrokes = LineString3d.create();\r\n this.computeStrokes(this._activeStrokes, this._activeFractionInterval.x0, this._activeFractionInterval.x1,\r\n numActiveInterval);\r\n }\r\n /**\r\n * Create a spiral object which uses numXTerm terms from the clothoid X series and numYTerm from the clothoid Y series.\r\n * @param numXTerm number of terms to use from X series\r\n * @param numYTerm number of terms to use from Y series\r\n * @param localToWorld placement frame. Inflection point is at origin, initial direction is along x axis.\r\n * @param nominalL1 design distance from inflection to end point.\r\n * @param nominalR1 design radius at end point.\r\n * @param activeInterval active interval (as fractions of nominalL1 !!!)\r\n */\r\n public static createTruncatedClothoid(\r\n spiralType: string,\r\n localToWorld: Transform,\r\n numXTerm: number, numYTerm: number,\r\n originalProperties: TransitionConditionalProperties | undefined,\r\n nominalL1: number, nominalR1: number,\r\n activeInterval: Segment1d | undefined): DirectSpiral3d | undefined {\r\n if (numXTerm < 1)\r\n numXTerm = 1;\r\n if (numYTerm < 1)\r\n numYTerm = 1;\r\n const evaluator = new ClothoidSeriesRLEvaluator(nominalL1, 1.0 / (2.0 * nominalL1 * nominalR1), numXTerm, numYTerm);\r\n return new DirectSpiral3d(\r\n localToWorld.clone(),\r\n spiralType,\r\n originalProperties,\r\n nominalL1, nominalR1,\r\n activeInterval ? activeInterval.clone() : Segment1d.create(0, 1), evaluator);\r\n }\r\n /**\r\n * Create an Japanese spiral clothoid approximation\r\n * * X is 1 terms of the clothoid series as a function of nominal distance along.\r\n * * Y is 1 terms f the clothoid series as a function of nominal distance along.\r\n * * Remark: This is identical to the ChineseCubic\r\n * @param localToWorld axes with inflection at origin, tangent along x axis\r\n * @param nominalL1 nominal length as used in series LR terms.\r\n * @param nominalR1 nominal final radius as used in series LR terms\r\n * @param activeInterval fractional interval with (0, nominalL1) range for nominal distance along\r\n */\r\n public static createJapaneseCubic(\r\n localToWorld: Transform,\r\n nominalL1: number,\r\n nominalR1: number,\r\n activeInterval?: Segment1d): DirectSpiral3d | undefined {\r\n return this.createTruncatedClothoid(\"JapaneseCubic\", localToWorld, 1, 1, undefined, nominalL1, nominalR1, activeInterval);\r\n }\r\n /**\r\n * Create a czech cubic.\r\n * This is y= m*x^3 with\r\n * * x any point on the x axis\r\n * * `fraction` along the spiral goes to `x = fraction * L`\r\n * * m is gamma / (6RL)\r\n * * 1/(6RL) is the leading term of the sine series.\r\n * * `gamma = 2R/sqrt (4RR-LL)` pushes y up a little bit to simulate the lost series terms.\r\n * @param localToWorld\r\n * @param nominalLx nominal length along x axis\r\n * @param nominalR1\r\n * @param activeInterval\r\n */\r\n public static createCzechCubic(\r\n localToWorld: Transform,\r\n nominalLx: number,\r\n nominalR1: number,\r\n activeInterval?: Segment1d): DirectSpiral3d | undefined {\r\n const evaluator = CzechSpiralEvaluator.create(nominalLx, nominalR1);\r\n if (evaluator === undefined)\r\n return undefined;\r\n return new DirectSpiral3d(\r\n localToWorld.clone(),\r\n \"Czech\",\r\n undefined,\r\n nominalLx, nominalR1,\r\n activeInterval ? activeInterval.clone() : Segment1d.create(0, 1), evaluator);\r\n }\r\n /**\r\n * Create an italian spiral\r\n * This is y= m*x^3 with\r\n * * x any point on the x axis\r\n * * `fraction` along the spiral goes to `x = fraction * L`\r\n * * m is gamma / (6RL)\r\n * * 1/(6RL) is the leading term of the sine series.\r\n * * `gamma = 2R/sqrt (4RR-LL)` pushes y up a little bit to simulate the lost series terms.\r\n * * L in gamma and m is the\r\n * @param localToWorld\r\n * @param nominalL1 nominal length along the spiral\r\n * @param nominalR1\r\n * @param activeInterval\r\n */\r\n public static createItalian(\r\n localToWorld: Transform,\r\n nominalL1: number,\r\n nominalR1: number,\r\n activeInterval?: Segment1d): DirectSpiral3d | undefined {\r\n const evaluator = ItalianSpiralEvaluator.create(nominalL1, nominalR1);\r\n if (evaluator === undefined)\r\n return undefined;\r\n return new DirectSpiral3d(\r\n localToWorld.clone(),\r\n \"Italian\",\r\n undefined,\r\n nominalL1, nominalR1,\r\n activeInterval ? activeInterval.clone() : Segment1d.create(0, 1), evaluator);\r\n }\r\n\r\n /**\r\n * Create an MX Cubic whose nominal length is close to along the curve.\r\n * This is y= m*x^3 with\r\n * * m is 1/ (6RL1)\r\n * * 1/(6RL) is the leading term of the sine series.\r\n * * L1 is an along-the-x-axis distance that is slightly LESS THAN the nominal length\r\n * * x is axis position that is slightly LESS than nominal distance along\r\n * * L1, x use the approximation `x = s * ( 1 - s^4/ (40 R R L L))\r\n * @param localToWorld\r\n * @param nominalL1\r\n * @param nominalR1\r\n * @param activeInterval\r\n */\r\n public static createMXCubicAlongArc(\r\n localToWorld: Transform,\r\n nominalL1: number,\r\n nominalR1: number,\r\n activeInterval?: Segment1d): DirectSpiral3d | undefined {\r\n const evaluator = MXCubicAlongArcEvaluator.create(nominalL1, nominalR1);\r\n if (evaluator === undefined)\r\n return undefined;\r\n return new DirectSpiral3d(\r\n localToWorld.clone(),\r\n \"MXCubicAlongArc\",\r\n undefined,\r\n nominalL1, nominalR1,\r\n activeInterval ? activeInterval.clone() : Segment1d.create(0, 1), evaluator);\r\n }\r\n\r\n /**\r\n * Create a polish cubic\r\n * This is y= m*x^3 with\r\n * * m is 1/ (6RL)\r\n * * 1/(6RL) is the leading term of the sine series.\r\n * * L is nominal length\r\n * * R is nominal end radius.\r\n * * x ranges up to the x axis distance for which the polish distance series produces f(x)=L\r\n * * The support class PolishCubicEvaluator has static methods for the distance series and its inversion.\r\n */\r\n public static createPolishCubic(\r\n localToWorld: Transform,\r\n nominalL1: number,\r\n nominalR1: number,\r\n activeInterval?: Segment1d): DirectSpiral3d | undefined {\r\n const evaluator = PolishCubicEvaluator.create(nominalL1, nominalR1);\r\n if (evaluator === undefined)\r\n return undefined;\r\n return new DirectSpiral3d(\r\n localToWorld.clone(),\r\n \"PolishCubic\",\r\n undefined,\r\n nominalL1, nominalR1,\r\n activeInterval ? activeInterval.clone() : Segment1d.create(0, 1), evaluator);\r\n }\r\n\r\n /**\r\n * Create an AustralianRailCorp spiral\r\n * This is y= m*x^3 with\r\n * * x any point on the x axis\r\n * * `fraction` along the spiral goes to `x = fraction * L`\r\n * * m is gamma / (6RL)\r\n * * 1/(6RL) is the leading term of the sine series.\r\n * * `gamma = 2R/sqrt (4RR-LL)` pushes y up a little bit to simulate the lost series terms.\r\n * @param localToWorld\r\n * @param nominalL1\r\n * @param nominalR1\r\n * @param activeInterval\r\n */\r\n public static createAustralianRail(\r\n localToWorld: Transform,\r\n nominalL1: number,\r\n nominalR1: number,\r\n activeInterval?: Segment1d): DirectSpiral3d | undefined {\r\n const evaluator = AustralianRailCorpXYEvaluator.create(nominalL1, nominalR1);\r\n if (evaluator === undefined)\r\n return undefined;\r\n return new DirectSpiral3d(\r\n localToWorld.clone(),\r\n \"AustralianRailCorp\",\r\n undefined,\r\n nominalL1, nominalR1,\r\n activeInterval ? activeInterval.clone() : Segment1d.create(0, 1), evaluator);\r\n }\r\n\r\n public static createDirectHalfCosine(\r\n localToWorld: Transform,\r\n nominalL1: number,\r\n nominalR1: number,\r\n activeInterval?: Segment1d): DirectSpiral3d | undefined {\r\n return new this(localToWorld, \"HalfCosine\", undefined, nominalL1, nominalR1, activeInterval,\r\n new DirectHalfCosineSpiralEvaluator(nominalL1, nominalR1));\r\n }\r\n /**\r\n * Create an Arema spiral clothoid approximation\r\n * * X is 2 terms of the clothoid series as a function of nominal distance along\r\n * * Y is 2 terms f the clothoid series as a function of nominal distance along\r\n * * Remark: This is identical to the ChineseCubic\r\n * @param localToWorld axes with inflection at origin, tangent along x axis\r\n * @param nominalL1 nominal length as used in series LR terms.\r\n * @param nominalR1 nominal final radius as used in series LR terms\r\n * @param activeInterval fractional interval with (0, nominalL1) range for nominal distance along\r\n */\r\n public static createArema(\r\n localToWorld: Transform,\r\n nominalL1: number,\r\n nominalR1: number,\r\n activeInterval?: Segment1d): DirectSpiral3d | undefined {\r\n return this.createTruncatedClothoid(\"Arema\", localToWorld, 2, 2, undefined, nominalL1, nominalR1, activeInterval);\r\n }\r\n\r\n /**\r\n * Create a Chinese clothoid approximation\r\n * * X is 2 terms of the clothoid series as a function of nominal distance along\r\n * * Y is 2 terms f the clothoid series as a function of nominal distance along\r\n * * Remark: This is identical to the Arema spiral\r\n * @param localToWorld axes with inflection at origin, tangent along x axis\r\n * @param nominalL1 nominal length as used in series LR terms.\r\n * @param nominalR1 nominal final radius as used in series LR terms\r\n * @param activeInterval fractional interval with (0, nominalL1) range for nominal distance along\r\n */\r\n public static createChineseCubic(\r\n localToWorld: Transform,\r\n nominalL1: number,\r\n nominalR1: number,\r\n activeInterval?: Segment1d): DirectSpiral3d | undefined {\r\n return this.createTruncatedClothoid(\"ChineseCubic\", localToWorld, 2, 2, undefined, nominalL1, nominalR1, activeInterval);\r\n }\r\n /**\r\n * Create a Western Australian direct spiral.\r\n * * X is 2 terms of the clothoid series as a function of distance along\r\n * * Y is 1 term (cubic in nominal distance along)\r\n * @param localToWorld axes with inflection at origin, tangent along x axis\r\n * @param nominalL1 nominal length as used in series LR terms.\r\n * @param nominalR1 nominal final radius as used in series LR terms\r\n * @param activeInterval fractional interval with (0, nominalL1) range for nominal distance along\r\n */\r\n public static createWesternAustralian(\r\n localToWorld: Transform,\r\n nominalL1: number,\r\n nominalR1: number,\r\n activeInterval?: Segment1d): DirectSpiral3d | undefined {\r\n return this.createTruncatedClothoid(\"WesternAustralian\", localToWorld, 2, 1, undefined, nominalL1, nominalR1, activeInterval);\r\n }\r\n /**\r\n * Create (if possible) a DirectSpiral3d, applying various strict conditions appropriate to the spiral type.\r\n * The parameter list includes extraneous values in order to directly match IntegratedSpiral3d.create, which has greater flexibility about\r\n * mixtures of values.\r\n * * IMPORTANT RESTRICTIONS\r\n * * Direct spirals must have the inflection at the origin of their coordinate system, aligned with the x axis.\r\n * * hence bearing0 = 0\r\n * * hence radius0 = 0\r\n * * bearing1 is ignored\r\n * * radius1 must be given.\r\n * * arcLength must be given,\r\n * @param spiralType one of the types in `DirectSpiralTypeNames`\r\n * @param radius0 radius (or 0 for tangent to line) at start. Must be ZERO or UNDEFINED\r\n * @param radius1 radius (or 0 for tangent to line) at end.\r\n * @param bearing0 bearing, measured CCW from x axis at start. Must be ZERO or UNDEFINED\r\n * @param bearing1 bearing, measured CCW from x axis at end. IGNORED.\r\n * @param fractionInterval optional fractional interval for an \"active\" portion of the curve. if omitted, the full [0,1] is used.\r\n * @param localToWorld placement transform\r\n */\r\n public static createFromLengthAndRadius(\r\n spiralType: string,\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 activeInterval: undefined | Segment1d,\r\n localToWorld: Transform): TransitionSpiral3d | undefined {\r\n if (bearing0 !== undefined && !bearing0.isAlmostZero)\r\n return undefined;\r\n if (radius0 !== undefined && !Geometry.isSmallMetricDistance(radius0))\r\n return undefined;\r\n if (radius1 === undefined || Geometry.isSmallMetricDistance(radius1))\r\n return undefined;\r\n if (arcLength === undefined)\r\n return undefined;\r\n if (Geometry.equalStringNoCase(spiralType, \"Arema\"))\r\n return this.createArema(localToWorld, arcLength, radius1, activeInterval);\r\n if (Geometry.equalStringNoCase(spiralType, \"ChineseCubic\"))\r\n return this.createChineseCubic(localToWorld, arcLength, radius1, activeInterval);\r\n if (Geometry.equalStringNoCase(spiralType, \"JapaneseCubic\"))\r\n return this.createJapaneseCubic(localToWorld, arcLength, radius1, activeInterval);\r\n if (Geometry.equalStringNoCase(spiralType, \"HalfCosine\"))\r\n return this.createDirectHalfCosine(localToWorld, arcLength, radius1, activeInterval);\r\n if (Geometry.equalStringNoCase(spiralType, \"Czech\"))\r\n return this.createCzechCubic(localToWorld, arcLength, radius1, activeInterval);\r\n if (Geometry.equalStringNoCase(spiralType, \"Italian\"))\r\n return this.createItalian(localToWorld, arcLength, radius1, activeInterval);\r\n if (Geometry.equalStringNoCase(spiralType, \"AustralianRailCorp\"))\r\n return this.createAustralianRail(localToWorld, arcLength, radius1, activeInterval);\r\n if (Geometry.equalStringNoCase(spiralType, \"MXCubicAlongArc\"))\r\n return this.createMXCubicAlongArc(localToWorld, arcLength, radius1, activeInterval);\r\n if (Geometry.equalStringNoCase(spiralType, \"WesternAustralian\"))\r\n return this.createWesternAustralian(localToWorld, arcLength, radius1, activeInterval);\r\n if (Geometry.equalStringNoCase(spiralType, \"PolishCubic\"))\r\n return this.createPolishCubic(localToWorld, arcLength, radius1, activeInterval);\r\n return undefined;\r\n }\r\n /** Deep clone of this spiral */\r\n public override clone(): DirectSpiral3d {\r\n return new DirectSpiral3d(\r\n this.localToWorld.clone(),\r\n this._spiralType,\r\n this.designProperties?.clone(),\r\n this._nominalL1,\r\n this._nominalR1,\r\n this._activeFractionInterval?.clone(),\r\n this._evaluator.clone());\r\n }\r\n\r\n /** apply `transform` to this spiral's local to world transform. */\r\n public tryTransformInPlace(transformA: Transform): boolean {\r\n const rigidData = this.applyRigidPartOfTransform(transformA);\r\n if (rigidData !== undefined) {\r\n this._nominalL1 *= rigidData.scale;\r\n this._nominalR1 *= rigidData.scale;\r\n this.evaluator.scaleInPlace(rigidData.scale);\r\n }\r\n this.refreshComputedProperties();\r\n return true;\r\n }\r\n\r\n /** Return the spiral start point. */\r\n public override startPoint(): Point3d { return this.activeStrokes.startPoint(); }\r\n /** return the spiral end point. */\r\n public override endPoint(): Point3d { return this.activeStrokes.endPoint(); }\r\n /** test if the local to world transform places the spiral xy plane into `plane` */\r\n public isInPlane(plane: Plane3dByOriginAndUnitNormal): boolean {\r\n return plane.isPointInPlane(this.localToWorld.origin as Point3d)\r\n && Geometry.isSameCoordinate(0.0, this.localToWorld.matrix.dotColumnX(plane.getNormalRef()))\r\n && Geometry.isSameCoordinate(0.0, this.localToWorld.matrix.dotColumnY(plane.getNormalRef()));\r\n }\r\n /** Return quick length of the spiral.\r\n * The tangent vector of a true clothoid is length 1 everywhere, so simple proportion of nominalL1 is a good approximation.\r\n */\r\n public quickLength() {\r\n const distanceData = this._globalStrokes.packedUVParams!;\r\n const n = distanceData.length;\r\n return distanceData.getYAtUncheckedPointIndex(n - 1);\r\n }\r\n /** Return length of the spiral.\r\n * * True length is stored at back of uvParams . . .\r\n */\r\n // use the generic integrator ... public override curveLength() { return this.quickLength(); }\r\n /** Test if `other` is an instance of `TransitionSpiral3d` */\r\n public isSameGeometryClass(other: any): boolean { return other instanceof DirectSpiral3d; }\r\n /** Add strokes from this spiral to `dest`.\r\n * * Linestrings will usually stroke as just their points.\r\n * * If maxEdgeLength is given, this will sub-stroke within the linestring -- not what we want.\r\n */\r\n public emitStrokes(dest: LineString3d, options?: StrokeOptions): void { this.activeStrokes.emitStrokes(dest, options); }\r\n /** emit stroke fragments to `dest` handler. */\r\n public emitStrokableParts(dest: IStrokeHandler, options?: StrokeOptions): void {\r\n const n = this.computeStrokeCountForOptions(options);\r\n const activeStrokes = this.activeStrokes;\r\n dest.startParentCurvePrimitive(this);\r\n\r\n // hack: specify the extended range so we can compute length of an extended spiral\r\n let globalFraction0 = 0.0;\r\n let globalFraction1 = 1.0;\r\n if (dest instanceof CurveLengthContext) {\r\n if (dest.getFraction0 < 0.0)\r\n globalFraction0 = dest.getFraction0;\r\n if (dest.getFraction1 > 1.0)\r\n globalFraction1 = dest.getFraction1;\r\n }\r\n\r\n if (n <= activeStrokes.numPoints())\r\n dest.announceIntervalForUniformStepStrokes(this, 2 * activeStrokes.numPoints(), globalFraction0, globalFraction1);\r\n else\r\n dest.announceIntervalForUniformStepStrokes(this, n, globalFraction0, globalFraction1);\r\n\r\n dest.endParentCurvePrimitive(this);\r\n }\r\n\r\n /**\r\n * return the stroke count required for given options.\r\n * @param options StrokeOptions that determine count\r\n */\r\n\r\n public computeStrokeCountForOptions(options?: StrokeOptions): number {\r\n let numStroke;\r\n const nominalRadians = this._nominalL1 / (2.0 * this._nominalR1);\r\n if (options) {\r\n const rMin = Math.abs(this._nominalR1);\r\n numStroke = options.applyTolerancesToArc(rMin, nominalRadians);\r\n numStroke = options.applyMaxEdgeLength(numStroke, this.quickLength());\r\n numStroke = options.applyMinStrokesPerPrimitive(numStroke);\r\n } else {\r\n numStroke = StrokeOptions.applyAngleTol(undefined, 4, nominalRadians, 0.02);\r\n }\r\n numStroke = Math.ceil(this._activeFractionInterval.absoluteDelta() * numStroke);\r\n return numStroke;\r\n }\r\n\r\n /** Reverse the active interval and active strokes.\r\n * * Primary defining data remains unchanged !!!\r\n */\r\n\r\n public reverseInPlace(): void {\r\n this._activeFractionInterval.reverseInPlace();\r\n if (this._activeStrokes === undefined)\r\n this._activeStrokes = this._globalStrokes.clone();\r\n this._activeStrokes.reverseInPlace();\r\n }\r\n /** Evaluate curve point with respect to fraction. */\r\n public fractionToPoint(activeFraction: number, result?: Point3d): Point3d {\r\n const globalFraction = this._activeFractionInterval.fractionToPoint(activeFraction);\r\n result = this._evaluator.fractionToPoint(globalFraction, result);\r\n this.localToWorld.multiplyPoint3d(result, result);\r\n return result;\r\n }\r\n /** Evaluate curve point and derivative with respect to fraction. */\r\n public fractionToPointAndDerivative(activeFraction: number, result?: Ray3d): Ray3d {\r\n const globalFraction = this._activeFractionInterval.fractionToPoint(activeFraction);\r\n result = this._evaluator.fractionToPointAndDerivative(globalFraction, result);\r\n result.direction.scaleInPlace(this._activeFractionInterval.signedDelta());\r\n result.transformInPlace(this.localToWorld);\r\n return result;\r\n }\r\n\r\n /** Return a plane with\r\n *\r\n * * origin at fractional position along the curve\r\n * * vectorU is the first derivative, i.e. tangent vector with length equal to the rate of change with respect to the fraction.\r\n * * vectorV is the second derivative, i.e.derivative of vectorU.\r\n */\r\n\r\n public fractionToPointAnd2Derivatives(activeFraction: number, result?: Plane3dByOriginAndVectors): Plane3dByOriginAndVectors | undefined {\r\n const globalFraction = this._activeFractionInterval.fractionToPoint(activeFraction);\r\n result = this._evaluator.fractionToPointAnd2Derivatives(globalFraction, result);\r\n const a = this._activeFractionInterval.signedDelta();\r\n result.vectorU.scaleInPlace(a);\r\n result.vectorV.scaleInPlace(a * a);\r\n result.transformInPlace(this.localToWorld);\r\n return result;\r\n }\r\n /** Second step of double dispatch: call `handler.handleTransitionSpiral(this)` */\r\n public dispatchToGeometryHandler(handler: GeometryHandler): any {\r\n return handler.handleTransitionSpiral(this);\r\n }\r\n /** compare various coordinate quantities */\r\n public override isAlmostEqual(other: any): boolean {\r\n if (other instanceof DirectSpiral3d) {\r\n return Geometry.isSameCoordinate(this._nominalL1, other._nominalL1)\r\n && Geometry.isSameCoordinate(this._nominalR1, other._nominalR1)\r\n && this.localToWorld.isAlmostEqual(other.localToWorld)\r\n && this._activeFractionInterval.isAlmostEqual(other._activeFractionInterval)\r\n && this._evaluator.isAlmostEqual(other._evaluator);\r\n }\r\n return false;\r\n }\r\n}\r\n"]}
1
+ {"version":3,"file":"DirectSpiral3d.js","sourceRoot":"","sources":["../../../../src/curve/spiral/DirectSpiral3d.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AACH,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAO1C,OAAO,EAAE,SAAS,EAAE,MAAM,4BAA4B,CAAC;AAEvD,OAAO,EAAE,kBAAkB,EAAE,MAAM,wCAAwC,CAAC;AAC5E,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC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a,CAAC,KAAK,CAAC,uBAAuB,CAAC;mBACzE,IAAI,CAAC,UAAU,CAAC,aAAa,CAAC,KAAK,CAAC,UAAU,CAAC,CAAC;QACvD,CAAC;QACD,OAAO,KAAK,CAAC;IACf,CAAC;CACF","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module Curve\n */\nimport { Geometry } from \"../../Geometry\";\nimport { Angle } from \"../../geometry3d/Angle\";\nimport { GeometryHandler, IStrokeHandler } from \"../../geometry3d/GeometryHandler\";\nimport { Plane3dByOriginAndUnitNormal } from \"../../geometry3d/Plane3dByOriginAndUnitNormal\";\nimport { Plane3dByOriginAndVectors } from \"../../geometry3d/Plane3dByOriginAndVectors\";\nimport { Point3d } from \"../../geometry3d/Point3dVector3d\";\nimport { Ray3d } from \"../../geometry3d/Ray3d\";\nimport { Segment1d } from \"../../geometry3d/Segment1d\";\nimport { Transform } from \"../../geometry3d/Transform\";\nimport { CurveLengthContext } from \"../internalContexts/CurveLengthContext\";\nimport { LineString3d } from \"../LineString3d\";\nimport { StrokeOptions } from \"../StrokeOptions\";\nimport { AustralianRailCorpXYEvaluator } from \"./AustralianRailCorpXYEvaluator\";\nimport { ClothoidSeriesRLEvaluator } from \"./ClothoidSeries\";\nimport { CzechSpiralEvaluator, ItalianSpiralEvaluator } from \"./CzechSpiralEvaluator\";\nimport { DirectHalfCosineSpiralEvaluator } from \"./DirectHalfCosineSpiralEvaluator\";\nimport { MXCubicAlongArcEvaluator } from \"./MXCubicAlongArcSpiralEvaluator\";\nimport { PolishCubicEvaluator } from \"./PolishCubicSpiralEvaluator\";\nimport { TransitionConditionalProperties } from \"./TransitionConditionalProperties\";\nimport { TransitionSpiral3d } from \"./TransitionSpiral3d\";\nimport { XYCurveEvaluator } from \"./XYCurveEvaluator\";\n\n/**\n* DirectSpiral3d acts like a TransitionSpiral3d for serialization purposes, but implements spiral types that have \"direct\" xy calculations without the integrations required\n* for IntegratedSpiral3d.\n* * Each DirectSpiral3d carries an XYCurveEvaluator to give it specialized behavior.\n* * Direct spirals that flow through serialization to native imodel02 are create with these static methods:\n* * createArema\n* * createJapaneseCubic\n* * createAustralianRail\n* * createDirectHalfCosine\n* * createChineseCubic\n* * createCzechCubic\n* * createPolishCubic\n* * createItalian\n* * createWesternAustralian\n* @public\n*/\nexport class DirectSpiral3d extends TransitionSpiral3d {\n\n /** String name for schema properties */\n\n public readonly curvePrimitiveType = \"transitionSpiral\";\n\n /** stroked approximation of entire spiral. This is AFTER the localToWorld transform ... */\n private _globalStrokes: LineString3d;\n /** stroked approximation of active spiral. This is AFTER the localToWorld transfomr ...\n * * Same count as global -- possibly overly fine, but it gives some consistency between same clothoid constructed as partial versus complete.\n * * If no trimming, this points to the same place as the _globalStrokes !!! Don't double transform!!!\n */\n private _activeStrokes?: LineString3d;\n /** Return the internal stroked form of the (possibly partial) spiral */\n public get activeStrokes(): LineString3d { return this._activeStrokes !== undefined ? this._activeStrokes : this._globalStrokes; }\n\n private _nominalL1: number;\n private _nominalR1: number;\n private _evaluator: XYCurveEvaluator;\n\n /** Return the nominal end radius. */\n public get nominalR1(): number { return this._nominalR1; }\n /** Return the nominal distance from inflection to endpoint. */\n public get nominalL1(): number { return this._nominalL1; }\n /** Return the nominal end curvature */\n public get nominalCurvature1(): number { return TransitionSpiral3d.radiusToCurvature(this._nominalR1); }\n /** Return the low level evaluator\n * @internal\n */\n public get evaluator(): XYCurveEvaluator { return this._evaluator; }\n\n // constructor demands radius1 and distance1 for nominal construction.\n // caller is responsible for managing intervals of partial spiral\n constructor(\n localToWorld: Transform,\n spiralType: string | undefined,\n originalProperties: TransitionConditionalProperties | undefined,\n nominalL1: number,\n nominalR1: number,\n activeFractionInterval: Segment1d | undefined,\n evaluator: XYCurveEvaluator) {\n super(spiralType, localToWorld, activeFractionInterval, originalProperties);\n this._nominalL1 = nominalL1;\n this._nominalR1 = nominalR1;\n this._evaluator = evaluator;\n this._globalStrokes = LineString3d.create();\n this._activeStrokes = LineString3d.create();\n // initialize for compiler -- but this will be recomputed in refreshComputeProperties ...\n this.refreshComputedProperties();\n }\n /**\n * Compute stroke data in an interval.\n * @param strokes strokes to clear and refill.\n * @param fraction0 start fraction\n * @param fraction1 end fraction\n */\n private computeStrokes(strokes: LineString3d, fractionA: number, fractionB: number, numInterval: number, applyLocalToWorld: boolean = true) {\n if (numInterval < 1)\n numInterval = 1;\n strokes.clear();\n strokes.ensureEmptyUVParams();\n strokes.ensureEmptyFractions();\n const distances = strokes.packedUVParams!;\n const nominalIntervalLength = Math.abs(fractionB - fractionA) * this._nominalL1;\n for (let i = 0; i <= numInterval; i++) {\n const fraction = Geometry.interpolate(fractionA, i / numInterval, fractionB);\n const nominalDistanceAlong = fraction * nominalIntervalLength;\n strokes.packedPoints.pushXYZ(this._evaluator.fractionToX(fraction),\n this._evaluator.fractionToY(fraction), 0);\n distances.pushXY(fraction, nominalDistanceAlong); // the second distance will be updated below\n }\n if (applyLocalToWorld)\n strokes.tryTransformInPlace (this._localToWorld);\n let fraction0 = distances.getXAtUncheckedPointIndex(0);\n let trueDistance0 = distances.getYAtUncheckedPointIndex(0); // whatever was assigned as start distance is fine\n let trueDistance1, fraction1;\n for (let i = 1; i <= numInterval; i++) {\n fraction1 = distances.getXAtUncheckedPointIndex(i);\n trueDistance1 = trueDistance0 + this._evaluator.integrateDistanceBetweenFractions(fraction0, fraction1);\n distances.setXYAtCheckedPointIndex(i, fraction1, trueDistance1);\n fraction0 = fraction1;\n trueDistance0 = trueDistance1;\n }\n\n }\n /** Recompute strokes */\n public override refreshComputedProperties() {\n const sweepRadians = this.nominalL1 / (2.0 * this.nominalR1);\n const radiansStep = 0.02;\n const numInterval = StrokeOptions.applyAngleTol(undefined, 4, sweepRadians, radiansStep);\n this.computeStrokes(this._globalStrokes, 0, 1, numInterval);\n const numActiveInterval = Math.ceil(this._activeFractionInterval.absoluteDelta() * numInterval);\n this._activeStrokes = LineString3d.create();\n this.computeStrokes(this._activeStrokes, this._activeFractionInterval.x0, this._activeFractionInterval.x1,\n numActiveInterval);\n }\n /**\n * Create a spiral object which uses numXTerm terms from the clothoid X series and numYTerm from the clothoid Y series.\n * @param numXTerm number of terms to use from X series\n * @param numYTerm number of terms to use from Y series\n * @param localToWorld placement frame. Inflection point is at origin, initial direction is along x axis.\n * @param nominalL1 design distance from inflection to end point.\n * @param nominalR1 design radius at end point.\n * @param activeInterval active interval (as fractions of nominalL1 !!!)\n */\n public static createTruncatedClothoid(\n spiralType: string,\n localToWorld: Transform,\n numXTerm: number, numYTerm: number,\n originalProperties: TransitionConditionalProperties | undefined,\n nominalL1: number, nominalR1: number,\n activeInterval: Segment1d | undefined): DirectSpiral3d | undefined {\n if (numXTerm < 1)\n numXTerm = 1;\n if (numYTerm < 1)\n numYTerm = 1;\n const evaluator = new ClothoidSeriesRLEvaluator(nominalL1, 1.0 / (2.0 * nominalL1 * nominalR1), numXTerm, numYTerm);\n return new DirectSpiral3d(\n localToWorld.clone(),\n spiralType,\n originalProperties,\n nominalL1, nominalR1,\n activeInterval ? activeInterval.clone() : Segment1d.create(0, 1), evaluator);\n }\n /**\n * Create an Japanese spiral clothoid approximation\n * * X is 1 terms of the clothoid series as a function of nominal distance along.\n * * Y is 1 terms f the clothoid series as a function of nominal distance along.\n * * Remark: This is identical to the ChineseCubic\n * @param localToWorld axes with inflection at origin, tangent along x axis\n * @param nominalL1 nominal length as used in series LR terms.\n * @param nominalR1 nominal final radius as used in series LR terms\n * @param activeInterval fractional interval with (0, nominalL1) range for nominal distance along\n */\n public static createJapaneseCubic(\n localToWorld: Transform,\n nominalL1: number,\n nominalR1: number,\n activeInterval?: Segment1d): DirectSpiral3d | undefined {\n return this.createTruncatedClothoid(\"JapaneseCubic\", localToWorld, 1, 1, undefined, nominalL1, nominalR1, activeInterval);\n }\n /**\n * Create a czech cubic.\n * This is y= m*x^3 with\n * * x any point on the x axis\n * * `fraction` along the spiral goes to `x = fraction * L`\n * * m is gamma / (6RL)\n * * 1/(6RL) is the leading term of the sine series.\n * * `gamma = 2R/sqrt (4RR-LL)` pushes y up a little bit to simulate the lost series terms.\n * @param localToWorld\n * @param nominalLx nominal length along x axis\n * @param nominalR1\n * @param activeInterval\n */\n public static createCzechCubic(\n localToWorld: Transform,\n nominalLx: number,\n nominalR1: number,\n activeInterval?: Segment1d): DirectSpiral3d | undefined {\n const evaluator = CzechSpiralEvaluator.create(nominalLx, nominalR1);\n if (evaluator === undefined)\n return undefined;\n return new DirectSpiral3d(\n localToWorld.clone(),\n \"Czech\",\n undefined,\n nominalLx, nominalR1,\n activeInterval ? activeInterval.clone() : Segment1d.create(0, 1), evaluator);\n }\n /**\n * Create an italian spiral\n * This is y= m*x^3 with\n * * x any point on the x axis\n * * `fraction` along the spiral goes to `x = fraction * L`\n * * m is gamma / (6RL)\n * * 1/(6RL) is the leading term of the sine series.\n * * `gamma = 2R/sqrt (4RR-LL)` pushes y up a little bit to simulate the lost series terms.\n * * L in gamma and m is the\n * @param localToWorld\n * @param nominalL1 nominal length along the spiral\n * @param nominalR1\n * @param activeInterval\n */\n public static createItalian(\n localToWorld: Transform,\n nominalL1: number,\n nominalR1: number,\n activeInterval?: Segment1d): DirectSpiral3d | undefined {\n const evaluator = ItalianSpiralEvaluator.create(nominalL1, nominalR1);\n if (evaluator === undefined)\n return undefined;\n return new DirectSpiral3d(\n localToWorld.clone(),\n \"Italian\",\n undefined,\n nominalL1, nominalR1,\n activeInterval ? activeInterval.clone() : Segment1d.create(0, 1), evaluator);\n }\n\n /**\n * Create an MX Cubic whose nominal length is close to along the curve.\n * This is y= m*x^3 with\n * * m is 1/ (6RL1)\n * * 1/(6RL) is the leading term of the sine series.\n * * L1 is an along-the-x-axis distance that is slightly LESS THAN the nominal length\n * * x is axis position that is slightly LESS than nominal distance along\n * * L1, x use the approximation `x = s * ( 1 - s^4/ (40 R R L L))\n * @param localToWorld\n * @param nominalL1\n * @param nominalR1\n * @param activeInterval\n */\n public static createMXCubicAlongArc(\n localToWorld: Transform,\n nominalL1: number,\n nominalR1: number,\n activeInterval?: Segment1d): DirectSpiral3d | undefined {\n const evaluator = MXCubicAlongArcEvaluator.create(nominalL1, nominalR1);\n if (evaluator === undefined)\n return undefined;\n return new DirectSpiral3d(\n localToWorld.clone(),\n \"MXCubicAlongArc\",\n undefined,\n nominalL1, nominalR1,\n activeInterval ? activeInterval.clone() : Segment1d.create(0, 1), evaluator);\n }\n\n /**\n * Create a polish cubic\n * This is y= m*x^3 with\n * * m is 1/ (6RL)\n * * 1/(6RL) is the leading term of the sine series.\n * * L is nominal length\n * * R is nominal end radius.\n * * x ranges up to the x axis distance for which the polish distance series produces f(x)=L\n * * The support class PolishCubicEvaluator has static methods for the distance series and its inversion.\n */\n public static createPolishCubic(\n localToWorld: Transform,\n nominalL1: number,\n nominalR1: number,\n activeInterval?: Segment1d): DirectSpiral3d | undefined {\n const evaluator = PolishCubicEvaluator.create(nominalL1, nominalR1);\n if (evaluator === undefined)\n return undefined;\n return new DirectSpiral3d(\n localToWorld.clone(),\n \"PolishCubic\",\n undefined,\n nominalL1, nominalR1,\n activeInterval ? activeInterval.clone() : Segment1d.create(0, 1), evaluator);\n }\n\n /**\n * Create an AustralianRailCorp spiral\n * This is y= m*x^3 with\n * * x any point on the x axis\n * * `fraction` along the spiral goes to `x = fraction * L`\n * * m is gamma / (6RL)\n * * 1/(6RL) is the leading term of the sine series.\n * * `gamma = 2R/sqrt (4RR-LL)` pushes y up a little bit to simulate the lost series terms.\n * @param localToWorld\n * @param nominalL1\n * @param nominalR1\n * @param activeInterval\n */\n public static createAustralianRail(\n localToWorld: Transform,\n nominalL1: number,\n nominalR1: number,\n activeInterval?: Segment1d): DirectSpiral3d | undefined {\n const evaluator = AustralianRailCorpXYEvaluator.create(nominalL1, nominalR1);\n if (evaluator === undefined)\n return undefined;\n return new DirectSpiral3d(\n localToWorld.clone(),\n \"AustralianRailCorp\",\n undefined,\n nominalL1, nominalR1,\n activeInterval ? activeInterval.clone() : Segment1d.create(0, 1), evaluator);\n }\n\n public static createDirectHalfCosine(\n localToWorld: Transform,\n nominalL1: number,\n nominalR1: number,\n activeInterval?: Segment1d): DirectSpiral3d | undefined {\n return new this(localToWorld, \"HalfCosine\", undefined, nominalL1, nominalR1, activeInterval,\n new DirectHalfCosineSpiralEvaluator(nominalL1, nominalR1));\n }\n /**\n * Create an Arema spiral clothoid approximation\n * * X is 2 terms of the clothoid series as a function of nominal distance along\n * * Y is 2 terms f the clothoid series as a function of nominal distance along\n * * Remark: This is identical to the ChineseCubic\n * @param localToWorld axes with inflection at origin, tangent along x axis\n * @param nominalL1 nominal length as used in series LR terms.\n * @param nominalR1 nominal final radius as used in series LR terms\n * @param activeInterval fractional interval with (0, nominalL1) range for nominal distance along\n */\n public static createArema(\n localToWorld: Transform,\n nominalL1: number,\n nominalR1: number,\n activeInterval?: Segment1d): DirectSpiral3d | undefined {\n return this.createTruncatedClothoid(\"Arema\", localToWorld, 2, 2, undefined, nominalL1, nominalR1, activeInterval);\n }\n\n /**\n * Create a Chinese clothoid approximation\n * * X is 2 terms of the clothoid series as a function of nominal distance along\n * * Y is 2 terms f the clothoid series as a function of nominal distance along\n * * Remark: This is identical to the Arema spiral\n * @param localToWorld axes with inflection at origin, tangent along x axis\n * @param nominalL1 nominal length as used in series LR terms.\n * @param nominalR1 nominal final radius as used in series LR terms\n * @param activeInterval fractional interval with (0, nominalL1) range for nominal distance along\n */\n public static createChineseCubic(\n localToWorld: Transform,\n nominalL1: number,\n nominalR1: number,\n activeInterval?: Segment1d): DirectSpiral3d | undefined {\n return this.createTruncatedClothoid(\"ChineseCubic\", localToWorld, 2, 2, undefined, nominalL1, nominalR1, activeInterval);\n }\n /**\n * Create a Western Australian direct spiral.\n * * X is 2 terms of the clothoid series as a function of distance along\n * * Y is 1 term (cubic in nominal distance along)\n * @param localToWorld axes with inflection at origin, tangent along x axis\n * @param nominalL1 nominal length as used in series LR terms.\n * @param nominalR1 nominal final radius as used in series LR terms\n * @param activeInterval fractional interval with (0, nominalL1) range for nominal distance along\n */\n public static createWesternAustralian(\n localToWorld: Transform,\n nominalL1: number,\n nominalR1: number,\n activeInterval?: Segment1d): DirectSpiral3d | undefined {\n return this.createTruncatedClothoid(\"WesternAustralian\", localToWorld, 2, 1, undefined, nominalL1, nominalR1, activeInterval);\n }\n /**\n * Create (if possible) a DirectSpiral3d, applying various strict conditions appropriate to the spiral type.\n * The parameter list includes extraneous values in order to directly match IntegratedSpiral3d.create, which has greater flexibility about\n * mixtures of values.\n * * IMPORTANT RESTRICTIONS\n * * Direct spirals must have the inflection at the origin of their coordinate system, aligned with the x axis.\n * * hence bearing0 = 0\n * * hence radius0 = 0\n * * bearing1 is ignored\n * * radius1 must be given.\n * * arcLength must be given,\n * @param spiralType one of the types in `DirectSpiralTypeNames`\n * @param radius0 radius (or 0 for tangent to line) at start. Must be ZERO or UNDEFINED\n * @param radius1 radius (or 0 for tangent to line) at end.\n * @param bearing0 bearing, measured CCW from x axis at start. Must be ZERO or UNDEFINED\n * @param bearing1 bearing, measured CCW from x axis at end. IGNORED.\n * @param fractionInterval optional fractional interval for an \"active\" portion of the curve. if omitted, the full [0,1] is used.\n * @param localToWorld placement transform\n */\n public static createFromLengthAndRadius(\n spiralType: string,\n radius0: number | undefined,\n radius1: number | undefined,\n bearing0: Angle | undefined,\n _bearing1: Angle | undefined,\n arcLength: number | undefined,\n activeInterval: undefined | Segment1d,\n localToWorld: Transform): TransitionSpiral3d | undefined {\n if (bearing0 !== undefined && !bearing0.isAlmostZero)\n return undefined;\n if (radius0 !== undefined && !Geometry.isSmallMetricDistance(radius0))\n return undefined;\n if (radius1 === undefined || Geometry.isSmallMetricDistance(radius1))\n return undefined;\n if (arcLength === undefined)\n return undefined;\n if (Geometry.equalStringNoCase(spiralType, \"Arema\"))\n return this.createArema(localToWorld, arcLength, radius1, activeInterval);\n if (Geometry.equalStringNoCase(spiralType, \"ChineseCubic\"))\n return this.createChineseCubic(localToWorld, arcLength, radius1, activeInterval);\n if (Geometry.equalStringNoCase(spiralType, \"JapaneseCubic\"))\n return this.createJapaneseCubic(localToWorld, arcLength, radius1, activeInterval);\n if (Geometry.equalStringNoCase(spiralType, \"HalfCosine\"))\n return this.createDirectHalfCosine(localToWorld, arcLength, radius1, activeInterval);\n if (Geometry.equalStringNoCase(spiralType, \"Czech\"))\n return this.createCzechCubic(localToWorld, arcLength, radius1, activeInterval);\n if (Geometry.equalStringNoCase(spiralType, \"Italian\"))\n return this.createItalian(localToWorld, arcLength, radius1, activeInterval);\n if (Geometry.equalStringNoCase(spiralType, \"AustralianRailCorp\"))\n return this.createAustralianRail(localToWorld, arcLength, radius1, activeInterval);\n if (Geometry.equalStringNoCase(spiralType, \"MXCubicAlongArc\"))\n return this.createMXCubicAlongArc(localToWorld, arcLength, radius1, activeInterval);\n if (Geometry.equalStringNoCase(spiralType, \"WesternAustralian\"))\n return this.createWesternAustralian(localToWorld, arcLength, radius1, activeInterval);\n if (Geometry.equalStringNoCase(spiralType, \"PolishCubic\"))\n return this.createPolishCubic(localToWorld, arcLength, radius1, activeInterval);\n return undefined;\n }\n /** Deep clone of this spiral */\n public override clone(): DirectSpiral3d {\n return new DirectSpiral3d(\n this.localToWorld.clone(),\n this._spiralType,\n this.designProperties?.clone(),\n this._nominalL1,\n this._nominalR1,\n this._activeFractionInterval?.clone(),\n this._evaluator.clone());\n }\n\n /** apply `transform` to this spiral's local to world transform. */\n public tryTransformInPlace(transformA: Transform): boolean {\n const rigidData = this.applyRigidPartOfTransform(transformA);\n if (rigidData !== undefined) {\n this._nominalL1 *= rigidData.scale;\n this._nominalR1 *= rigidData.scale;\n this.evaluator.scaleInPlace(rigidData.scale);\n }\n this.refreshComputedProperties();\n return true;\n }\n\n /** Return the spiral start point. */\n public override startPoint(): Point3d { return this.activeStrokes.startPoint(); }\n /** return the spiral end point. */\n public override endPoint(): Point3d { return this.activeStrokes.endPoint(); }\n /** test if the local to world transform places the spiral xy plane into `plane` */\n public isInPlane(plane: Plane3dByOriginAndUnitNormal): boolean {\n return plane.isPointInPlane(this.localToWorld.origin as Point3d)\n && Geometry.isSameCoordinate(0.0, this.localToWorld.matrix.dotColumnX(plane.getNormalRef()))\n && Geometry.isSameCoordinate(0.0, this.localToWorld.matrix.dotColumnY(plane.getNormalRef()));\n }\n /** Return quick length of the spiral.\n * The tangent vector of a true clothoid is length 1 everywhere, so simple proportion of nominalL1 is a good approximation.\n */\n public quickLength() {\n const distanceData = this._globalStrokes.packedUVParams!;\n const n = distanceData.length;\n return distanceData.getYAtUncheckedPointIndex(n - 1);\n }\n /** Return length of the spiral.\n * * True length is stored at back of uvParams . . .\n */\n // use the generic integrator ... public override curveLength() { return this.quickLength(); }\n /** Test if `other` is an instance of `TransitionSpiral3d` */\n public isSameGeometryClass(other: any): boolean { return other instanceof DirectSpiral3d; }\n /** Add strokes from this spiral to `dest`.\n * * Linestrings will usually stroke as just their points.\n * * If maxEdgeLength is given, this will sub-stroke within the linestring -- not what we want.\n */\n public emitStrokes(dest: LineString3d, options?: StrokeOptions): void { this.activeStrokes.emitStrokes(dest, options); }\n /** emit stroke fragments to `dest` handler. */\n public emitStrokableParts(dest: IStrokeHandler, options?: StrokeOptions): void {\n const n = this.computeStrokeCountForOptions(options);\n const activeStrokes = this.activeStrokes;\n dest.startParentCurvePrimitive(this);\n\n // hack: specify the extended range so we can compute length of an extended spiral\n let globalFraction0 = 0.0;\n let globalFraction1 = 1.0;\n if (dest instanceof CurveLengthContext) {\n if (dest.getFraction0 < 0.0)\n globalFraction0 = dest.getFraction0;\n if (dest.getFraction1 > 1.0)\n globalFraction1 = dest.getFraction1;\n }\n\n if (n <= activeStrokes.numPoints())\n dest.announceIntervalForUniformStepStrokes(this, 2 * activeStrokes.numPoints(), globalFraction0, globalFraction1);\n else\n dest.announceIntervalForUniformStepStrokes(this, n, globalFraction0, globalFraction1);\n\n dest.endParentCurvePrimitive(this);\n }\n\n /**\n * return the stroke count required for given options.\n * @param options StrokeOptions that determine count\n */\n\n public computeStrokeCountForOptions(options?: StrokeOptions): number {\n let numStroke;\n const nominalRadians = this._nominalL1 / (2.0 * this._nominalR1);\n if (options) {\n const rMin = Math.abs(this._nominalR1);\n numStroke = options.applyTolerancesToArc(rMin, nominalRadians);\n numStroke = options.applyMaxEdgeLength(numStroke, this.quickLength());\n numStroke = options.applyMinStrokesPerPrimitive(numStroke);\n } else {\n numStroke = StrokeOptions.applyAngleTol(undefined, 4, nominalRadians, 0.02);\n }\n numStroke = Math.ceil(this._activeFractionInterval.absoluteDelta() * numStroke);\n return numStroke;\n }\n\n /** Reverse the active interval and active strokes.\n * * Primary defining data remains unchanged !!!\n */\n\n public reverseInPlace(): void {\n this._activeFractionInterval.reverseInPlace();\n if (this._activeStrokes === undefined)\n this._activeStrokes = this._globalStrokes.clone();\n this._activeStrokes.reverseInPlace();\n }\n /** Evaluate curve point with respect to fraction. */\n public fractionToPoint(activeFraction: number, result?: Point3d): Point3d {\n const globalFraction = this._activeFractionInterval.fractionToPoint(activeFraction);\n result = this._evaluator.fractionToPoint(globalFraction, result);\n this.localToWorld.multiplyPoint3d(result, result);\n return result;\n }\n /** Evaluate curve point and derivative with respect to fraction. */\n public fractionToPointAndDerivative(activeFraction: number, result?: Ray3d): Ray3d {\n const globalFraction = this._activeFractionInterval.fractionToPoint(activeFraction);\n result = this._evaluator.fractionToPointAndDerivative(globalFraction, result);\n result.direction.scaleInPlace(this._activeFractionInterval.signedDelta());\n result.transformInPlace(this.localToWorld);\n return result;\n }\n\n /** Return a plane with\n *\n * * origin at fractional position along the curve\n * * vectorU is the first derivative, i.e. tangent vector with length equal to the rate of change with respect to the fraction.\n * * vectorV is the second derivative, i.e.derivative of vectorU.\n */\n\n public fractionToPointAnd2Derivatives(activeFraction: number, result?: Plane3dByOriginAndVectors): Plane3dByOriginAndVectors | undefined {\n const globalFraction = this._activeFractionInterval.fractionToPoint(activeFraction);\n result = this._evaluator.fractionToPointAnd2Derivatives(globalFraction, result);\n const a = this._activeFractionInterval.signedDelta();\n result.vectorU.scaleInPlace(a);\n result.vectorV.scaleInPlace(a * a);\n result.transformInPlace(this.localToWorld);\n return result;\n }\n /** Second step of double dispatch: call `handler.handleTransitionSpiral(this)` */\n public dispatchToGeometryHandler(handler: GeometryHandler): any {\n return handler.handleTransitionSpiral(this);\n }\n /** compare various coordinate quantities */\n public override isAlmostEqual(other: any): boolean {\n if (other instanceof DirectSpiral3d) {\n return Geometry.isSameCoordinate(this._nominalL1, other._nominalL1)\n && Geometry.isSameCoordinate(this._nominalR1, other._nominalR1)\n && this.localToWorld.isAlmostEqual(other.localToWorld)\n && this._activeFractionInterval.isAlmostEqual(other._activeFractionInterval)\n && this._evaluator.isAlmostEqual(other._evaluator);\n }\n return false;\n }\n}\n"]}