@itwin/core-geometry 5.8.0-dev.2 → 5.8.0-dev.20

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 (576) hide show
  1. package/CHANGELOG.md +26 -1
  2. package/lib/cjs/Constant.js.map +1 -1
  3. package/lib/cjs/Geometry.d.ts +24 -14
  4. package/lib/cjs/Geometry.d.ts.map +1 -1
  5. package/lib/cjs/Geometry.js +34 -14
  6. package/lib/cjs/Geometry.js.map +1 -1
  7. package/lib/cjs/bspline/AkimaCurve3d.js.map +1 -1
  8. package/lib/cjs/bspline/BSpline1dNd.js.map +1 -1
  9. package/lib/cjs/bspline/BSplineCurve.js.map +1 -1
  10. package/lib/cjs/bspline/BSplineCurve3dH.js.map +1 -1
  11. package/lib/cjs/bspline/BSplineCurveOps.js.map +1 -1
  12. package/lib/cjs/bspline/BSplineSurface.js.map +1 -1
  13. package/lib/cjs/bspline/Bezier1dNd.js.map +1 -1
  14. package/lib/cjs/bspline/BezierCurve3d.js.map +1 -1
  15. package/lib/cjs/bspline/BezierCurve3dH.js.map +1 -1
  16. package/lib/cjs/bspline/BezierCurveBase.js.map +1 -1
  17. package/lib/cjs/bspline/InterpolationCurve3d.js.map +1 -1
  18. package/lib/cjs/bspline/KnotVector.js.map +1 -1
  19. package/lib/cjs/bspline/SurfaceLocationDetail.js.map +1 -1
  20. package/lib/cjs/clipping/AlternatingConvexClipTree.js.map +1 -1
  21. package/lib/cjs/clipping/BooleanClipFactory.js.map +1 -1
  22. package/lib/cjs/clipping/BooleanClipNode.js.map +1 -1
  23. package/lib/cjs/clipping/ClipPlane.js.map +1 -1
  24. package/lib/cjs/clipping/ClipPrimitive.js.map +1 -1
  25. package/lib/cjs/clipping/ClipUtils.js.map +1 -1
  26. package/lib/cjs/clipping/ClipVector.js.map +1 -1
  27. package/lib/cjs/clipping/ConvexClipPlaneSet.js.map +1 -1
  28. package/lib/cjs/clipping/UnionOfConvexClipPlaneSets.js.map +1 -1
  29. package/lib/cjs/clipping/internalContexts/LineStringOffsetClipperContext.js.map +1 -1
  30. package/lib/cjs/core-geometry.d.ts +1 -0
  31. package/lib/cjs/core-geometry.d.ts.map +1 -1
  32. package/lib/cjs/core-geometry.js +1 -0
  33. package/lib/cjs/core-geometry.js.map +1 -1
  34. package/lib/cjs/curve/Arc3d.d.ts +4 -0
  35. package/lib/cjs/curve/Arc3d.d.ts.map +1 -1
  36. package/lib/cjs/curve/Arc3d.js +14 -0
  37. package/lib/cjs/curve/Arc3d.js.map +1 -1
  38. package/lib/cjs/curve/ConstrainedCurve2d.d.ts +149 -0
  39. package/lib/cjs/curve/ConstrainedCurve2d.d.ts.map +1 -0
  40. package/lib/cjs/curve/ConstrainedCurve2d.js +317 -0
  41. package/lib/cjs/curve/ConstrainedCurve2d.js.map +1 -0
  42. package/lib/cjs/curve/ConstructCurveBetweenCurves.js.map +1 -1
  43. package/lib/cjs/curve/CoordinateXYZ.js.map +1 -1
  44. package/lib/cjs/curve/CurveChainWithDistanceIndex.js.map +1 -1
  45. package/lib/cjs/curve/CurveCollection.js.map +1 -1
  46. package/lib/cjs/curve/CurveCurve.js.map +1 -1
  47. package/lib/cjs/curve/CurveExtendMode.js.map +1 -1
  48. package/lib/cjs/curve/CurveFactory.d.ts.map +1 -1
  49. package/lib/cjs/curve/CurveFactory.js.map +1 -1
  50. package/lib/cjs/curve/CurveLocationDetail.js.map +1 -1
  51. package/lib/cjs/curve/CurveOps.js.map +1 -1
  52. package/lib/cjs/curve/CurvePrimitive.d.ts +2 -2
  53. package/lib/cjs/curve/CurvePrimitive.js +2 -2
  54. package/lib/cjs/curve/CurvePrimitive.js.map +1 -1
  55. package/lib/cjs/curve/CurveProcessor.js.map +1 -1
  56. package/lib/cjs/curve/CurveTypes.js.map +1 -1
  57. package/lib/cjs/curve/CurveWireMomentsXYZ.js.map +1 -1
  58. package/lib/cjs/curve/GeometryQuery.js.map +1 -1
  59. package/lib/cjs/curve/LineSegment3d.js.map +1 -1
  60. package/lib/cjs/curve/LineString3d.js.map +1 -1
  61. package/lib/cjs/curve/Loop.js.map +1 -1
  62. package/lib/cjs/curve/OffsetOptions.js.map +1 -1
  63. package/lib/cjs/curve/ParityRegion.js.map +1 -1
  64. package/lib/cjs/curve/Path.js.map +1 -1
  65. package/lib/cjs/curve/PointString3d.js.map +1 -1
  66. package/lib/cjs/curve/ProxyCurve.js.map +1 -1
  67. package/lib/cjs/curve/Query/ConsolidateAdjacentPrimitivesContext.js.map +1 -1
  68. package/lib/cjs/curve/Query/CurveSplitContext.js.map +1 -1
  69. package/lib/cjs/curve/Query/CylindricalRange.js.map +1 -1
  70. package/lib/cjs/curve/Query/InOutTests.js.map +1 -1
  71. package/lib/cjs/curve/Query/PlanarSubdivision.js.map +1 -1
  72. package/lib/cjs/curve/Query/StrokeCountChain.js.map +1 -1
  73. package/lib/cjs/curve/Query/StrokeCountMap.js.map +1 -1
  74. package/lib/cjs/curve/RegionMomentsXY.js.map +1 -1
  75. package/lib/cjs/curve/RegionOps.js.map +1 -1
  76. package/lib/cjs/curve/RegionOpsClassificationSweeps.js.map +1 -1
  77. package/lib/cjs/curve/StrokeOptions.js.map +1 -1
  78. package/lib/cjs/curve/UnionRegion.js.map +1 -1
  79. package/lib/cjs/curve/internalContexts/AnnounceTangentStrokeHandler.js.map +1 -1
  80. package/lib/cjs/curve/internalContexts/AppendPlaneIntersectionStrokeHandler.js.map +1 -1
  81. package/lib/cjs/curve/internalContexts/ChainCollectorContext.js.map +1 -1
  82. package/lib/cjs/curve/internalContexts/CloneCurvesContext.js.map +1 -1
  83. package/lib/cjs/curve/internalContexts/CloneWithExpandedLineStrings.js.map +1 -1
  84. package/lib/cjs/curve/internalContexts/ClosestPointStrokeHandler.js.map +1 -1
  85. package/lib/cjs/curve/internalContexts/CountLinearPartsSearchContext.js.map +1 -1
  86. package/lib/cjs/curve/internalContexts/CurveCurveCloseApproachXY.js.map +1 -1
  87. package/lib/cjs/curve/internalContexts/CurveCurveIntersectXY.js.map +1 -1
  88. package/lib/cjs/curve/internalContexts/CurveCurveIntersectXYZ.js.map +1 -1
  89. package/lib/cjs/curve/internalContexts/CurveLengthContext.js.map +1 -1
  90. package/lib/cjs/curve/internalContexts/CurveOffsetXYHandler.js.map +1 -1
  91. package/lib/cjs/curve/internalContexts/EllipticalArcApproximationContext.js.map +1 -1
  92. package/lib/cjs/curve/internalContexts/GapSearchContext.js.map +1 -1
  93. package/lib/cjs/curve/internalContexts/MultiChainCollector.js.map +1 -1
  94. package/lib/cjs/curve/internalContexts/NewtonRtoRStrokeHandler.js.map +1 -1
  95. package/lib/cjs/curve/internalContexts/PlaneAltitudeRangeContext.js.map +1 -1
  96. package/lib/cjs/curve/internalContexts/PointToCurveTangentHandler.d.ts +26 -0
  97. package/lib/cjs/curve/internalContexts/PointToCurveTangentHandler.d.ts.map +1 -0
  98. package/lib/cjs/curve/internalContexts/PointToCurveTangentHandler.js +78 -0
  99. package/lib/cjs/curve/internalContexts/PointToCurveTangentHandler.js.map +1 -0
  100. package/lib/cjs/curve/internalContexts/PolygonOffsetContext.js.map +1 -1
  101. package/lib/cjs/curve/internalContexts/SumLengthsContext.js.map +1 -1
  102. package/lib/cjs/curve/internalContexts/TransferWithSplitArcs.js.map +1 -1
  103. package/lib/cjs/curve/internalContexts/TransformInPlaceContext.js.map +1 -1
  104. package/lib/cjs/curve/internalContexts/geometry2d/ConstrainedImplicitCurve2d.d.ts +152 -0
  105. package/lib/cjs/curve/internalContexts/geometry2d/ConstrainedImplicitCurve2d.d.ts.map +1 -0
  106. package/lib/cjs/curve/internalContexts/geometry2d/ConstrainedImplicitCurve2d.js +843 -0
  107. package/lib/cjs/curve/internalContexts/geometry2d/ConstrainedImplicitCurve2d.js.map +1 -0
  108. package/lib/cjs/curve/internalContexts/geometry2d/ConstraintSet.d.ts +97 -0
  109. package/lib/cjs/curve/internalContexts/geometry2d/ConstraintSet.d.ts.map +1 -0
  110. package/lib/cjs/curve/internalContexts/geometry2d/ConstraintSet.js +300 -0
  111. package/lib/cjs/curve/internalContexts/geometry2d/ConstraintSet.js.map +1 -0
  112. package/lib/cjs/curve/internalContexts/geometry2d/ImplicitCurve2d.d.ts +105 -0
  113. package/lib/cjs/curve/internalContexts/geometry2d/ImplicitCurve2d.d.ts.map +1 -0
  114. package/lib/cjs/curve/internalContexts/geometry2d/ImplicitCurve2d.js +141 -0
  115. package/lib/cjs/curve/internalContexts/geometry2d/ImplicitCurve2d.js.map +1 -0
  116. package/lib/cjs/curve/internalContexts/geometry2d/ImplicitCurve2dConverter.d.ts +27 -0
  117. package/lib/cjs/curve/internalContexts/geometry2d/ImplicitCurve2dConverter.d.ts.map +1 -0
  118. package/lib/cjs/curve/internalContexts/geometry2d/ImplicitCurve2dConverter.js +152 -0
  119. package/lib/cjs/curve/internalContexts/geometry2d/ImplicitCurve2dConverter.js.map +1 -0
  120. package/lib/cjs/curve/internalContexts/geometry2d/UnboundedCircle2d.d.ts +81 -0
  121. package/lib/cjs/curve/internalContexts/geometry2d/UnboundedCircle2d.d.ts.map +1 -0
  122. package/lib/cjs/curve/internalContexts/geometry2d/UnboundedCircle2d.js +170 -0
  123. package/lib/cjs/curve/internalContexts/geometry2d/UnboundedCircle2d.js.map +1 -0
  124. package/lib/cjs/curve/internalContexts/geometry2d/UnboundedEllipse2d.d.ts +96 -0
  125. package/lib/cjs/curve/internalContexts/geometry2d/UnboundedEllipse2d.d.ts.map +1 -0
  126. package/lib/cjs/curve/internalContexts/geometry2d/UnboundedEllipse2d.js +187 -0
  127. package/lib/cjs/curve/internalContexts/geometry2d/UnboundedEllipse2d.js.map +1 -0
  128. package/lib/cjs/curve/internalContexts/geometry2d/UnboundedHyperbola2d.d.ts +91 -0
  129. package/lib/cjs/curve/internalContexts/geometry2d/UnboundedHyperbola2d.d.ts.map +1 -0
  130. package/lib/cjs/curve/internalContexts/geometry2d/UnboundedHyperbola2d.js +197 -0
  131. package/lib/cjs/curve/internalContexts/geometry2d/UnboundedHyperbola2d.js.map +1 -0
  132. package/lib/cjs/curve/internalContexts/geometry2d/UnboundedLine2d.d.ts +129 -0
  133. package/lib/cjs/curve/internalContexts/geometry2d/UnboundedLine2d.d.ts.map +1 -0
  134. package/lib/cjs/curve/internalContexts/geometry2d/UnboundedLine2d.js +208 -0
  135. package/lib/cjs/curve/internalContexts/geometry2d/UnboundedLine2d.js.map +1 -0
  136. package/lib/cjs/curve/internalContexts/geometry2d/UnboundedParabola2d.d.ts +87 -0
  137. package/lib/cjs/curve/internalContexts/geometry2d/UnboundedParabola2d.d.ts.map +1 -0
  138. package/lib/cjs/curve/internalContexts/geometry2d/UnboundedParabola2d.js +193 -0
  139. package/lib/cjs/curve/internalContexts/geometry2d/UnboundedParabola2d.js.map +1 -0
  140. package/lib/cjs/curve/spiral/AustralianRailCorpXYEvaluator.js.map +1 -1
  141. package/lib/cjs/curve/spiral/ClothoidSeries.js.map +1 -1
  142. package/lib/cjs/curve/spiral/CubicEvaluator.js.map +1 -1
  143. package/lib/cjs/curve/spiral/CzechSpiralEvaluator.js.map +1 -1
  144. package/lib/cjs/curve/spiral/DirectHalfCosineSpiralEvaluator.js.map +1 -1
  145. package/lib/cjs/curve/spiral/DirectSpiral3d.js.map +1 -1
  146. package/lib/cjs/curve/spiral/IntegratedSpiral3d.js.map +1 -1
  147. package/lib/cjs/curve/spiral/MXCubicAlongArcSpiralEvaluator.js.map +1 -1
  148. package/lib/cjs/curve/spiral/NormalizedTransition.js.map +1 -1
  149. package/lib/cjs/curve/spiral/PolishCubicSpiralEvaluator.js.map +1 -1
  150. package/lib/cjs/curve/spiral/TransitionConditionalProperties.js.map +1 -1
  151. package/lib/cjs/curve/spiral/TransitionSpiral3d.js.map +1 -1
  152. package/lib/cjs/curve/spiral/XYCurveEvaluator.js.map +1 -1
  153. package/lib/cjs/geometry3d/Angle.js.map +1 -1
  154. package/lib/cjs/geometry3d/AngleSweep.js.map +1 -1
  155. package/lib/cjs/geometry3d/BarycentricTriangle.js.map +1 -1
  156. package/lib/cjs/geometry3d/BilinearPatch.js.map +1 -1
  157. package/lib/cjs/geometry3d/CoincidentGeometryOps.js.map +1 -1
  158. package/lib/cjs/geometry3d/Ellipsoid.js.map +1 -1
  159. package/lib/cjs/geometry3d/FrameBuilder.js.map +1 -1
  160. package/lib/cjs/geometry3d/FrustumAnimation.js.map +1 -1
  161. package/lib/cjs/geometry3d/GeometryHandler.js.map +1 -1
  162. package/lib/cjs/geometry3d/GrowableBlockedArray.js.map +1 -1
  163. package/lib/cjs/geometry3d/GrowableFloat64Array.js.map +1 -1
  164. package/lib/cjs/geometry3d/GrowableXYArray.js.map +1 -1
  165. package/lib/cjs/geometry3d/GrowableXYZArray.js.map +1 -1
  166. package/lib/cjs/geometry3d/IndexedCollectionInterval.js.map +1 -1
  167. package/lib/cjs/geometry3d/IndexedXYCollection.js.map +1 -1
  168. package/lib/cjs/geometry3d/IndexedXYZCollection.js.map +1 -1
  169. package/lib/cjs/geometry3d/LongitudeLatitudeAltitude.js.map +1 -1
  170. package/lib/cjs/geometry3d/Matrix3d.js.map +1 -1
  171. package/lib/cjs/geometry3d/OrderedRotationAngles.js.map +1 -1
  172. package/lib/cjs/geometry3d/Plane3d.js.map +1 -1
  173. package/lib/cjs/geometry3d/Plane3dByOriginAndUnitNormal.js.map +1 -1
  174. package/lib/cjs/geometry3d/Plane3dByOriginAndVectors.js.map +1 -1
  175. package/lib/cjs/geometry3d/Point2dArrayCarrier.js.map +1 -1
  176. package/lib/cjs/geometry3d/Point2dVector2d.d.ts +7 -0
  177. package/lib/cjs/geometry3d/Point2dVector2d.d.ts.map +1 -1
  178. package/lib/cjs/geometry3d/Point2dVector2d.js +9 -0
  179. package/lib/cjs/geometry3d/Point2dVector2d.js.map +1 -1
  180. package/lib/cjs/geometry3d/Point3dArrayCarrier.js.map +1 -1
  181. package/lib/cjs/geometry3d/Point3dVector3d.js.map +1 -1
  182. package/lib/cjs/geometry3d/PointHelpers.js.map +1 -1
  183. package/lib/cjs/geometry3d/PointStreaming.js.map +1 -1
  184. package/lib/cjs/geometry3d/PolygonOps.js.map +1 -1
  185. package/lib/cjs/geometry3d/PolylineCompressionByEdgeOffset.js.map +1 -1
  186. package/lib/cjs/geometry3d/PolylineOps.js.map +1 -1
  187. package/lib/cjs/geometry3d/Range.js.map +1 -1
  188. package/lib/cjs/geometry3d/Ray2d.js.map +1 -1
  189. package/lib/cjs/geometry3d/Ray3d.js.map +1 -1
  190. package/lib/cjs/geometry3d/ReusableObjectCache.js.map +1 -1
  191. package/lib/cjs/geometry3d/Segment1d.js.map +1 -1
  192. package/lib/cjs/geometry3d/SortablePolygon.js.map +1 -1
  193. package/lib/cjs/geometry3d/Transform.js.map +1 -1
  194. package/lib/cjs/geometry3d/UVSurfaceOps.js.map +1 -1
  195. package/lib/cjs/geometry3d/XYZProps.js.map +1 -1
  196. package/lib/cjs/geometry3d/YawPitchRollAngles.js.map +1 -1
  197. package/lib/cjs/geometry4d/Map4d.js.map +1 -1
  198. package/lib/cjs/geometry4d/Matrix4d.js.map +1 -1
  199. package/lib/cjs/geometry4d/MomentData.js.map +1 -1
  200. package/lib/cjs/geometry4d/PlaneByOriginAndVectors4d.js.map +1 -1
  201. package/lib/cjs/geometry4d/Point4d.js.map +1 -1
  202. package/lib/cjs/numerics/BandedSystem.js.map +1 -1
  203. package/lib/cjs/numerics/BezierPolynomials.js.map +1 -1
  204. package/lib/cjs/numerics/ClusterableArray.js.map +1 -1
  205. package/lib/cjs/numerics/Complex.js.map +1 -1
  206. package/lib/cjs/numerics/ConvexPolygon2d.js.map +1 -1
  207. package/lib/cjs/numerics/Newton.js.map +1 -1
  208. package/lib/cjs/numerics/PascalCoefficients.js.map +1 -1
  209. package/lib/cjs/numerics/PolarData.js.map +1 -1
  210. package/lib/cjs/numerics/Polynomials.d.ts.map +1 -1
  211. package/lib/cjs/numerics/Polynomials.js +8 -6
  212. package/lib/cjs/numerics/Polynomials.js.map +1 -1
  213. package/lib/cjs/numerics/Quadrature.js.map +1 -1
  214. package/lib/cjs/numerics/Range1dArray.js.map +1 -1
  215. package/lib/cjs/numerics/SmallSystem.js.map +1 -1
  216. package/lib/cjs/numerics/TriDiagonalSystem.js.map +1 -1
  217. package/lib/cjs/numerics/UnionFind.js.map +1 -1
  218. package/lib/cjs/numerics/UsageSums.js.map +1 -1
  219. package/lib/cjs/polyface/AuxData.js.map +1 -1
  220. package/lib/cjs/polyface/BoxTopology.js.map +1 -1
  221. package/lib/cjs/polyface/FacetFaceData.js.map +1 -1
  222. package/lib/cjs/polyface/FacetLocationDetail.js.map +1 -1
  223. package/lib/cjs/polyface/FacetOrientation.js.map +1 -1
  224. package/lib/cjs/polyface/GreedyTriangulationBetweenLineStrings.js.map +1 -1
  225. package/lib/cjs/polyface/IndexedEdgeMatcher.js.map +1 -1
  226. package/lib/cjs/polyface/IndexedPolyfaceVisitor.js.map +1 -1
  227. package/lib/cjs/polyface/IndexedPolyfaceWalker.js.map +1 -1
  228. package/lib/cjs/polyface/Polyface.js.map +1 -1
  229. package/lib/cjs/polyface/PolyfaceBuilder.js.map +1 -1
  230. package/lib/cjs/polyface/PolyfaceClip.js.map +1 -1
  231. package/lib/cjs/polyface/PolyfaceData.js.map +1 -1
  232. package/lib/cjs/polyface/PolyfaceQuery.js.map +1 -1
  233. package/lib/cjs/polyface/RangeLengthData.js.map +1 -1
  234. package/lib/cjs/polyface/RangeTree/LineString3dRangeTreeContext.js.map +1 -1
  235. package/lib/cjs/polyface/RangeTree/MinimumValueTester.js.map +1 -1
  236. package/lib/cjs/polyface/RangeTree/Point3dArrayRangeTreeContext.js.map +1 -1
  237. package/lib/cjs/polyface/RangeTree/PolyfaceRangeTreeContext.js.map +1 -1
  238. package/lib/cjs/polyface/RangeTree/RangeTreeNode.js.map +1 -1
  239. package/lib/cjs/polyface/RangeTree/RangeTreeSearchHandlers.js.map +1 -1
  240. package/lib/cjs/polyface/TaggedNumericData.js.map +1 -1
  241. package/lib/cjs/polyface/TriangleCandidate.js.map +1 -1
  242. package/lib/cjs/polyface/multiclip/BuildAverageNormalsContext.js.map +1 -1
  243. package/lib/cjs/polyface/multiclip/GriddedRaggedRange2dSet.js.map +1 -1
  244. package/lib/cjs/polyface/multiclip/GriddedRaggedRange2dSetWithOverflow.js.map +1 -1
  245. package/lib/cjs/polyface/multiclip/LinearSearchRange2dArray.js.map +1 -1
  246. package/lib/cjs/polyface/multiclip/OffsetMeshContext.js.map +1 -1
  247. package/lib/cjs/polyface/multiclip/Range2dSearchInterface.js.map +1 -1
  248. package/lib/cjs/polyface/multiclip/RangeSearch.js.map +1 -1
  249. package/lib/cjs/polyface/multiclip/SweepLineStringToFacetContext.js.map +1 -1
  250. package/lib/cjs/polyface/multiclip/XYPointBuckets.js.map +1 -1
  251. package/lib/cjs/serialization/BGFBAccessors.js.map +1 -1
  252. package/lib/cjs/serialization/BGFBReader.js.map +1 -1
  253. package/lib/cjs/serialization/BGFBWriter.js.map +1 -1
  254. package/lib/cjs/serialization/BentleyGeometryFlatBuffer.js.map +1 -1
  255. package/lib/cjs/serialization/DeepCompare.js.map +1 -1
  256. package/lib/cjs/serialization/IModelJsonSchema.js.map +1 -1
  257. package/lib/cjs/serialization/SerializationHelpers.js.map +1 -1
  258. package/lib/cjs/solid/Box.js.map +1 -1
  259. package/lib/cjs/solid/Cone.js.map +1 -1
  260. package/lib/cjs/solid/LinearSweep.js.map +1 -1
  261. package/lib/cjs/solid/RotationalSweep.js.map +1 -1
  262. package/lib/cjs/solid/RuledSweep.js.map +1 -1
  263. package/lib/cjs/solid/SolidPrimitive.js.map +1 -1
  264. package/lib/cjs/solid/Sphere.js.map +1 -1
  265. package/lib/cjs/solid/SweepContour.js.map +1 -1
  266. package/lib/cjs/solid/TorusPipe.js.map +1 -1
  267. package/lib/cjs/topology/ChainMerge.js.map +1 -1
  268. package/lib/cjs/topology/Graph.js.map +1 -1
  269. package/lib/cjs/topology/HalfEdgeGraphFromIndexedLoopsContext.js.map +1 -1
  270. package/lib/cjs/topology/HalfEdgeGraphSearch.js.map +1 -1
  271. package/lib/cjs/topology/HalfEdgeGraphSpineContext.d.ts.map +1 -1
  272. package/lib/cjs/topology/HalfEdgeGraphSpineContext.js +3 -1
  273. package/lib/cjs/topology/HalfEdgeGraphSpineContext.js.map +1 -1
  274. package/lib/cjs/topology/HalfEdgeGraphValidation.js.map +1 -1
  275. package/lib/cjs/topology/HalfEdgeMarkSet.js.map +1 -1
  276. package/lib/cjs/topology/HalfEdgeNodeXYZUV.js.map +1 -1
  277. package/lib/cjs/topology/HalfEdgePointInGraphSearch.js.map +1 -1
  278. package/lib/cjs/topology/HalfEdgePositionDetail.js.map +1 -1
  279. package/lib/cjs/topology/HalfEdgePriorityQueue.js.map +1 -1
  280. package/lib/cjs/topology/InsertAndRetriangulateContext.js.map +1 -1
  281. package/lib/cjs/topology/MaskManager.js.map +1 -1
  282. package/lib/cjs/topology/Merging.js.map +1 -1
  283. package/lib/cjs/topology/RegularizeFace.js.map +1 -1
  284. package/lib/cjs/topology/SignedDataSummary.js.map +1 -1
  285. package/lib/cjs/topology/SpaceTriangulation.js.map +1 -1
  286. package/lib/cjs/topology/Triangulation.js.map +1 -1
  287. package/lib/cjs/topology/Voronoi.js.map +1 -1
  288. package/lib/cjs/topology/XYParitySearchContext.js.map +1 -1
  289. package/lib/esm/Constant.js.map +1 -1
  290. package/lib/esm/Geometry.d.ts +24 -14
  291. package/lib/esm/Geometry.d.ts.map +1 -1
  292. package/lib/esm/Geometry.js +34 -14
  293. package/lib/esm/Geometry.js.map +1 -1
  294. package/lib/esm/bspline/AkimaCurve3d.js.map +1 -1
  295. package/lib/esm/bspline/BSpline1dNd.js.map +1 -1
  296. package/lib/esm/bspline/BSplineCurve.js.map +1 -1
  297. package/lib/esm/bspline/BSplineCurve3dH.js.map +1 -1
  298. package/lib/esm/bspline/BSplineCurveOps.js.map +1 -1
  299. package/lib/esm/bspline/BSplineSurface.js.map +1 -1
  300. package/lib/esm/bspline/Bezier1dNd.js.map +1 -1
  301. package/lib/esm/bspline/BezierCurve3d.js.map +1 -1
  302. package/lib/esm/bspline/BezierCurve3dH.js.map +1 -1
  303. package/lib/esm/bspline/BezierCurveBase.js.map +1 -1
  304. package/lib/esm/bspline/InterpolationCurve3d.js.map +1 -1
  305. package/lib/esm/bspline/KnotVector.js.map +1 -1
  306. package/lib/esm/bspline/SurfaceLocationDetail.js.map +1 -1
  307. package/lib/esm/clipping/AlternatingConvexClipTree.js.map +1 -1
  308. package/lib/esm/clipping/BooleanClipFactory.js.map +1 -1
  309. package/lib/esm/clipping/BooleanClipNode.js.map +1 -1
  310. package/lib/esm/clipping/ClipPlane.js.map +1 -1
  311. package/lib/esm/clipping/ClipPrimitive.js.map +1 -1
  312. package/lib/esm/clipping/ClipUtils.js.map +1 -1
  313. package/lib/esm/clipping/ClipVector.js.map +1 -1
  314. package/lib/esm/clipping/ConvexClipPlaneSet.js.map +1 -1
  315. package/lib/esm/clipping/UnionOfConvexClipPlaneSets.js.map +1 -1
  316. package/lib/esm/clipping/internalContexts/LineStringOffsetClipperContext.js.map +1 -1
  317. package/lib/esm/core-geometry.d.ts +1 -0
  318. package/lib/esm/core-geometry.d.ts.map +1 -1
  319. package/lib/esm/core-geometry.js +1 -0
  320. package/lib/esm/core-geometry.js.map +1 -1
  321. package/lib/esm/curve/Arc3d.d.ts +4 -0
  322. package/lib/esm/curve/Arc3d.d.ts.map +1 -1
  323. package/lib/esm/curve/Arc3d.js +14 -0
  324. package/lib/esm/curve/Arc3d.js.map +1 -1
  325. package/lib/esm/curve/ConstrainedCurve2d.d.ts +149 -0
  326. package/lib/esm/curve/ConstrainedCurve2d.d.ts.map +1 -0
  327. package/lib/esm/curve/ConstrainedCurve2d.js +313 -0
  328. package/lib/esm/curve/ConstrainedCurve2d.js.map +1 -0
  329. package/lib/esm/curve/ConstructCurveBetweenCurves.js.map +1 -1
  330. package/lib/esm/curve/CoordinateXYZ.js.map +1 -1
  331. package/lib/esm/curve/CurveChainWithDistanceIndex.js.map +1 -1
  332. package/lib/esm/curve/CurveCollection.js.map +1 -1
  333. package/lib/esm/curve/CurveCurve.js.map +1 -1
  334. package/lib/esm/curve/CurveExtendMode.js.map +1 -1
  335. package/lib/esm/curve/CurveFactory.d.ts.map +1 -1
  336. package/lib/esm/curve/CurveFactory.js.map +1 -1
  337. package/lib/esm/curve/CurveLocationDetail.js.map +1 -1
  338. package/lib/esm/curve/CurveOps.js.map +1 -1
  339. package/lib/esm/curve/CurvePrimitive.d.ts +2 -2
  340. package/lib/esm/curve/CurvePrimitive.js +2 -2
  341. package/lib/esm/curve/CurvePrimitive.js.map +1 -1
  342. package/lib/esm/curve/CurveProcessor.js.map +1 -1
  343. package/lib/esm/curve/CurveTypes.js.map +1 -1
  344. package/lib/esm/curve/CurveWireMomentsXYZ.js.map +1 -1
  345. package/lib/esm/curve/GeometryQuery.js.map +1 -1
  346. package/lib/esm/curve/LineSegment3d.js.map +1 -1
  347. package/lib/esm/curve/LineString3d.js.map +1 -1
  348. package/lib/esm/curve/Loop.js.map +1 -1
  349. package/lib/esm/curve/OffsetOptions.js.map +1 -1
  350. package/lib/esm/curve/ParityRegion.js.map +1 -1
  351. package/lib/esm/curve/Path.js.map +1 -1
  352. package/lib/esm/curve/PointString3d.js.map +1 -1
  353. package/lib/esm/curve/ProxyCurve.js.map +1 -1
  354. package/lib/esm/curve/Query/ConsolidateAdjacentPrimitivesContext.js.map +1 -1
  355. package/lib/esm/curve/Query/CurveSplitContext.js.map +1 -1
  356. package/lib/esm/curve/Query/CylindricalRange.js.map +1 -1
  357. package/lib/esm/curve/Query/InOutTests.js.map +1 -1
  358. package/lib/esm/curve/Query/PlanarSubdivision.js.map +1 -1
  359. package/lib/esm/curve/Query/StrokeCountChain.js.map +1 -1
  360. package/lib/esm/curve/Query/StrokeCountMap.js.map +1 -1
  361. package/lib/esm/curve/RegionMomentsXY.js.map +1 -1
  362. package/lib/esm/curve/RegionOps.js.map +1 -1
  363. package/lib/esm/curve/RegionOpsClassificationSweeps.js.map +1 -1
  364. package/lib/esm/curve/StrokeOptions.js.map +1 -1
  365. package/lib/esm/curve/UnionRegion.js.map +1 -1
  366. package/lib/esm/curve/internalContexts/AnnounceTangentStrokeHandler.js.map +1 -1
  367. package/lib/esm/curve/internalContexts/AppendPlaneIntersectionStrokeHandler.js.map +1 -1
  368. package/lib/esm/curve/internalContexts/ChainCollectorContext.js.map +1 -1
  369. package/lib/esm/curve/internalContexts/CloneCurvesContext.js.map +1 -1
  370. package/lib/esm/curve/internalContexts/CloneWithExpandedLineStrings.js.map +1 -1
  371. package/lib/esm/curve/internalContexts/ClosestPointStrokeHandler.js.map +1 -1
  372. package/lib/esm/curve/internalContexts/CountLinearPartsSearchContext.js.map +1 -1
  373. package/lib/esm/curve/internalContexts/CurveCurveCloseApproachXY.js.map +1 -1
  374. package/lib/esm/curve/internalContexts/CurveCurveIntersectXY.js.map +1 -1
  375. package/lib/esm/curve/internalContexts/CurveCurveIntersectXYZ.js.map +1 -1
  376. package/lib/esm/curve/internalContexts/CurveLengthContext.js.map +1 -1
  377. package/lib/esm/curve/internalContexts/CurveOffsetXYHandler.js.map +1 -1
  378. package/lib/esm/curve/internalContexts/EllipticalArcApproximationContext.js.map +1 -1
  379. package/lib/esm/curve/internalContexts/GapSearchContext.js.map +1 -1
  380. package/lib/esm/curve/internalContexts/MultiChainCollector.js.map +1 -1
  381. package/lib/esm/curve/internalContexts/NewtonRtoRStrokeHandler.js.map +1 -1
  382. package/lib/esm/curve/internalContexts/PlaneAltitudeRangeContext.js.map +1 -1
  383. package/lib/esm/curve/internalContexts/PointToCurveTangentHandler.d.ts +26 -0
  384. package/lib/esm/curve/internalContexts/PointToCurveTangentHandler.d.ts.map +1 -0
  385. package/lib/esm/curve/internalContexts/PointToCurveTangentHandler.js +74 -0
  386. package/lib/esm/curve/internalContexts/PointToCurveTangentHandler.js.map +1 -0
  387. package/lib/esm/curve/internalContexts/PolygonOffsetContext.js.map +1 -1
  388. package/lib/esm/curve/internalContexts/SumLengthsContext.js.map +1 -1
  389. package/lib/esm/curve/internalContexts/TransferWithSplitArcs.js.map +1 -1
  390. package/lib/esm/curve/internalContexts/TransformInPlaceContext.js.map +1 -1
  391. package/lib/esm/curve/internalContexts/geometry2d/ConstrainedImplicitCurve2d.d.ts +152 -0
  392. package/lib/esm/curve/internalContexts/geometry2d/ConstrainedImplicitCurve2d.d.ts.map +1 -0
  393. package/lib/esm/curve/internalContexts/geometry2d/ConstrainedImplicitCurve2d.js +839 -0
  394. package/lib/esm/curve/internalContexts/geometry2d/ConstrainedImplicitCurve2d.js.map +1 -0
  395. package/lib/esm/curve/internalContexts/geometry2d/ConstraintSet.d.ts +97 -0
  396. package/lib/esm/curve/internalContexts/geometry2d/ConstraintSet.d.ts.map +1 -0
  397. package/lib/esm/curve/internalContexts/geometry2d/ConstraintSet.js +295 -0
  398. package/lib/esm/curve/internalContexts/geometry2d/ConstraintSet.js.map +1 -0
  399. package/lib/esm/curve/internalContexts/geometry2d/ImplicitCurve2d.d.ts +105 -0
  400. package/lib/esm/curve/internalContexts/geometry2d/ImplicitCurve2d.d.ts.map +1 -0
  401. package/lib/esm/curve/internalContexts/geometry2d/ImplicitCurve2d.js +135 -0
  402. package/lib/esm/curve/internalContexts/geometry2d/ImplicitCurve2d.js.map +1 -0
  403. package/lib/esm/curve/internalContexts/geometry2d/ImplicitCurve2dConverter.d.ts +27 -0
  404. package/lib/esm/curve/internalContexts/geometry2d/ImplicitCurve2dConverter.d.ts.map +1 -0
  405. package/lib/esm/curve/internalContexts/geometry2d/ImplicitCurve2dConverter.js +148 -0
  406. package/lib/esm/curve/internalContexts/geometry2d/ImplicitCurve2dConverter.js.map +1 -0
  407. package/lib/esm/curve/internalContexts/geometry2d/UnboundedCircle2d.d.ts +81 -0
  408. package/lib/esm/curve/internalContexts/geometry2d/UnboundedCircle2d.d.ts.map +1 -0
  409. package/lib/esm/curve/internalContexts/geometry2d/UnboundedCircle2d.js +166 -0
  410. package/lib/esm/curve/internalContexts/geometry2d/UnboundedCircle2d.js.map +1 -0
  411. package/lib/esm/curve/internalContexts/geometry2d/UnboundedEllipse2d.d.ts +96 -0
  412. package/lib/esm/curve/internalContexts/geometry2d/UnboundedEllipse2d.d.ts.map +1 -0
  413. package/lib/esm/curve/internalContexts/geometry2d/UnboundedEllipse2d.js +183 -0
  414. package/lib/esm/curve/internalContexts/geometry2d/UnboundedEllipse2d.js.map +1 -0
  415. package/lib/esm/curve/internalContexts/geometry2d/UnboundedHyperbola2d.d.ts +91 -0
  416. package/lib/esm/curve/internalContexts/geometry2d/UnboundedHyperbola2d.d.ts.map +1 -0
  417. package/lib/esm/curve/internalContexts/geometry2d/UnboundedHyperbola2d.js +193 -0
  418. package/lib/esm/curve/internalContexts/geometry2d/UnboundedHyperbola2d.js.map +1 -0
  419. package/lib/esm/curve/internalContexts/geometry2d/UnboundedLine2d.d.ts +129 -0
  420. package/lib/esm/curve/internalContexts/geometry2d/UnboundedLine2d.d.ts.map +1 -0
  421. package/lib/esm/curve/internalContexts/geometry2d/UnboundedLine2d.js +204 -0
  422. package/lib/esm/curve/internalContexts/geometry2d/UnboundedLine2d.js.map +1 -0
  423. package/lib/esm/curve/internalContexts/geometry2d/UnboundedParabola2d.d.ts +87 -0
  424. package/lib/esm/curve/internalContexts/geometry2d/UnboundedParabola2d.d.ts.map +1 -0
  425. package/lib/esm/curve/internalContexts/geometry2d/UnboundedParabola2d.js +189 -0
  426. package/lib/esm/curve/internalContexts/geometry2d/UnboundedParabola2d.js.map +1 -0
  427. package/lib/esm/curve/spiral/AustralianRailCorpXYEvaluator.js.map +1 -1
  428. package/lib/esm/curve/spiral/ClothoidSeries.js.map +1 -1
  429. package/lib/esm/curve/spiral/CubicEvaluator.js.map +1 -1
  430. package/lib/esm/curve/spiral/CzechSpiralEvaluator.js.map +1 -1
  431. package/lib/esm/curve/spiral/DirectHalfCosineSpiralEvaluator.js.map +1 -1
  432. package/lib/esm/curve/spiral/DirectSpiral3d.js.map +1 -1
  433. package/lib/esm/curve/spiral/IntegratedSpiral3d.js.map +1 -1
  434. package/lib/esm/curve/spiral/MXCubicAlongArcSpiralEvaluator.js.map +1 -1
  435. package/lib/esm/curve/spiral/NormalizedTransition.js.map +1 -1
  436. package/lib/esm/curve/spiral/PolishCubicSpiralEvaluator.js.map +1 -1
  437. package/lib/esm/curve/spiral/TransitionConditionalProperties.js.map +1 -1
  438. package/lib/esm/curve/spiral/TransitionSpiral3d.js.map +1 -1
  439. package/lib/esm/curve/spiral/XYCurveEvaluator.js.map +1 -1
  440. package/lib/esm/geometry3d/Angle.js.map +1 -1
  441. package/lib/esm/geometry3d/AngleSweep.js.map +1 -1
  442. package/lib/esm/geometry3d/BarycentricTriangle.js.map +1 -1
  443. package/lib/esm/geometry3d/BilinearPatch.js.map +1 -1
  444. package/lib/esm/geometry3d/CoincidentGeometryOps.js.map +1 -1
  445. package/lib/esm/geometry3d/Ellipsoid.js.map +1 -1
  446. package/lib/esm/geometry3d/FrameBuilder.js.map +1 -1
  447. package/lib/esm/geometry3d/FrustumAnimation.js.map +1 -1
  448. package/lib/esm/geometry3d/GeometryHandler.js.map +1 -1
  449. package/lib/esm/geometry3d/GrowableBlockedArray.js.map +1 -1
  450. package/lib/esm/geometry3d/GrowableFloat64Array.js.map +1 -1
  451. package/lib/esm/geometry3d/GrowableXYArray.js.map +1 -1
  452. package/lib/esm/geometry3d/GrowableXYZArray.js.map +1 -1
  453. package/lib/esm/geometry3d/IndexedCollectionInterval.js.map +1 -1
  454. package/lib/esm/geometry3d/IndexedXYCollection.js.map +1 -1
  455. package/lib/esm/geometry3d/IndexedXYZCollection.js.map +1 -1
  456. package/lib/esm/geometry3d/LongitudeLatitudeAltitude.js.map +1 -1
  457. package/lib/esm/geometry3d/Matrix3d.js.map +1 -1
  458. package/lib/esm/geometry3d/OrderedRotationAngles.js.map +1 -1
  459. package/lib/esm/geometry3d/Plane3d.js.map +1 -1
  460. package/lib/esm/geometry3d/Plane3dByOriginAndUnitNormal.js.map +1 -1
  461. package/lib/esm/geometry3d/Plane3dByOriginAndVectors.js.map +1 -1
  462. package/lib/esm/geometry3d/Point2dArrayCarrier.js.map +1 -1
  463. package/lib/esm/geometry3d/Point2dVector2d.d.ts +7 -0
  464. package/lib/esm/geometry3d/Point2dVector2d.d.ts.map +1 -1
  465. package/lib/esm/geometry3d/Point2dVector2d.js +9 -0
  466. package/lib/esm/geometry3d/Point2dVector2d.js.map +1 -1
  467. package/lib/esm/geometry3d/Point3dArrayCarrier.js.map +1 -1
  468. package/lib/esm/geometry3d/Point3dVector3d.js.map +1 -1
  469. package/lib/esm/geometry3d/PointHelpers.js.map +1 -1
  470. package/lib/esm/geometry3d/PointStreaming.js.map +1 -1
  471. package/lib/esm/geometry3d/PolygonOps.js.map +1 -1
  472. package/lib/esm/geometry3d/PolylineCompressionByEdgeOffset.js.map +1 -1
  473. package/lib/esm/geometry3d/PolylineOps.js.map +1 -1
  474. package/lib/esm/geometry3d/Range.js.map +1 -1
  475. package/lib/esm/geometry3d/Ray2d.js.map +1 -1
  476. package/lib/esm/geometry3d/Ray3d.js.map +1 -1
  477. package/lib/esm/geometry3d/ReusableObjectCache.js.map +1 -1
  478. package/lib/esm/geometry3d/Segment1d.js.map +1 -1
  479. package/lib/esm/geometry3d/SortablePolygon.js.map +1 -1
  480. package/lib/esm/geometry3d/Transform.js.map +1 -1
  481. package/lib/esm/geometry3d/UVSurfaceOps.js.map +1 -1
  482. package/lib/esm/geometry3d/XYZProps.js.map +1 -1
  483. package/lib/esm/geometry3d/YawPitchRollAngles.js.map +1 -1
  484. package/lib/esm/geometry4d/Map4d.js.map +1 -1
  485. package/lib/esm/geometry4d/Matrix4d.js.map +1 -1
  486. package/lib/esm/geometry4d/MomentData.js.map +1 -1
  487. package/lib/esm/geometry4d/PlaneByOriginAndVectors4d.js.map +1 -1
  488. package/lib/esm/geometry4d/Point4d.js.map +1 -1
  489. package/lib/esm/numerics/BandedSystem.js.map +1 -1
  490. package/lib/esm/numerics/BezierPolynomials.js.map +1 -1
  491. package/lib/esm/numerics/ClusterableArray.js.map +1 -1
  492. package/lib/esm/numerics/Complex.js.map +1 -1
  493. package/lib/esm/numerics/ConvexPolygon2d.js.map +1 -1
  494. package/lib/esm/numerics/Newton.js.map +1 -1
  495. package/lib/esm/numerics/PascalCoefficients.js.map +1 -1
  496. package/lib/esm/numerics/PolarData.js.map +1 -1
  497. package/lib/esm/numerics/Polynomials.d.ts.map +1 -1
  498. package/lib/esm/numerics/Polynomials.js +8 -6
  499. package/lib/esm/numerics/Polynomials.js.map +1 -1
  500. package/lib/esm/numerics/Quadrature.js.map +1 -1
  501. package/lib/esm/numerics/Range1dArray.js.map +1 -1
  502. package/lib/esm/numerics/SmallSystem.js.map +1 -1
  503. package/lib/esm/numerics/TriDiagonalSystem.js.map +1 -1
  504. package/lib/esm/numerics/UnionFind.js.map +1 -1
  505. package/lib/esm/numerics/UsageSums.js.map +1 -1
  506. package/lib/esm/polyface/AuxData.js.map +1 -1
  507. package/lib/esm/polyface/BoxTopology.js.map +1 -1
  508. package/lib/esm/polyface/FacetFaceData.js.map +1 -1
  509. package/lib/esm/polyface/FacetLocationDetail.js.map +1 -1
  510. package/lib/esm/polyface/FacetOrientation.js.map +1 -1
  511. package/lib/esm/polyface/GreedyTriangulationBetweenLineStrings.js.map +1 -1
  512. package/lib/esm/polyface/IndexedEdgeMatcher.js.map +1 -1
  513. package/lib/esm/polyface/IndexedPolyfaceVisitor.js.map +1 -1
  514. package/lib/esm/polyface/IndexedPolyfaceWalker.js.map +1 -1
  515. package/lib/esm/polyface/Polyface.js.map +1 -1
  516. package/lib/esm/polyface/PolyfaceBuilder.js.map +1 -1
  517. package/lib/esm/polyface/PolyfaceClip.js.map +1 -1
  518. package/lib/esm/polyface/PolyfaceData.js.map +1 -1
  519. package/lib/esm/polyface/PolyfaceQuery.js.map +1 -1
  520. package/lib/esm/polyface/RangeLengthData.js.map +1 -1
  521. package/lib/esm/polyface/RangeTree/LineString3dRangeTreeContext.js.map +1 -1
  522. package/lib/esm/polyface/RangeTree/MinimumValueTester.js.map +1 -1
  523. package/lib/esm/polyface/RangeTree/Point3dArrayRangeTreeContext.js.map +1 -1
  524. package/lib/esm/polyface/RangeTree/PolyfaceRangeTreeContext.js.map +1 -1
  525. package/lib/esm/polyface/RangeTree/RangeTreeNode.js.map +1 -1
  526. package/lib/esm/polyface/RangeTree/RangeTreeSearchHandlers.js.map +1 -1
  527. package/lib/esm/polyface/TaggedNumericData.js.map +1 -1
  528. package/lib/esm/polyface/TriangleCandidate.js.map +1 -1
  529. package/lib/esm/polyface/multiclip/BuildAverageNormalsContext.js.map +1 -1
  530. package/lib/esm/polyface/multiclip/GriddedRaggedRange2dSet.js.map +1 -1
  531. package/lib/esm/polyface/multiclip/GriddedRaggedRange2dSetWithOverflow.js.map +1 -1
  532. package/lib/esm/polyface/multiclip/LinearSearchRange2dArray.js.map +1 -1
  533. package/lib/esm/polyface/multiclip/OffsetMeshContext.js.map +1 -1
  534. package/lib/esm/polyface/multiclip/Range2dSearchInterface.js.map +1 -1
  535. package/lib/esm/polyface/multiclip/RangeSearch.js.map +1 -1
  536. package/lib/esm/polyface/multiclip/SweepLineStringToFacetContext.js.map +1 -1
  537. package/lib/esm/polyface/multiclip/XYPointBuckets.js.map +1 -1
  538. package/lib/esm/serialization/BGFBAccessors.js.map +1 -1
  539. package/lib/esm/serialization/BGFBReader.js.map +1 -1
  540. package/lib/esm/serialization/BGFBWriter.js.map +1 -1
  541. package/lib/esm/serialization/BentleyGeometryFlatBuffer.js.map +1 -1
  542. package/lib/esm/serialization/DeepCompare.js.map +1 -1
  543. package/lib/esm/serialization/IModelJsonSchema.js.map +1 -1
  544. package/lib/esm/serialization/SerializationHelpers.js.map +1 -1
  545. package/lib/esm/solid/Box.js.map +1 -1
  546. package/lib/esm/solid/Cone.js.map +1 -1
  547. package/lib/esm/solid/LinearSweep.js.map +1 -1
  548. package/lib/esm/solid/RotationalSweep.js.map +1 -1
  549. package/lib/esm/solid/RuledSweep.js.map +1 -1
  550. package/lib/esm/solid/SolidPrimitive.js.map +1 -1
  551. package/lib/esm/solid/Sphere.js.map +1 -1
  552. package/lib/esm/solid/SweepContour.js.map +1 -1
  553. package/lib/esm/solid/TorusPipe.js.map +1 -1
  554. package/lib/esm/topology/ChainMerge.js.map +1 -1
  555. package/lib/esm/topology/Graph.js.map +1 -1
  556. package/lib/esm/topology/HalfEdgeGraphFromIndexedLoopsContext.js.map +1 -1
  557. package/lib/esm/topology/HalfEdgeGraphSearch.js.map +1 -1
  558. package/lib/esm/topology/HalfEdgeGraphSpineContext.d.ts.map +1 -1
  559. package/lib/esm/topology/HalfEdgeGraphSpineContext.js +3 -1
  560. package/lib/esm/topology/HalfEdgeGraphSpineContext.js.map +1 -1
  561. package/lib/esm/topology/HalfEdgeGraphValidation.js.map +1 -1
  562. package/lib/esm/topology/HalfEdgeMarkSet.js.map +1 -1
  563. package/lib/esm/topology/HalfEdgeNodeXYZUV.js.map +1 -1
  564. package/lib/esm/topology/HalfEdgePointInGraphSearch.js.map +1 -1
  565. package/lib/esm/topology/HalfEdgePositionDetail.js.map +1 -1
  566. package/lib/esm/topology/HalfEdgePriorityQueue.js.map +1 -1
  567. package/lib/esm/topology/InsertAndRetriangulateContext.js.map +1 -1
  568. package/lib/esm/topology/MaskManager.js.map +1 -1
  569. package/lib/esm/topology/Merging.js.map +1 -1
  570. package/lib/esm/topology/RegularizeFace.js.map +1 -1
  571. package/lib/esm/topology/SignedDataSummary.js.map +1 -1
  572. package/lib/esm/topology/SpaceTriangulation.js.map +1 -1
  573. package/lib/esm/topology/Triangulation.js.map +1 -1
  574. package/lib/esm/topology/Voronoi.js.map +1 -1
  575. package/lib/esm/topology/XYParitySearchContext.js.map +1 -1
  576. package/package.json +3 -3
@@ -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,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAC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AAC,sBAAsB,CAAC,IAAI,CAAC,CAAC;IAC9C,CAAC;IACD,6CAA6C;IAC7B,aAAa,CAAC,KAAU;QACtC,IAAI,KAAK,YAAY,cAAc,EAAE,CAAC;YACpC,OAAO,QAAQ,CAAC,gBAAgB,CAAC,IAAI,CAAC,UAAU,EAAE,KAAK,CAAC,UAAU,CAAC;mBAC9D,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 { assert } from \"@itwin/core-bentley\";\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\r\n* \"direct\" xy calculations without the integrations required for IntegratedSpiral3d.\r\n* * Each DirectSpiral3d carries an XYCurveEvaluator to give it specialized behavior.\r\n* * Direct spirals are created with these static methods:\r\n* * createArema\r\n* * createJapaneseCubic\r\n* * createChineseCubic\r\n* * createWesternAustralian\r\n* * createDirectHalfCosine\r\n* * createAustralianRail\r\n* * createCzechCubic\r\n* * createPolishCubic\r\n* * createMXCubicAlongArc\r\n* * createItalian\r\n* @public\r\n*/\r\n// see internaldocs/Spiral.md for more info\r\nexport class DirectSpiral3d extends TransitionSpiral3d {\r\n /** String name for schema properties. */\r\n public readonly curvePrimitiveType = \"transitionSpiral\";\r\n /** Stroked approximation of entire spiral. This is AFTER the localToWorld transform. */\r\n private _globalStrokes: LineString3d;\r\n /**\r\n * Stroked approximation of active spiral. This is AFTER the localToWorld transform.\r\n * * Same count as global; possibly overly fine, but it gives some consistency between same clothoid constructed as\r\n * partial versus complete.\r\n * * If no trimming, this points to the same place as the _globalStrokes. DO NOT 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 {\r\n 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 /** Return the nominal end radius. */\r\n public get nominalR1(): number {\r\n return this._nominalR1;\r\n }\r\n /** Return the nominal distance from inflection to endpoint. */\r\n public get nominalL1(): number {\r\n return this._nominalL1;\r\n }\r\n /** Return the nominal end curvature */\r\n public get nominalCurvature1(): number {\r\n return TransitionSpiral3d.radiusToCurvature(this._nominalR1);\r\n }\r\n /**\r\n * Return the low level evaluator.\r\n * @internal\r\n */\r\n public get evaluator(): XYCurveEvaluator {\r\n 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 public 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 ) {\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 fractionA start fraction.\r\n * @param fractionB end fraction.\r\n * @param numInterval number of intervals.\r\n * @param applyLocalToWorld if true, apply the localToWorld transform.\r\n */\r\n private computeStrokes(\r\n strokes: LineString3d, fractionA: number, fractionB: number, numInterval: number, applyLocalToWorld: boolean = true,\r\n ): void {\r\n if (numInterval < 1)\r\n numInterval = 1;\r\n strokes.clear();\r\n const distances = strokes.ensureEmptyUVParams();\r\n strokes.ensureEmptyFractions();\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), 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 /** 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(\r\n this._activeStrokes, this._activeFractionInterval.x0, this._activeFractionInterval.x1, numActiveInterval,\r\n );\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 spiralType type of spiral.\r\n * @param localToWorld placement frame. Inflection point is at origin, initial direction is along x axis.\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 originalProperties (optional) transition conditional properties.\r\n * @param nominalL1 design distance from inflection to end point.\r\n * @param nominalR1 design radius at end point.\r\n * @param activeInterval (optional) 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,\r\n numYTerm: number,\r\n originalProperties: TransitionConditionalProperties | undefined,\r\n nominalL1: number,\r\n nominalR1: number,\r\n activeInterval: Segment1d | undefined,\r\n ): 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,\r\n nominalR1,\r\n activeInterval ? activeInterval.clone() : Segment1d.create(0, 1),\r\n evaluator,\r\n );\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, nominalLx: number, nominalR1: number, activeInterval?: Segment1d,\r\n ): 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,\r\n nominalR1,\r\n activeInterval ? activeInterval.clone() : Segment1d.create(0, 1),\r\n evaluator,\r\n );\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 * @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, nominalL1: number, nominalR1: number, activeInterval?: Segment1d,\r\n ): 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,\r\n nominalR1,\r\n activeInterval ? activeInterval.clone() : Segment1d.create(0, 1),\r\n 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/(6RL).\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 RR LL))\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, nominalL1: number, nominalR1: number, activeInterval?: Segment1d,\r\n ): 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,\r\n nominalR1,\r\n activeInterval ? activeInterval.clone() : Segment1d.create(0, 1),\r\n 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, nominalL1: number, nominalR1: number, activeInterval?: Segment1d,\r\n ): 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,\r\n nominalR1,\r\n activeInterval ? activeInterval.clone() : Segment1d.create(0, 1),\r\n 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, nominalL1: number, nominalR1: number, activeInterval?: Segment1d,\r\n ): 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,\r\n nominalR1,\r\n activeInterval ? activeInterval.clone() : Segment1d.create(0, 1),\r\n evaluator,\r\n );\r\n }\r\n public static createDirectHalfCosine(\r\n localToWorld: Transform, nominalL1: number, nominalR1: number, activeInterval?: Segment1d,\r\n ): DirectSpiral3d | undefined {\r\n return new DirectSpiral3d(\r\n localToWorld,\r\n \"HalfCosine\",\r\n undefined,\r\n nominalL1,\r\n nominalR1,\r\n activeInterval,\r\n new DirectHalfCosineSpiralEvaluator(nominalL1, nominalR1),\r\n );\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, nominalL1: number, nominalR1: number, activeInterval?: Segment1d,\r\n ): DirectSpiral3d | undefined {\r\n return this.createTruncatedClothoid(\"Arema\", localToWorld, 2, 2, undefined, nominalL1, nominalR1, activeInterval);\r\n }\r\n /**\r\n * Create a 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 of 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, nominalL1: number, nominalR1: number, activeInterval?: Segment1d,\r\n ): DirectSpiral3d | undefined {\r\n return this.createTruncatedClothoid(\r\n \"JapaneseCubic\", localToWorld, 1, 1, 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, nominalL1: number, nominalR1: number, activeInterval?: Segment1d,\r\n ): 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, nominalL1: number, nominalR1: number, activeInterval?: Segment1d,\r\n ): 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\r\n * greater flexibility about 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 `DirectSpiralTypeName`\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\r\n * 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,\r\n ): 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 /** Return the spiral start point. */\r\n public override startPoint(result?: Point3d): Point3d {\r\n return this.activeStrokes.startPoint(result);\r\n }\r\n /** Return the spiral end point. */\r\n public override endPoint(result?: Point3d): Point3d {\r\n return this.activeStrokes.endPoint(result);\r\n }\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 length of the spiral. */\r\n public quickLength(): number {\r\n const distanceData = this.activeStrokes.packedUVParams;\r\n const n = distanceData?.length ?? 0;\r\n assert(n > 0, \"expect constructor to populate uvParams\");\r\n if (distanceData && n > 0)\r\n return distanceData.getYAtUncheckedPointIndex(n - 1); // true length\r\n return 0;\r\n }\r\n\r\n // We claim true length is stored at the back of `packedUVParams`.\r\n // Nevertheless defer to the generic integrator in the default implementation.\r\n // public override curveLength() {\r\n // return this.quickLength();\r\n // }\r\n\r\n /** Test if `other` is an instance of `TransitionSpiral3d` */\r\n public isSameGeometryClass(other: any): boolean {\r\n return other instanceof TransitionSpiral3d;\r\n }\r\n /**\r\n * Add strokes from this spiral to `dest`.\r\n * * Line strings 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 {\r\n this.activeStrokes.emitStrokes(dest, options);\r\n }\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 // 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 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 dest.endParentCurvePrimitive(this);\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 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 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 * * 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\r\n * the fraction.\r\n * * vectorV is the second derivative, i.e.derivative of vectorU.\r\n */\r\n public fractionToPointAnd2Derivatives(\r\n activeFraction: number, result?: Plane3dByOriginAndVectors,\r\n ): 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,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAC7C,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;AAC/C,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AACjD,OAAO,EAAE,6BAA6B,EAAE,MAAM,iCAAiC,CAAC;AAChF,OAAO,EAAE,yBAAyB,EAAE,MAAM,kBAAkB,CAAC;AAC7D,OAAO,EAAE,oBAAoB,EAAE,sBAAsB,EAAE,MAAM,wBAAwB,CAAC;AACtF,OAAO,EAAE,+BAA+B,EAAE,MAAM,mCAAmC,CAAC;AACpF,OAAO,EAAE,wBAAwB,EAAE,MAAM,kCAAkC,CAAC;AAC5E,OAAO,EAAE,oBAAoB,EAAE,MAAM,8BAA8B,CAAC;AAEpE,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAG1D;;;;;;;;;;;;;;;;EAgBE;AACF,2CAA2C;AAC3C,MAAM,OAAO,cAAe,SAAQ,kBAAkB;IACpD,yCAAyC;IACzB,kBAAkB,GAAG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c,CAAC,CAAC;QACpF,MAAM,GAAG,IAAI,CAAC,UAAU,CAAC,8BAA8B,CAAC,cAAc,EAAE,MAAM,CAAC,CAAC;QAChF,MAAM,CAAC,GAAG,IAAI,CAAC,uBAAuB,CAAC,WAAW,EAAE,CAAC;QACrD,MAAM,CAAC,OAAO,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC;QAC/B,MAAM,CAAC,OAAO,CAAC,YAAY,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC;QACnC,MAAM,CAAC,gBAAgB,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC;QAC3C,OAAO,MAAM,CAAC;IAChB,CAAC;IACD,mFAAmF;IAC5E,yBAAyB,CAAC,OAAwB;QACvD,OAAO,OAAO,CAAC,sBAAsB,CAAC,IAAI,CAAC,CAAC;IAC9C,CAAC;IACD,6CAA6C;IAC7B,aAAa,CAAC,KAAU;QACtC,IAAI,KAAK,YAAY,cAAc,EAAE,CAAC;YACpC,OAAO,QAAQ,CAAC,gBAAgB,CAAC,IAAI,CAAC,UAAU,EAAE,KAAK,CAAC,UAAU,CAAC;mBAC9D,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":["/*---------------------------------------------------------------------------------------------\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 { assert } from \"@itwin/core-bentley\";\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\n* \"direct\" xy calculations without the integrations required for IntegratedSpiral3d.\n* * Each DirectSpiral3d carries an XYCurveEvaluator to give it specialized behavior.\n* * Direct spirals are created with these static methods:\n* * createArema\n* * createJapaneseCubic\n* * createChineseCubic\n* * createWesternAustralian\n* * createDirectHalfCosine\n* * createAustralianRail\n* * createCzechCubic\n* * createPolishCubic\n* * createMXCubicAlongArc\n* * createItalian\n* @public\n*/\n// see internaldocs/Spiral.md for more info\nexport class DirectSpiral3d extends TransitionSpiral3d {\n /** String name for schema properties. */\n public readonly curvePrimitiveType = \"transitionSpiral\";\n /** Stroked approximation of entire spiral. This is AFTER the localToWorld transform. */\n private _globalStrokes: LineString3d;\n /**\n * Stroked approximation of active spiral. This is AFTER the localToWorld transform.\n * * Same count as global; possibly overly fine, but it gives some consistency between same clothoid constructed as\n * partial versus complete.\n * * If no trimming, this points to the same place as the _globalStrokes. DO NOT double transform.\n */\n private _activeStrokes?: LineString3d;\n /** Return the internal stroked form of the (possibly partial) spiral. */\n public get activeStrokes(): LineString3d {\n return this._activeStrokes !== undefined ? this._activeStrokes : this._globalStrokes;\n }\n private _nominalL1: number;\n private _nominalR1: number;\n private _evaluator: XYCurveEvaluator;\n /** Return the nominal end radius. */\n public get nominalR1(): number {\n return this._nominalR1;\n }\n /** Return the nominal distance from inflection to endpoint. */\n public get nominalL1(): number {\n return this._nominalL1;\n }\n /** Return the nominal end curvature */\n public get nominalCurvature1(): number {\n return TransitionSpiral3d.radiusToCurvature(this._nominalR1);\n }\n /**\n * Return the low level evaluator.\n * @internal\n */\n public get evaluator(): XYCurveEvaluator {\n return this._evaluator;\n }\n // constructor demands radius1 and distance1 for nominal construction.\n // caller is responsible for managing intervals of partial spiral.\n public 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 ) {\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 fractionA start fraction.\n * @param fractionB end fraction.\n * @param numInterval number of intervals.\n * @param applyLocalToWorld if true, apply the localToWorld transform.\n */\n private computeStrokes(\n strokes: LineString3d, fractionA: number, fractionB: number, numInterval: number, applyLocalToWorld: boolean = true,\n ): void {\n if (numInterval < 1)\n numInterval = 1;\n strokes.clear();\n const distances = strokes.ensureEmptyUVParams();\n strokes.ensureEmptyFractions();\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), 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 /** 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(\n this._activeStrokes, this._activeFractionInterval.x0, this._activeFractionInterval.x1, numActiveInterval,\n );\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 spiralType type of spiral.\n * @param localToWorld placement frame. Inflection point is at origin, initial direction is along x axis.\n * @param numXTerm number of terms to use from X series\n * @param numYTerm number of terms to use from Y series\n * @param originalProperties (optional) transition conditional properties.\n * @param nominalL1 design distance from inflection to end point.\n * @param nominalR1 design radius at end point.\n * @param activeInterval (optional) active interval (as fractions of nominalL1)\n */\n public static createTruncatedClothoid(\n spiralType: string,\n localToWorld: Transform,\n numXTerm: number,\n numYTerm: number,\n originalProperties: TransitionConditionalProperties | undefined,\n nominalL1: number,\n nominalR1: number,\n activeInterval: Segment1d | undefined,\n ): 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,\n nominalR1,\n activeInterval ? activeInterval.clone() : Segment1d.create(0, 1),\n evaluator,\n );\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, nominalLx: number, nominalR1: number, activeInterval?: Segment1d,\n ): 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,\n nominalR1,\n activeInterval ? activeInterval.clone() : Segment1d.create(0, 1),\n evaluator,\n );\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 * @param localToWorld\n * @param nominalL1 nominal length along the spiral.\n * @param nominalR1\n * @param activeInterval\n */\n public static createItalian(\n localToWorld: Transform, nominalL1: number, nominalR1: number, activeInterval?: Segment1d,\n ): 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,\n nominalR1,\n activeInterval ? activeInterval.clone() : Segment1d.create(0, 1),\n 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/(6RL).\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 RR LL))\n * @param localToWorld\n * @param nominalL1\n * @param nominalR1\n * @param activeInterval\n */\n public static createMXCubicAlongArc(\n localToWorld: Transform, nominalL1: number, nominalR1: number, activeInterval?: Segment1d,\n ): 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,\n nominalR1,\n activeInterval ? activeInterval.clone() : Segment1d.create(0, 1),\n 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, nominalL1: number, nominalR1: number, activeInterval?: Segment1d,\n ): 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,\n nominalR1,\n activeInterval ? activeInterval.clone() : Segment1d.create(0, 1),\n 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, nominalL1: number, nominalR1: number, activeInterval?: Segment1d,\n ): 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,\n nominalR1,\n activeInterval ? activeInterval.clone() : Segment1d.create(0, 1),\n evaluator,\n );\n }\n public static createDirectHalfCosine(\n localToWorld: Transform, nominalL1: number, nominalR1: number, activeInterval?: Segment1d,\n ): DirectSpiral3d | undefined {\n return new DirectSpiral3d(\n localToWorld,\n \"HalfCosine\",\n undefined,\n nominalL1,\n nominalR1,\n activeInterval,\n new DirectHalfCosineSpiralEvaluator(nominalL1, nominalR1),\n );\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, nominalL1: number, nominalR1: number, activeInterval?: Segment1d,\n ): DirectSpiral3d | undefined {\n return this.createTruncatedClothoid(\"Arema\", localToWorld, 2, 2, undefined, nominalL1, nominalR1, activeInterval);\n }\n /**\n * Create a 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 of 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, nominalL1: number, nominalR1: number, activeInterval?: Segment1d,\n ): DirectSpiral3d | undefined {\n return this.createTruncatedClothoid(\n \"JapaneseCubic\", localToWorld, 1, 1, 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, nominalL1: number, nominalR1: number, activeInterval?: Segment1d,\n ): 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, nominalL1: number, nominalR1: number, activeInterval?: Segment1d,\n ): 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\n * greater flexibility about 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 `DirectSpiralTypeName`\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\n * 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,\n ): 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 /** Return the spiral start point. */\n public override startPoint(result?: Point3d): Point3d {\n return this.activeStrokes.startPoint(result);\n }\n /** Return the spiral end point. */\n public override endPoint(result?: Point3d): Point3d {\n return this.activeStrokes.endPoint(result);\n }\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 length of the spiral. */\n public quickLength(): number {\n const distanceData = this.activeStrokes.packedUVParams;\n const n = distanceData?.length ?? 0;\n assert(n > 0, \"expect constructor to populate uvParams\");\n if (distanceData && n > 0)\n return distanceData.getYAtUncheckedPointIndex(n - 1); // true length\n return 0;\n }\n\n // We claim true length is stored at the back of `packedUVParams`.\n // Nevertheless defer to the generic integrator in the default implementation.\n // public override curveLength() {\n // return this.quickLength();\n // }\n\n /** Test if `other` is an instance of `TransitionSpiral3d` */\n public isSameGeometryClass(other: any): boolean {\n return other instanceof TransitionSpiral3d;\n }\n /**\n * Add strokes from this spiral to `dest`.\n * * Line strings 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 {\n this.activeStrokes.emitStrokes(dest, options);\n }\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 // 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 if (n <= activeStrokes.numPoints())\n dest.announceIntervalForUniformStepStrokes(this, 2 * activeStrokes.numPoints(), globalFraction0, globalFraction1);\n else\n dest.announceIntervalForUniformStepStrokes(this, n, globalFraction0, globalFraction1);\n dest.endParentCurvePrimitive(this);\n }\n /**\n * Return the stroke count required for given options.\n * @param options StrokeOptions that determine count.\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 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 * * 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\n * the fraction.\n * * vectorV is the second derivative, i.e.derivative of vectorU.\n */\n public fractionToPointAnd2Derivatives(\n activeFraction: number, result?: Plane3dByOriginAndVectors,\n ): 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"]}
@@ -1 +1 @@
1
- {"version":3,"file":"IntegratedSpiral3d.js","sourceRoot":"","sources":["../../../../src/curve/spiral/IntegratedSpiral3d.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAEH,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAC7C,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAErD,OAAO,EAAE,UAAU,EAAE,MAAM,6BAA6B,CAAC;AAEzD,OAAO,EAAE,QAAQ,EAAE,MAAM,2BAA2B,CAAC;AAErD,OAAO,EAAE,yBAAyB,EAAE,MAAM,4CAA4C,CAAC;AACvF,OAAO,EAAE,OAAO,EAAE,MAAM,kCAAkC,CAAC;AAC3D,OAAO,EAAE,KAAK,EAAE,MAAM,wBAAwB,CAAC;AAC/C,OAAO,EAAE,SAAS,EAAE,MAAM,4BAA4B,CAAC;AACvD,OAAO,EAAE,SAAS,EAAE,MAAM,4BAA4B,CAAC;AACvD,OAAO,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC;AAEvD,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC/C,OAAO,EAAE,aAAa,EAAE,MAAM,k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CAAC;;AAEH,sDAAsD;AACtD,kBAAkB,CAAC,aAAa,EAAE,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module Curve\r\n */\r\n\r\nimport { assert } from \"@itwin/core-bentley\";\r\nimport { AxisOrder, Geometry } from \"../../Geometry\";\r\nimport { Angle } from \"../../geometry3d/Angle\";\r\nimport { AngleSweep } from \"../../geometry3d/AngleSweep\";\r\nimport { GeometryHandler, IStrokeHandler } from \"../../geometry3d/GeometryHandler\";\r\nimport { Matrix3d } from \"../../geometry3d/Matrix3d\";\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 { Quadrature } from \"../../numerics/Quadrature\";\r\nimport { GeometryQuery } from \"../GeometryQuery\";\r\nimport { LineString3d } from \"../LineString3d\";\r\nimport { StrokeOptions } from \"../StrokeOptions\";\r\nimport { NormalizedTransition } from \"./NormalizedTransition\";\r\nimport { TransitionConditionalProperties } from \"./TransitionConditionalProperties\";\r\nimport { TransitionSpiral3d } from \"./TransitionSpiral3d\";\r\n\r\n/**\r\n * An IntegratedSpiral3d is a curve defined by integrating its curvature.\r\n * * The first integral of curvature (with respect to distance along the curve) is the bearing angle (in radians).\r\n * * Integrating (cos(theta), sin(theta)) gives displacement from the start point, and thus the actual curve position.\r\n * * The curvature functions of interest are all symmetric snap functions in the [[NormalizedTransition]] class.\r\n * * [[TransitionConditionalProperties]] implements the computations of the interrelationship of radii, bearing, and length.\r\n * @public\r\n */\r\n// see internaldocs/Spiral.md for more info\r\nexport class IntegratedSpiral3d extends TransitionSpiral3d {\r\n /** String name for schema properties. */\r\n public readonly curvePrimitiveType = \"transitionSpiral\";\r\n /** Start and end radii as a Segment1d. */\r\n public radius01: Segment1d;\r\n /** Start and end bearings as an AngleSweep. */\r\n public bearing01: AngleSweep;\r\n /** Stroked approximation of entire spiral. */\r\n private _globalStrokes: LineString3d;\r\n /**\r\n * Stroked approximation of active spiral.\r\n * * Same count as global -- possibly overly fine, but it gives some consistency between same clothoid constructed\r\n * as partial versus complete.\r\n * * If no trimming, this points to the same place as the _globalStrokes. DO NOT 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 {\r\n return this._activeStrokes !== undefined ? this._activeStrokes : this._globalStrokes;\r\n }\r\n /** Evaluator for transition. */\r\n private _evaluator: NormalizedTransition;\r\n /** Total curve arc length (computed). */\r\n private _arcLength01: number;\r\n /** Curvatures (inverse radii) at start and end. */\r\n private _curvature01: Segment1d;\r\n // constructor demands all bearing, radius, and length data.\r\n // caller determines usual dependency of \"any 4 determine the 5th\".\r\n private constructor(\r\n spiralType: string | undefined,\r\n evaluator: NormalizedTransition,\r\n radius01: Segment1d,\r\n bearing01: AngleSweep,\r\n activeFractionInterval: Segment1d,\r\n localToWorld: Transform,\r\n arcLength: number,\r\n properties: TransitionConditionalProperties | undefined,\r\n ) {\r\n super(spiralType, localToWorld, activeFractionInterval, properties);\r\n this._evaluator = evaluator;\r\n this.radius01 = radius01;\r\n this.bearing01 = bearing01;\r\n this._arcLength01 = arcLength;\r\n this._globalStrokes = LineString3d.create();\r\n // initialize for compiler; but this will be recomputed in refreshComputeProperties\r\n this._curvature01 = Segment1d.create(0, 1);\r\n this.refreshComputedProperties();\r\n }\r\n /** Default spiral type name: clothoid. */\r\n public static readonly defaultSpiralType = \"clothoid\";\r\n /** Use the integrated function to return an angle at fractional position. */\r\n public globalFractionToBearingRadians(fraction: number): number {\r\n // calculate area under curvature curve from 0 to fraction and add it to start angle to get angle at the given fraction\r\n // see internaldocs/Spiral.md for more info\r\n const areaFraction = this._evaluator.fractionToArea(fraction);\r\n const arcLength = this._arcLength01;\r\n return this.bearing01.startRadians\r\n + fraction * arcLength * this._curvature01.x0\r\n + areaFraction * arcLength * this._curvature01.signedDelta();\r\n }\r\n /** Use the integrated function to return an angle at fractional position. */\r\n public globalFractionToCurvature(fraction: number): number {\r\n const f = this._evaluator.fractionToCurvatureFraction(fraction);\r\n return this._curvature01.fractionToPoint(f);\r\n }\r\n /** Return the bearing at given fraction of the active interval. */\r\n public fractionToBearingRadians(activeFraction: number): number {\r\n const fraction = this.activeFractionInterval.fractionToPoint(activeFraction);\r\n return this.bearing01.startRadians\r\n + fraction * this._arcLength01 * (this._curvature01.x0 + 0.5 * fraction * (this._curvature01.x1 - this._curvature01.x0));\r\n }\r\n /** Return the curvature at given fraction of the active interval. */\r\n public override fractionToCurvature(activeFraction: number): number {\r\n return this._curvature01.fractionToPoint(this.activeFractionInterval.fractionToPoint(activeFraction));\r\n }\r\n // These static variables are reused on calls to integrateFromStartFraction\r\n private static _gaussFraction: Float64Array;\r\n private static _gaussWeight: Float64Array;\r\n private static _gaussMapper: (xA: number, xB: number, arrayX: Float64Array, arrayW: Float64Array) => number;\r\n /** Initialize class level work arrays. */\r\n public static initWorkSpace() {\r\n IntegratedSpiral3d._gaussFraction = new Float64Array(5);\r\n IntegratedSpiral3d._gaussWeight = new Float64Array(5);\r\n IntegratedSpiral3d._gaussMapper = (xA, xB, xMapped, wMapped) => Quadrature.setupGauss5(xA, xB, xMapped, wMapped);\r\n }\r\n /**\r\n * Evaluate and sum the gauss quadrature formulas to integrate cos(theta), sin(theta) fractional subset of a reference\r\n * length (recall that theta is a nonlinear function of the fraction).\r\n * * This is a single interval of gaussian integration.\r\n * * The fraction is on the full spiral (not in the mapped active interval).\r\n * @param xyz advancing integrated point.\r\n * @param fractionA fraction at start of interval.\r\n * @param fractionB fraction at end of interval.\r\n * @param applyMatrix if true, apply the localToWorld matrix to the computed delta before adding to xyz.\r\n */\r\n private fullSpiralIncrementalIntegral(xyz: Point3d, fractionA: number, fractionB: number, applyMatrix: boolean): void {\r\n // see internaldocs/Spiral.md for more info\r\n const gaussFraction = IntegratedSpiral3d._gaussFraction;\r\n const gaussWeight = IntegratedSpiral3d._gaussWeight;\r\n const numEval = IntegratedSpiral3d._gaussMapper(fractionA, fractionB, gaussFraction, gaussWeight);\r\n const deltaL = this._arcLength01;\r\n let w = 0;\r\n let dx = 0.0;\r\n let dy = 0.0;\r\n for (let k = 0; k < numEval; k++) {\r\n const radians = this.globalFractionToBearingRadians(gaussFraction[k]);\r\n w = gaussWeight[k] * deltaL;\r\n dx += w * Math.cos(radians);\r\n dy += w * Math.sin(radians);\r\n }\r\n if (applyMatrix)\r\n Matrix3d.xyzPlusMatrixTimesXYZ(xyz, this.localToWorld.matrix, { x: dx, y: dy, z: 0.0 }, xyz);\r\n else\r\n xyz.addXYZInPlace(dx, dy, 0.0);\r\n }\r\n /** Recompute strokes. */\r\n public override refreshComputedProperties() {\r\n this._curvature01 = Segment1d.create(\r\n TransitionSpiral3d.radiusToCurvature(this.radius01.x0),\r\n TransitionSpiral3d.radiusToCurvature(this.radius01.x1),\r\n );\r\n this._globalStrokes.clear();\r\n const currentPoint = Point3d.create();\r\n this._globalStrokes.appendStrokePoint(currentPoint);\r\n const numInterval = 16;\r\n const fractionStep = 1.0 / numInterval;\r\n for (let i = 1; i <= numInterval; i++) {\r\n const fraction0 = (i - 1) * fractionStep;\r\n const fraction1 = i * fractionStep;\r\n this.fullSpiralIncrementalIntegral(currentPoint, fraction0, fraction1, false);\r\n this._globalStrokes.appendStrokePoint(currentPoint);\r\n }\r\n this._globalStrokes.tryTransformInPlace(this.localToWorld);\r\n if (!this.activeFractionInterval.isExact01) {\r\n if (this._activeStrokes === undefined)\r\n this._activeStrokes = LineString3d.create();\r\n this._activeStrokes.clear();\r\n // The active interval has finer strokes: it's the same fraction step but mapped to a sub-interval.\r\n // Below assumes fractionToPoint depends upon the global strokes we just computed, and not\r\n // on the active strokes we are computing.\r\n for (let i = 0; i <= numInterval; i++) {\r\n const localFraction = i * fractionStep;\r\n this._activeStrokes.addPoint(this.fractionToPoint(localFraction));\r\n }\r\n }\r\n }\r\n /**\r\n * Create a transition spiral with radius and bearing conditions.\r\n * @param radius01 radius (inverse curvature) at start and end (radius of zero means straight line).\r\n * @param bearing01 bearing angles at start and end. Bearings are measured from the x axis, positive clockwise\r\n * towards y axis.\r\n * @param activeFractionInterval fractional limits of the active portion of the spiral.\r\n * @param localToWorld placement frame. Fractional coordinate 0 is at the origin.\r\n */\r\n public static createRadiusRadiusBearingBearing(\r\n radius01: Segment1d,\r\n bearing01: AngleSweep,\r\n activeFractionInterval: Segment1d,\r\n localToWorld: Transform,\r\n typeName?: string,\r\n ): IntegratedSpiral3d | undefined {\r\n const arcLength = TransitionSpiral3d.radiusRadiusSweepRadiansToArcLength(\r\n radius01.x0, radius01.x1, bearing01.sweepRadians,\r\n );\r\n if (typeName === undefined)\r\n typeName = \"clothoid\";\r\n const evaluator = NormalizedTransition.findEvaluator(typeName);\r\n if (!evaluator)\r\n return undefined;\r\n return new IntegratedSpiral3d(\r\n typeName,\r\n evaluator,\r\n radius01.clone(),\r\n bearing01.clone(),\r\n activeFractionInterval.clone(),\r\n localToWorld.clone(),\r\n arcLength,\r\n new TransitionConditionalProperties(\r\n radius01.x0, radius01.x1, bearing01.startAngle.clone(), bearing01.endAngle.clone(), undefined,\r\n ),\r\n );\r\n }\r\n /**\r\n * Create a transition spiral.\r\n * * Inputs must provide exactly 4 of the 5 values `[radius0,radius1,bearing0,bearing1,length]`.\r\n * @param spiralType one of \"clothoid\", \"bloss\", \"biquadratic\", \"cosine\", \"sine\". If undefined, \"clothoid\" is used.\r\n * @param radius0 radius (or 0 for tangent to line) at start.\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.\r\n * @param bearing1 bearing, measured CCW from x axis at end.\r\n * @param fractionInterval optional fractional interval for an \"active\" portion of the curve. If omitted, the full\r\n * [0,1] is used.\r\n * @param localToWorld placement transform.\r\n */\r\n public static createFrom4OutOf5(\r\n spiralType: string | undefined,\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 fractionInterval: undefined | Segment1d,\r\n localToWorld: Transform,\r\n ): IntegratedSpiral3d | undefined {\r\n if (spiralType === undefined)\r\n spiralType = \"clothoid\";\r\n const evaluator = NormalizedTransition.findEvaluator(spiralType);\r\n if (!evaluator)\r\n return undefined;\r\n const data = new TransitionConditionalProperties(radius0, radius1, bearing0, bearing1, arcLength);\r\n const data1 = data.clone();\r\n if (!data.tryResolveAnySingleUnknown())\r\n return undefined;\r\n if (fractionInterval === undefined)\r\n fractionInterval = Segment1d.create(0, 1);\r\n return new IntegratedSpiral3d(\r\n spiralType,\r\n evaluator,\r\n Segment1d.create(data.radius0, data.radius1),\r\n AngleSweep.createStartEnd(data.bearing0, data.bearing1),\r\n fractionInterval ? fractionInterval.clone() : Segment1d.create(0, 1),\r\n localToWorld, data.curveLength, data1);\r\n }\r\n /** Copy all defining data from another spiral. */\r\n public setFrom(other: IntegratedSpiral3d): IntegratedSpiral3d {\r\n this.localToWorld.setFrom(other.localToWorld);\r\n this.radius01.setFrom(other.radius01);\r\n this._curvature01.setFrom(other._curvature01);\r\n this.bearing01.setFrom(other.bearing01);\r\n this.localToWorld.setFrom(other.localToWorld);\r\n this.activeFractionInterval.setFrom(other.activeFractionInterval);\r\n this._arcLength01 = other._arcLength01;\r\n return this;\r\n }\r\n /** Deep clone of this spiral. */\r\n public override clone(): IntegratedSpiral3d {\r\n return new IntegratedSpiral3d(\r\n this._spiralType,\r\n this._evaluator,\r\n this.radius01.clone(),\r\n this.bearing01.clone(),\r\n this.activeFractionInterval.clone(),\r\n this.localToWorld.clone(),\r\n this._arcLength01,\r\n this._designProperties?.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._curvature01.x0 /= rigidData.scale;\r\n this._curvature01.x1 /= rigidData.scale;\r\n this.radius01.x0 *= rigidData.scale;\r\n this.radius01.x1 *= rigidData.scale;\r\n this._arcLength01 *= rigidData.scale;\r\n }\r\n this.refreshComputedProperties();\r\n return true;\r\n }\r\n /** Return the spiral start point. */\r\n public override startPoint(result?: Point3d): Point3d {\r\n return this.activeStrokes.startPoint(result);\r\n }\r\n /** Return the spiral end point. */\r\n public override endPoint(result?: Point3d): Point3d {\r\n return this.activeStrokes.endPoint(result);\r\n }\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 /**\r\n * Return length of the spiral.\r\n * * Because TransitionSpiral is parameterized directly in terms of distance along, this is a simple return value.\r\n */\r\n public quickLength() {\r\n return this.curveLength();\r\n }\r\n /**\r\n * Return length of the spiral.\r\n * * Because TransitionSpiral is parameterized directly in terms of distance along, this is a simple return value.\r\n */\r\n public override curveLength() {\r\n return this._arcLength01 * (this._activeFractionInterval.absoluteDelta());\r\n }\r\n /**\r\n * Return (unsigned) length of the spiral between fractions.\r\n * * Because TransitionSpiral is parameterized directly in terms of distance along, this is a simple return value.\r\n */\r\n public override curveLengthBetweenFractions(fraction0: number, fraction1: number) {\r\n return this._arcLength01 * (this._activeFractionInterval.absoluteDelta() * Math.abs(fraction1 - fraction0));\r\n }\r\n /** Test if `other` is an instance of `TransitionSpiral3d`. */\r\n public isSameGeometryClass(other: any): boolean {\r\n return other instanceof TransitionSpiral3d;\r\n }\r\n /**\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 {\r\n this.activeStrokes.emitStrokes(dest, options);\r\n }\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 dest.startParentCurvePrimitive(this);\r\n const activeStrokes = this.activeStrokes;\r\n const preferPrimary = dest.needPrimaryGeometryForStrokes === undefined ? false : dest.needPrimaryGeometryForStrokes();\r\n if (!preferPrimary && n <= activeStrokes.numPoints()) {\r\n this.activeStrokes.emitStrokableParts(dest, options);\r\n } else {\r\n dest.announceIntervalForUniformStepStrokes(this, n, 0.0, 1.0);\r\n }\r\n dest.endParentCurvePrimitive(this);\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 public computeStrokeCountForOptions(options?: StrokeOptions): number {\r\n let numStroke;\r\n if (options) {\r\n const rMin = Math.min(Math.abs(this.radius01.x0), Math.abs(this.radius01.x1));\r\n numStroke = options.applyTolerancesToArc(rMin, this.bearing01.sweepRadians);\r\n numStroke = options.applyMaxEdgeLength(numStroke, this.curveLength());\r\n numStroke = options.applyMinStrokesPerPrimitive(numStroke);\r\n } else {\r\n numStroke = StrokeOptions.applyAngleTol(undefined, 4, this.bearing01.sweepRadians);\r\n }\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 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 targetGlobalFraction = this.activeFractionInterval.fractionToPoint(activeFraction);\r\n const numStrokes = this._globalStrokes.packedPoints.length - 1;\r\n assert(numStrokes > 0, \"expect constructor to populate nonzero global strokes\");\r\n if (numStrokes < 1)\r\n return Point3d.createZero(result); // trust but verify\r\n if (activeFraction > 1.0) {\r\n result = this._globalStrokes.packedPoints.getPoint3dAtUncheckedPointIndex(numStrokes, result);\r\n const integrationStep = 1.0 / numStrokes;\r\n let currentGlobalFraction = 1.0;\r\n let nextGlobalFraction = currentGlobalFraction + integrationStep;\r\n while (nextGlobalFraction < targetGlobalFraction) {\r\n this.fullSpiralIncrementalIntegral(result, currentGlobalFraction, nextGlobalFraction, true);\r\n currentGlobalFraction = nextGlobalFraction;\r\n nextGlobalFraction += integrationStep;\r\n }\r\n this.fullSpiralIncrementalIntegral(result, currentGlobalFraction, targetGlobalFraction, true);\r\n } else if (activeFraction < 0.0) {\r\n result = this._globalStrokes.packedPoints.getPoint3dAtUncheckedPointIndex(0, result);\r\n const integrationStep = 1.0 / numStrokes;\r\n let currentGlobalFraction = 0.0;\r\n let nextGlobalFraction = currentGlobalFraction - integrationStep;\r\n while (nextGlobalFraction > targetGlobalFraction) {\r\n this.fullSpiralIncrementalIntegral(result, currentGlobalFraction, nextGlobalFraction, true);\r\n currentGlobalFraction = nextGlobalFraction;\r\n nextGlobalFraction -= integrationStep;\r\n }\r\n this.fullSpiralIncrementalIntegral(result, currentGlobalFraction, targetGlobalFraction, true);\r\n } else {\r\n const clampedGlobalFraction = Geometry.clampToStartEnd(targetGlobalFraction, 0, 1);\r\n const index0 = Math.trunc(clampedGlobalFraction * numStrokes);\r\n assert(0 <= index0 && index0 <= numStrokes, \"expect valid index0, at left of containing stroke interval\");\r\n const globalFraction0 = index0 / numStrokes;\r\n result = this._globalStrokes.packedPoints.getPoint3dAtUncheckedPointIndex(index0, result);\r\n this.fullSpiralIncrementalIntegral(result, globalFraction0, targetGlobalFraction, true);\r\n }\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 = result ? result : Ray3d.createZero();\r\n this.fractionToPoint(activeFraction, result.origin);\r\n const radians = this.globalFractionToBearingRadians(globalFraction);\r\n const a = this._arcLength01 * this.activeFractionInterval.signedDelta();\r\n this.localToWorld.matrix.multiplyXY(a * Math.cos(radians), a * Math.sin(radians), result.direction);\r\n return result;\r\n }\r\n /** Return the frenet frame at fractional position. */\r\n public override fractionToFrenetFrame(activeFraction: number, result?: Transform): Transform {\r\n const globalFraction = this.activeFractionInterval.fractionToPoint(activeFraction);\r\n result = result ? result : Transform.createIdentity();\r\n result.origin.setFrom(this.fractionToPoint(activeFraction));\r\n Matrix3d.createRigidFromMatrix3d(this.localToWorld.matrix, AxisOrder.XYZ, result.matrix);\r\n const radians = this.globalFractionToBearingRadians(globalFraction);\r\n const c = Math.cos(radians);\r\n const s = Math.sin(radians);\r\n result.matrix.applyGivensColumnOp(0, 1, c, s);\r\n return result;\r\n }\r\n /**\r\n * Return a plane with\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\r\n * the fraction.\r\n * * vectorV is the second derivative, i.e.derivative of vectorU.\r\n */\r\n public fractionToPointAnd2Derivatives(\r\n activeFraction: number, result?: Plane3dByOriginAndVectors,\r\n ): Plane3dByOriginAndVectors | undefined {\r\n const globalFraction = this.activeFractionInterval.fractionToPoint(activeFraction);\r\n const origin = this.fractionToPoint(activeFraction);\r\n const radians = this.globalFractionToBearingRadians(globalFraction);\r\n const c = Math.cos(radians);\r\n const s = Math.sin(radians);\r\n const delta = this.activeFractionInterval.signedDelta();\r\n const a = delta;\r\n const b = a * delta;\r\n const vectorX = this.localToWorld.matrix.multiplyXY(a * c, a * s);\r\n const vectorY = this.localToWorld.matrix.multiplyXY(-b * s, b * c);\r\n vectorY.scaleInPlace(this.globalFractionToCurvature(globalFraction));\r\n return Plane3dByOriginAndVectors.createCapture(origin, vectorX, vectorY, 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?: GeometryQuery): boolean {\r\n if (other instanceof IntegratedSpiral3d) {\r\n return this.radius01.isAlmostEqual(other.radius01)\r\n && this.bearing01.isAlmostEqualAllowPeriodShift(other.bearing01)\r\n && this.localToWorld.isAlmostEqual(other.localToWorld)\r\n && Geometry.isSameCoordinate(this._arcLength01, other._arcLength01)\r\n && this.activeFractionInterval.isAlmostEqual(other.activeFractionInterval)\r\n && this._curvature01.isAlmostEqual(other._curvature01);\r\n }\r\n return false;\r\n }\r\n}\r\n// at load time, initialize gauss quadrature workspace\r\nIntegratedSpiral3d.initWorkSpace();\r\n"]}
1
+ {"version":3,"file":"IntegratedSpiral3d.js","sourceRoot":"","sources":["../../../../src/curve/spiral/IntegratedSpiral3d.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAEH,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAC7C,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAErD,OAAO,EAAE,UAAU,EAAE,MAAM,6BAA6B,CAAC;AAEzD,OAAO,EAAE,QAAQ,EAAE,MAAM,2BAA2B,CAAC;AAErD,OAAO,EAAE,yBAAyB,EAAE,MAAM,4CAA4C,CAAC;AACvF,OAAO,EAAE,OAAO,EAAE,MAAM,kCAAkC,CAAC;AAC3D,OAAO,EAAE,KAAK,EAAE,MAAM,wBAAwB,CAAC;AAC/C,OAAO,EAAE,SAAS,EAAE,MAAM,4BAA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C,YAAY,CAAC;mBAChE,IAAI,CAAC,sBAAsB,CAAC,aAAa,CAAC,KAAK,CAAC,sBAAsB,CAAC;mBACvE,IAAI,CAAC,YAAY,CAAC,aAAa,CAAC,KAAK,CAAC,YAAY,CAAC,CAAC;QAC3D,CAAC;QACD,OAAO,KAAK,CAAC;IACf,CAAC;;AAEH,sDAAsD;AACtD,kBAAkB,CAAC,aAAa,EAAE,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module Curve\n */\n\nimport { assert } from \"@itwin/core-bentley\";\nimport { AxisOrder, Geometry } from \"../../Geometry\";\nimport { Angle } from \"../../geometry3d/Angle\";\nimport { AngleSweep } from \"../../geometry3d/AngleSweep\";\nimport { GeometryHandler, IStrokeHandler } from \"../../geometry3d/GeometryHandler\";\nimport { Matrix3d } from \"../../geometry3d/Matrix3d\";\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 { Quadrature } from \"../../numerics/Quadrature\";\nimport { GeometryQuery } from \"../GeometryQuery\";\nimport { LineString3d } from \"../LineString3d\";\nimport { StrokeOptions } from \"../StrokeOptions\";\nimport { NormalizedTransition } from \"./NormalizedTransition\";\nimport { TransitionConditionalProperties } from \"./TransitionConditionalProperties\";\nimport { TransitionSpiral3d } from \"./TransitionSpiral3d\";\n\n/**\n * An IntegratedSpiral3d is a curve defined by integrating its curvature.\n * * The first integral of curvature (with respect to distance along the curve) is the bearing angle (in radians).\n * * Integrating (cos(theta), sin(theta)) gives displacement from the start point, and thus the actual curve position.\n * * The curvature functions of interest are all symmetric snap functions in the [[NormalizedTransition]] class.\n * * [[TransitionConditionalProperties]] implements the computations of the interrelationship of radii, bearing, and length.\n * @public\n */\n// see internaldocs/Spiral.md for more info\nexport class IntegratedSpiral3d extends TransitionSpiral3d {\n /** String name for schema properties. */\n public readonly curvePrimitiveType = \"transitionSpiral\";\n /** Start and end radii as a Segment1d. */\n public radius01: Segment1d;\n /** Start and end bearings as an AngleSweep. */\n public bearing01: AngleSweep;\n /** Stroked approximation of entire spiral. */\n private _globalStrokes: LineString3d;\n /**\n * Stroked approximation of active spiral.\n * * Same count as global -- possibly overly fine, but it gives some consistency between same clothoid constructed\n * as partial versus complete.\n * * If no trimming, this points to the same place as the _globalStrokes. DO NOT double transform.\n */\n private _activeStrokes?: LineString3d;\n /** Return the internal stroked form of the (possibly partial) spiral. */\n public get activeStrokes(): LineString3d {\n return this._activeStrokes !== undefined ? this._activeStrokes : this._globalStrokes;\n }\n /** Evaluator for transition. */\n private _evaluator: NormalizedTransition;\n /** Total curve arc length (computed). */\n private _arcLength01: number;\n /** Curvatures (inverse radii) at start and end. */\n private _curvature01: Segment1d;\n // constructor demands all bearing, radius, and length data.\n // caller determines usual dependency of \"any 4 determine the 5th\".\n private constructor(\n spiralType: string | undefined,\n evaluator: NormalizedTransition,\n radius01: Segment1d,\n bearing01: AngleSweep,\n activeFractionInterval: Segment1d,\n localToWorld: Transform,\n arcLength: number,\n properties: TransitionConditionalProperties | undefined,\n ) {\n super(spiralType, localToWorld, activeFractionInterval, properties);\n this._evaluator = evaluator;\n this.radius01 = radius01;\n this.bearing01 = bearing01;\n this._arcLength01 = arcLength;\n this._globalStrokes = LineString3d.create();\n // initialize for compiler; but this will be recomputed in refreshComputeProperties\n this._curvature01 = Segment1d.create(0, 1);\n this.refreshComputedProperties();\n }\n /** Default spiral type name: clothoid. */\n public static readonly defaultSpiralType = \"clothoid\";\n /** Use the integrated function to return an angle at fractional position. */\n public globalFractionToBearingRadians(fraction: number): number {\n // calculate area under curvature curve from 0 to fraction and add it to start angle to get angle at the given fraction\n // see internaldocs/Spiral.md for more info\n const areaFraction = this._evaluator.fractionToArea(fraction);\n const arcLength = this._arcLength01;\n return this.bearing01.startRadians\n + fraction * arcLength * this._curvature01.x0\n + areaFraction * arcLength * this._curvature01.signedDelta();\n }\n /** Use the integrated function to return an angle at fractional position. */\n public globalFractionToCurvature(fraction: number): number {\n const f = this._evaluator.fractionToCurvatureFraction(fraction);\n return this._curvature01.fractionToPoint(f);\n }\n /** Return the bearing at given fraction of the active interval. */\n public fractionToBearingRadians(activeFraction: number): number {\n const fraction = this.activeFractionInterval.fractionToPoint(activeFraction);\n return this.bearing01.startRadians\n + fraction * this._arcLength01 * (this._curvature01.x0 + 0.5 * fraction * (this._curvature01.x1 - this._curvature01.x0));\n }\n /** Return the curvature at given fraction of the active interval. */\n public override fractionToCurvature(activeFraction: number): number {\n return this._curvature01.fractionToPoint(this.activeFractionInterval.fractionToPoint(activeFraction));\n }\n // These static variables are reused on calls to integrateFromStartFraction\n private static _gaussFraction: Float64Array;\n private static _gaussWeight: Float64Array;\n private static _gaussMapper: (xA: number, xB: number, arrayX: Float64Array, arrayW: Float64Array) => number;\n /** Initialize class level work arrays. */\n public static initWorkSpace() {\n IntegratedSpiral3d._gaussFraction = new Float64Array(5);\n IntegratedSpiral3d._gaussWeight = new Float64Array(5);\n IntegratedSpiral3d._gaussMapper = (xA, xB, xMapped, wMapped) => Quadrature.setupGauss5(xA, xB, xMapped, wMapped);\n }\n /**\n * Evaluate and sum the gauss quadrature formulas to integrate cos(theta), sin(theta) fractional subset of a reference\n * length (recall that theta is a nonlinear function of the fraction).\n * * This is a single interval of gaussian integration.\n * * The fraction is on the full spiral (not in the mapped active interval).\n * @param xyz advancing integrated point.\n * @param fractionA fraction at start of interval.\n * @param fractionB fraction at end of interval.\n * @param applyMatrix if true, apply the localToWorld matrix to the computed delta before adding to xyz.\n */\n private fullSpiralIncrementalIntegral(xyz: Point3d, fractionA: number, fractionB: number, applyMatrix: boolean): void {\n // see internaldocs/Spiral.md for more info\n const gaussFraction = IntegratedSpiral3d._gaussFraction;\n const gaussWeight = IntegratedSpiral3d._gaussWeight;\n const numEval = IntegratedSpiral3d._gaussMapper(fractionA, fractionB, gaussFraction, gaussWeight);\n const deltaL = this._arcLength01;\n let w = 0;\n let dx = 0.0;\n let dy = 0.0;\n for (let k = 0; k < numEval; k++) {\n const radians = this.globalFractionToBearingRadians(gaussFraction[k]);\n w = gaussWeight[k] * deltaL;\n dx += w * Math.cos(radians);\n dy += w * Math.sin(radians);\n }\n if (applyMatrix)\n Matrix3d.xyzPlusMatrixTimesXYZ(xyz, this.localToWorld.matrix, { x: dx, y: dy, z: 0.0 }, xyz);\n else\n xyz.addXYZInPlace(dx, dy, 0.0);\n }\n /** Recompute strokes. */\n public override refreshComputedProperties() {\n this._curvature01 = Segment1d.create(\n TransitionSpiral3d.radiusToCurvature(this.radius01.x0),\n TransitionSpiral3d.radiusToCurvature(this.radius01.x1),\n );\n this._globalStrokes.clear();\n const currentPoint = Point3d.create();\n this._globalStrokes.appendStrokePoint(currentPoint);\n const numInterval = 16;\n const fractionStep = 1.0 / numInterval;\n for (let i = 1; i <= numInterval; i++) {\n const fraction0 = (i - 1) * fractionStep;\n const fraction1 = i * fractionStep;\n this.fullSpiralIncrementalIntegral(currentPoint, fraction0, fraction1, false);\n this._globalStrokes.appendStrokePoint(currentPoint);\n }\n this._globalStrokes.tryTransformInPlace(this.localToWorld);\n if (!this.activeFractionInterval.isExact01) {\n if (this._activeStrokes === undefined)\n this._activeStrokes = LineString3d.create();\n this._activeStrokes.clear();\n // The active interval has finer strokes: it's the same fraction step but mapped to a sub-interval.\n // Below assumes fractionToPoint depends upon the global strokes we just computed, and not\n // on the active strokes we are computing.\n for (let i = 0; i <= numInterval; i++) {\n const localFraction = i * fractionStep;\n this._activeStrokes.addPoint(this.fractionToPoint(localFraction));\n }\n }\n }\n /**\n * Create a transition spiral with radius and bearing conditions.\n * @param radius01 radius (inverse curvature) at start and end (radius of zero means straight line).\n * @param bearing01 bearing angles at start and end. Bearings are measured from the x axis, positive clockwise\n * towards y axis.\n * @param activeFractionInterval fractional limits of the active portion of the spiral.\n * @param localToWorld placement frame. Fractional coordinate 0 is at the origin.\n */\n public static createRadiusRadiusBearingBearing(\n radius01: Segment1d,\n bearing01: AngleSweep,\n activeFractionInterval: Segment1d,\n localToWorld: Transform,\n typeName?: string,\n ): IntegratedSpiral3d | undefined {\n const arcLength = TransitionSpiral3d.radiusRadiusSweepRadiansToArcLength(\n radius01.x0, radius01.x1, bearing01.sweepRadians,\n );\n if (typeName === undefined)\n typeName = \"clothoid\";\n const evaluator = NormalizedTransition.findEvaluator(typeName);\n if (!evaluator)\n return undefined;\n return new IntegratedSpiral3d(\n typeName,\n evaluator,\n radius01.clone(),\n bearing01.clone(),\n activeFractionInterval.clone(),\n localToWorld.clone(),\n arcLength,\n new TransitionConditionalProperties(\n radius01.x0, radius01.x1, bearing01.startAngle.clone(), bearing01.endAngle.clone(), undefined,\n ),\n );\n }\n /**\n * Create a transition spiral.\n * * Inputs must provide exactly 4 of the 5 values `[radius0,radius1,bearing0,bearing1,length]`.\n * @param spiralType one of \"clothoid\", \"bloss\", \"biquadratic\", \"cosine\", \"sine\". If undefined, \"clothoid\" is used.\n * @param radius0 radius (or 0 for tangent to line) at start.\n * @param radius1 radius (or 0 for tangent to line) at end.\n * @param bearing0 bearing, measured CCW from x axis at start.\n * @param bearing1 bearing, measured CCW from x axis at end.\n * @param fractionInterval optional fractional interval for an \"active\" portion of the curve. If omitted, the full\n * [0,1] is used.\n * @param localToWorld placement transform.\n */\n public static createFrom4OutOf5(\n spiralType: string | undefined,\n radius0: number | undefined,\n radius1: number | undefined,\n bearing0: Angle | undefined,\n bearing1: Angle | undefined,\n arcLength: number | undefined,\n fractionInterval: undefined | Segment1d,\n localToWorld: Transform,\n ): IntegratedSpiral3d | undefined {\n if (spiralType === undefined)\n spiralType = \"clothoid\";\n const evaluator = NormalizedTransition.findEvaluator(spiralType);\n if (!evaluator)\n return undefined;\n const data = new TransitionConditionalProperties(radius0, radius1, bearing0, bearing1, arcLength);\n const data1 = data.clone();\n if (!data.tryResolveAnySingleUnknown())\n return undefined;\n if (fractionInterval === undefined)\n fractionInterval = Segment1d.create(0, 1);\n return new IntegratedSpiral3d(\n spiralType,\n evaluator,\n Segment1d.create(data.radius0, data.radius1),\n AngleSweep.createStartEnd(data.bearing0, data.bearing1),\n fractionInterval ? fractionInterval.clone() : Segment1d.create(0, 1),\n localToWorld, data.curveLength, data1);\n }\n /** Copy all defining data from another spiral. */\n public setFrom(other: IntegratedSpiral3d): IntegratedSpiral3d {\n this.localToWorld.setFrom(other.localToWorld);\n this.radius01.setFrom(other.radius01);\n this._curvature01.setFrom(other._curvature01);\n this.bearing01.setFrom(other.bearing01);\n this.localToWorld.setFrom(other.localToWorld);\n this.activeFractionInterval.setFrom(other.activeFractionInterval);\n this._arcLength01 = other._arcLength01;\n return this;\n }\n /** Deep clone of this spiral. */\n public override clone(): IntegratedSpiral3d {\n return new IntegratedSpiral3d(\n this._spiralType,\n this._evaluator,\n this.radius01.clone(),\n this.bearing01.clone(),\n this.activeFractionInterval.clone(),\n this.localToWorld.clone(),\n this._arcLength01,\n this._designProperties?.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._curvature01.x0 /= rigidData.scale;\n this._curvature01.x1 /= rigidData.scale;\n this.radius01.x0 *= rigidData.scale;\n this.radius01.x1 *= rigidData.scale;\n this._arcLength01 *= rigidData.scale;\n }\n this.refreshComputedProperties();\n return true;\n }\n /** Return the spiral start point. */\n public override startPoint(result?: Point3d): Point3d {\n return this.activeStrokes.startPoint(result);\n }\n /** Return the spiral end point. */\n public override endPoint(result?: Point3d): Point3d {\n return this.activeStrokes.endPoint(result);\n }\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 /**\n * Return length of the spiral.\n * * Because TransitionSpiral is parameterized directly in terms of distance along, this is a simple return value.\n */\n public quickLength() {\n return this.curveLength();\n }\n /**\n * Return length of the spiral.\n * * Because TransitionSpiral is parameterized directly in terms of distance along, this is a simple return value.\n */\n public override curveLength() {\n return this._arcLength01 * (this._activeFractionInterval.absoluteDelta());\n }\n /**\n * Return (unsigned) length of the spiral between fractions.\n * * Because TransitionSpiral is parameterized directly in terms of distance along, this is a simple return value.\n */\n public override curveLengthBetweenFractions(fraction0: number, fraction1: number) {\n return this._arcLength01 * (this._activeFractionInterval.absoluteDelta() * Math.abs(fraction1 - fraction0));\n }\n /** Test if `other` is an instance of `TransitionSpiral3d`. */\n public isSameGeometryClass(other: any): boolean {\n return other instanceof TransitionSpiral3d;\n }\n /**\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 {\n this.activeStrokes.emitStrokes(dest, options);\n }\n /** Emit stroke fragments to `dest` handler. */\n public emitStrokableParts(dest: IStrokeHandler, options?: StrokeOptions): void {\n const n = this.computeStrokeCountForOptions(options);\n dest.startParentCurvePrimitive(this);\n const activeStrokes = this.activeStrokes;\n const preferPrimary = dest.needPrimaryGeometryForStrokes === undefined ? false : dest.needPrimaryGeometryForStrokes();\n if (!preferPrimary && n <= activeStrokes.numPoints()) {\n this.activeStrokes.emitStrokableParts(dest, options);\n } else {\n dest.announceIntervalForUniformStepStrokes(this, n, 0.0, 1.0);\n }\n dest.endParentCurvePrimitive(this);\n }\n /**\n * Return the stroke count required for given options.\n * @param options StrokeOptions that determine count.\n */\n public computeStrokeCountForOptions(options?: StrokeOptions): number {\n let numStroke;\n if (options) {\n const rMin = Math.min(Math.abs(this.radius01.x0), Math.abs(this.radius01.x1));\n numStroke = options.applyTolerancesToArc(rMin, this.bearing01.sweepRadians);\n numStroke = options.applyMaxEdgeLength(numStroke, this.curveLength());\n numStroke = options.applyMinStrokesPerPrimitive(numStroke);\n } else {\n numStroke = StrokeOptions.applyAngleTol(undefined, 4, this.bearing01.sweepRadians);\n }\n return numStroke;\n }\n /**\n * Reverse the active interval and active strokes.\n * * Primary defining data remains unchanged.\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 targetGlobalFraction = this.activeFractionInterval.fractionToPoint(activeFraction);\n const numStrokes = this._globalStrokes.packedPoints.length - 1;\n assert(numStrokes > 0, \"expect constructor to populate nonzero global strokes\");\n if (numStrokes < 1)\n return Point3d.createZero(result); // trust but verify\n if (activeFraction > 1.0) {\n result = this._globalStrokes.packedPoints.getPoint3dAtUncheckedPointIndex(numStrokes, result);\n const integrationStep = 1.0 / numStrokes;\n let currentGlobalFraction = 1.0;\n let nextGlobalFraction = currentGlobalFraction + integrationStep;\n while (nextGlobalFraction < targetGlobalFraction) {\n this.fullSpiralIncrementalIntegral(result, currentGlobalFraction, nextGlobalFraction, true);\n currentGlobalFraction = nextGlobalFraction;\n nextGlobalFraction += integrationStep;\n }\n this.fullSpiralIncrementalIntegral(result, currentGlobalFraction, targetGlobalFraction, true);\n } else if (activeFraction < 0.0) {\n result = this._globalStrokes.packedPoints.getPoint3dAtUncheckedPointIndex(0, result);\n const integrationStep = 1.0 / numStrokes;\n let currentGlobalFraction = 0.0;\n let nextGlobalFraction = currentGlobalFraction - integrationStep;\n while (nextGlobalFraction > targetGlobalFraction) {\n this.fullSpiralIncrementalIntegral(result, currentGlobalFraction, nextGlobalFraction, true);\n currentGlobalFraction = nextGlobalFraction;\n nextGlobalFraction -= integrationStep;\n }\n this.fullSpiralIncrementalIntegral(result, currentGlobalFraction, targetGlobalFraction, true);\n } else {\n const clampedGlobalFraction = Geometry.clampToStartEnd(targetGlobalFraction, 0, 1);\n const index0 = Math.trunc(clampedGlobalFraction * numStrokes);\n assert(0 <= index0 && index0 <= numStrokes, \"expect valid index0, at left of containing stroke interval\");\n const globalFraction0 = index0 / numStrokes;\n result = this._globalStrokes.packedPoints.getPoint3dAtUncheckedPointIndex(index0, result);\n this.fullSpiralIncrementalIntegral(result, globalFraction0, targetGlobalFraction, true);\n }\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 = result ? result : Ray3d.createZero();\n this.fractionToPoint(activeFraction, result.origin);\n const radians = this.globalFractionToBearingRadians(globalFraction);\n const a = this._arcLength01 * this.activeFractionInterval.signedDelta();\n this.localToWorld.matrix.multiplyXY(a * Math.cos(radians), a * Math.sin(radians), result.direction);\n return result;\n }\n /** Return the frenet frame at fractional position. */\n public override fractionToFrenetFrame(activeFraction: number, result?: Transform): Transform {\n const globalFraction = this.activeFractionInterval.fractionToPoint(activeFraction);\n result = result ? result : Transform.createIdentity();\n result.origin.setFrom(this.fractionToPoint(activeFraction));\n Matrix3d.createRigidFromMatrix3d(this.localToWorld.matrix, AxisOrder.XYZ, result.matrix);\n const radians = this.globalFractionToBearingRadians(globalFraction);\n const c = Math.cos(radians);\n const s = Math.sin(radians);\n result.matrix.applyGivensColumnOp(0, 1, c, s);\n return result;\n }\n /**\n * Return a plane with\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\n * the fraction.\n * * vectorV is the second derivative, i.e.derivative of vectorU.\n */\n public fractionToPointAnd2Derivatives(\n activeFraction: number, result?: Plane3dByOriginAndVectors,\n ): Plane3dByOriginAndVectors | undefined {\n const globalFraction = this.activeFractionInterval.fractionToPoint(activeFraction);\n const origin = this.fractionToPoint(activeFraction);\n const radians = this.globalFractionToBearingRadians(globalFraction);\n const c = Math.cos(radians);\n const s = Math.sin(radians);\n const delta = this.activeFractionInterval.signedDelta();\n const a = delta;\n const b = a * delta;\n const vectorX = this.localToWorld.matrix.multiplyXY(a * c, a * s);\n const vectorY = this.localToWorld.matrix.multiplyXY(-b * s, b * c);\n vectorY.scaleInPlace(this.globalFractionToCurvature(globalFraction));\n return Plane3dByOriginAndVectors.createCapture(origin, vectorX, vectorY, 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?: GeometryQuery): boolean {\n if (other instanceof IntegratedSpiral3d) {\n return this.radius01.isAlmostEqual(other.radius01)\n && this.bearing01.isAlmostEqualAllowPeriodShift(other.bearing01)\n && this.localToWorld.isAlmostEqual(other.localToWorld)\n && Geometry.isSameCoordinate(this._arcLength01, other._arcLength01)\n && this.activeFractionInterval.isAlmostEqual(other.activeFractionInterval)\n && this._curvature01.isAlmostEqual(other._curvature01);\n }\n return false;\n }\n}\n// at load time, initialize gauss quadrature workspace\nIntegratedSpiral3d.initWorkSpace();\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"MXCubicAlongArcSpiralEvaluator.js","sourceRoot":"","sources":["../../../../src/curve/spiral/MXCubicAlongArcSpiralEvaluator.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;AAElD;;;;;;;;;GAS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CAAC,CAAC;IAC9G,CAAC;IACD,gCAAgC;IACzB,aAAa,CAAC,KAAU;QAC7B,IAAI,KAAK,YAAY,wBAAwB,EAAE,CAAC;YAC9C,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;;;;;;OAMG;IACI,MAAM,CAAC,2BAA2B,CACvC,cAAsB,EAAE,cAAsB,EAAE,oBAA4B;QAE5E,MAAM,EAAE,GAAG,cAAc,GAAG,cAAc,CAAC;QAC3C,MAAM,EAAE,GAAG,cAAc,GAAG,cAAc,CAAC;QAC3C,MAAM,EAAE,GAAG,oBAAoB,GAAG,oBAAoB,CAAC;QACvD,OAAO,oBAAoB,GAAG,CAAC,GAAG,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,IAAI,GAAG,EAAE,GAAG,EAAE,CAAC,CAAC,CAAC;IACnE,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\n\r\n/**\r\n * MX Cubic along arc.\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 * Lx`.\r\n * * m is (1/6RL).\r\n * * construction length L is nominal along the curve.\r\n * * x length Lx is along the axis, determined by two terms of the clothoid x series.\r\n * @internal\r\n */\r\nexport class MXCubicAlongArcEvaluator extends CubicEvaluator {\r\n public nominalLength1: number;\r\n public nominalRadius1: number;\r\n /** Constructor is private. Caller responsible for cubicM validity. */\r\n private constructor(length1: number, radius1: number, axisLength: number, cubicM: number) {\r\n super(axisLength, cubicM);\r\n this.nominalLength1 = length1;\r\n this.nominalRadius1 = radius1;\r\n }\r\n /** Compute the cubic constant. */\r\n public static computeCubicM(length1: number, radius1: number): number | undefined {\r\n const axisLength = MXCubicAlongArcEvaluator.approximateDistanceAlongToX(length1, radius1, length1);\r\n return 1.0 / (6.0 * radius1 * axisLength);\r\n }\r\n public static create(length1: number, radius1: number): MXCubicAlongArcEvaluator | undefined {\r\n const m = this.computeCubicM(length1, radius1);\r\n if (m === undefined)\r\n return undefined;\r\n const xMax = MXCubicAlongArcEvaluator.approximateDistanceAlongToX(length1, radius1, length1);\r\n return new MXCubicAlongArcEvaluator(length1, radius1, xMax, m);\r\n }\r\n public override scaleInPlace(scaleFactor: number) {\r\n this.nominalLength1 *= scaleFactor;\r\n this.nominalRadius1 *= scaleFactor;\r\n super.scaleInPlace(scaleFactor);\r\n }\r\n /** Return a deep copy of the evaluator. */\r\n public clone(): MXCubicAlongArcEvaluator {\r\n return new MXCubicAlongArcEvaluator(this.nominalLength1, this.nominalRadius1, this.axisLength, this.cubicM);\r\n }\r\n /** Member by member matchup. */\r\n public isAlmostEqual(other: any): boolean {\r\n if (other instanceof MXCubicAlongArcEvaluator) {\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 x position as function of approximate distance along the curve.\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\r\n * CurvePrimitive measurements.\r\n * @param x distance along the x axis.\r\n */\r\n public static approximateDistanceAlongToX(\r\n nominalLength1: number, nominalRadius1: number, nominalDistanceAlong: number,\r\n ): number {\r\n const l2 = nominalLength1 * nominalLength1;\r\n const r2 = nominalRadius1 * nominalRadius1;\r\n const xx = nominalDistanceAlong * nominalDistanceAlong;\r\n return nominalDistanceAlong * (1.0 - xx * xx / (40.0 * r2 * l2));\r\n }\r\n}\r\n"]}
1
+ {"version":3,"file":"MXCubicAlongArcSpiralEvaluator.js","sourceRoot":"","sources":["../../../../src/curve/spiral/MXCubicAlongArcSpiralEvaluator.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;AAElD;;;;;;;;;GASG;AACH,MAAM,OAAO,wBAAyB,SAAQ,cAAc;IACnD,cAAc,CAAS;IACvB,cAAc,CAAS;IAC9B,uEAAuE;IACvE,YAAoB,OAAe,EAAE,OAAe,EAAE,UAAkB,EAAE,MAAc;QACtF,KAAK,CAAC,UAAU,EAAE,MAAM,CAAC,CAAC;QAC1B,IAAI,CAAC,cAAc,GAAG,OAAO,CAAC;QAC9B,IAAI,CAAC,cAAc,GAAG,OAAO,CAAC;IAChC,CAAC;IACD,kCAAkC;IAC3B,MAAM,CAAC,aAAa,CAAC,OAAe,EAAE,OAAe;QAC1D,MAAM,UAAU,GAAG,wBAAwB,CAAC,2BAA2B,CAAC,OAAO,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC;QACnG,OAAO,GAAG,GAAG,CAAC,GAAG,GAAG,OAAO,GAAG,UAAU,CAAC,CAAC;IAC5C,CAAC;IACM,MAAM,CAAC,MAAM,CAAC,OAAe,EAAE,OAAe;QACnD,MAAM,CAAC,GAAG,IAAI,CAAC,aAAa,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;QAC/C,IAAI,CAAC,KAAK,SAAS;YACjB,OAAO,SAAS,CAAC;QACnB,MAAM,IAAI,GAAG,wBAAwB,CAAC,2BAA2B,CAAC,OAAO,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC;QAC7F,OAAO,IAAI,wBAAwB,CAAC,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC;IACjE,CAAC;IACe,YAAY,CAAC,WAAmB;QAC9C,IAAI,CAAC,cAAc,IAAI,WAAW,CAAC;QACnC,IAAI,CAAC,cAAc,IAAI,WAAW,CAAC;QACnC,KAAK,CAAC,YAAY,CAAC,WAAW,CAAC,CAAC;IAClC,CAAC;IACD,2CAA2C;IACpC,KAAK;QACV,OAAO,IAAI,wBAAwB,CAAC,IAAI,CAAC,cAAc,EAAE,IAAI,CAAC,cAAc,EAAE,IAAI,CAAC,UAAU,EAAE,IAAI,CAAC,MAAM,CAAC,CAAC;IAC9G,CAAC;IACD,gCAAgC;IACzB,aAAa,CAAC,KAAU;QAC7B,IAAI,KAAK,YAAY,wBAAwB,EAAE,CAAC;YAC9C,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;;;;;;OAMG;IACI,MAAM,CAAC,2BAA2B,CACvC,cAAsB,EAAE,cAAsB,EAAE,oBAA4B;QAE5E,MAAM,EAAE,GAAG,cAAc,GAAG,cAAc,CAAC;QAC3C,MAAM,EAAE,GAAG,cAAc,GAAG,cAAc,CAAC;QAC3C,MAAM,EAAE,GAAG,oBAAoB,GAAG,oBAAoB,CAAC;QACvD,OAAO,oBAAoB,GAAG,CAAC,GAAG,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,IAAI,GAAG,EAAE,GAAG,EAAE,CAAC,CAAC,CAAC;IACnE,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\";\n\n/**\n * MX Cubic along arc.\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 * Lx`.\n * * m is (1/6RL).\n * * construction length L is nominal along the curve.\n * * x length Lx is along the axis, determined by two terms of the clothoid x series.\n * @internal\n */\nexport class MXCubicAlongArcEvaluator extends CubicEvaluator {\n public nominalLength1: number;\n public nominalRadius1: number;\n /** Constructor is private. Caller responsible for cubicM validity. */\n private constructor(length1: number, radius1: number, axisLength: number, cubicM: number) {\n super(axisLength, cubicM);\n this.nominalLength1 = length1;\n this.nominalRadius1 = radius1;\n }\n /** Compute the cubic constant. */\n public static computeCubicM(length1: number, radius1: number): number | undefined {\n const axisLength = MXCubicAlongArcEvaluator.approximateDistanceAlongToX(length1, radius1, length1);\n return 1.0 / (6.0 * radius1 * axisLength);\n }\n public static create(length1: number, radius1: number): MXCubicAlongArcEvaluator | undefined {\n const m = this.computeCubicM(length1, radius1);\n if (m === undefined)\n return undefined;\n const xMax = MXCubicAlongArcEvaluator.approximateDistanceAlongToX(length1, radius1, length1);\n return new MXCubicAlongArcEvaluator(length1, radius1, xMax, m);\n }\n public override scaleInPlace(scaleFactor: number) {\n this.nominalLength1 *= scaleFactor;\n this.nominalRadius1 *= scaleFactor;\n super.scaleInPlace(scaleFactor);\n }\n /** Return a deep copy of the evaluator. */\n public clone(): MXCubicAlongArcEvaluator {\n return new MXCubicAlongArcEvaluator(this.nominalLength1, this.nominalRadius1, this.axisLength, this.cubicM);\n }\n /** Member by member matchup. */\n public isAlmostEqual(other: any): boolean {\n if (other instanceof MXCubicAlongArcEvaluator) {\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 x position as function of approximate distance along the curve.\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\n * CurvePrimitive measurements.\n * @param x distance along the x axis.\n */\n public static approximateDistanceAlongToX(\n nominalLength1: number, nominalRadius1: number, nominalDistanceAlong: number,\n ): number {\n const l2 = nominalLength1 * nominalLength1;\n const r2 = nominalRadius1 * nominalRadius1;\n const xx = nominalDistanceAlong * nominalDistanceAlong;\n return nominalDistanceAlong * (1.0 - xx * xx / (40.0 * r2 * l2));\n }\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"NormalizedTransition.js","sourceRoot":"","sources":["../../../../src/curve/spiral/NormalizedTransition.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAE/F;;GAEG;AAEH;;;;;;;;;;;;;GAaG;AACH,2CAA2C;AAC3C,MAAM,OAAgB,oBAAoB;IACxC,gHAAgH;IAChH,gBAAgB,CAAC;IAUT,MAAM,CAAC,kBAAkB,CAAgC;IACzD,MAAM,CAAC,qBAAqB,CAAmC;IAC/D,MAAM,CAAC,eAAe,CAA6B;IACnD,MAAM,CAAC,cAAc,CAA4B;IACjD,MAAM,CAAC,gBAAgB,CAA8B;IAC7D;;;;;;;;;;;OAWG;IACI,MAAM,CAAC,aAAa,CAAC,IAAY;QACtC,IAAI,IAAI,KAAK,UAAU;YACrB,OAAO,IAAI,CAAC,kBAAkB,CAAC,CAAC,CAAC,IAAI,CAAC,kBAAkB,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,kBAAkB,GAAG,IAAI,4BAA4B,EAAE,CAAC,CAAC;QAC5H,IAAI,IAAI,KAAK,OAAO;YAClB,OAAO,IAAI,CAAC,eAAe,CAAC,CAAC,CAAC,IAAI,CAAC,eAAe,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,eAAe,GAAG,IAAI,yBAAyB,EAAE,CAAC,CAAC;QAChH,IAAI,IAAI,KAAK,aAAa;YACxB,OAAO,IAAI,CAA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,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;IACrC,CAAC;IACD,oEAAoE;IAC7D,qCAAqC,CAAC,CAAS;QACpD,MAAM,CAAC,GAAG,IAAI,CAAC,EAAE,CAAC;QAClB,OAAO,GAAG,GAAG,CAAC,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC;IACnC,CAAC;IACD;;;OAGG;IACI,cAAc,CAAC,CAAS;QAC7B,MAAM,CAAC,GAAG,IAAI,CAAC,EAAE,CAAC;QAClB,OAAO,GAAG,GAAG,CAAC,GAAG,GAAG,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC;IAC7C,CAAC;CACF","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n\r\n/** @packageDocumentation\r\n * @module Curve\r\n */\r\n\r\n/**\r\n * NormalizedTransition is the (abstract) base class for clothoid, bloss, biquadratic, sine, and cosine transition functions.\r\n * * Each function maps fractional progress to a curvature value.\r\n * * f(0) === 0\r\n * * f(1) === 1\r\n * * f(u) === 1 - f(1-u)\r\n * * Each implementation provides:\r\n * * fractionToCurvature -- the f(u) function described above\r\n * * fractionToCurvatureDerivative -- df(u)/du\r\n * * fractionToArea -- antiderivative A of f, chosen such that A(0) = 0. The value of this function at\r\n * fraction u is the area under f from 0 to u. In particular, the symmetry condition on f implies that\r\n * 1/2 = \"integral of f over [0,1]\" = A(1) - A(0) = A(1).\r\n * @internal\r\n */\r\n// see internaldocs/Spiral.md for more info\r\nexport abstract class NormalizedTransition {\r\n /** Constructor initializes with 0..1 values. Call \"setBearingCurvatureLengthCurvature\" to apply real values. */\r\n constructor() { }\r\n /** At fractional position on the x axis, return the (normalized) curvature fraction. */\r\n public abstract fractionToCurvatureFraction(fractionX: number): number;\r\n /** Return the derivative of the (normalized) curvature fraction. */\r\n public abstract fractionToCurvatureFractionDerivative(fractionX: number): number;\r\n /**\r\n * Return the integrated area under the curve.\r\n * * This is equal to the accumulated angle change.\r\n */\r\n public abstract fractionToArea(fractionX: number): number;\r\n private static _clothoidEvaluator?: NormalizedClothoidTransition;\r\n private static _biquadraticEvaluator?: NormalizedBiQuadraticTransition;\r\n private static _blossEvaluator?: NormalizedBlossTransition;\r\n private static _sineEvaluator?: NormalizedSineTransition;\r\n private static _cosineEvaluator?: NormalizedCosineTransition;\r\n /**\r\n * Return a standard evaluator identified by string as:\r\n * * clothoid\r\n * * bloss\r\n * * biquadratic\r\n * * sine\r\n * * cosine\r\n * Each of these types\r\n * * is instantiated (only once) as a single static object within the NormalizedTransition class.\r\n * * has no instance data or mutator methods.\r\n * @param name string name of the transition.\r\n */\r\n public static findEvaluator(name: string): NormalizedTransition | undefined {\r\n if (name === \"clothoid\")\r\n return this._clothoidEvaluator ? this._clothoidEvaluator : (this._clothoidEvaluator = new NormalizedClothoidTransition());\r\n if (name === \"bloss\")\r\n return this._blossEvaluator ? this._blossEvaluator : (this._blossEvaluator = new NormalizedBlossTransition());\r\n if (name === \"biquadratic\")\r\n return this._biquadraticEvaluator ? this._biquadraticEvaluator : (this._biquadraticEvaluator = new NormalizedBiQuadraticTransition());\r\n if (name === \"sine\")\r\n return this._sineEvaluator ? this._sineEvaluator : (this._sineEvaluator = new NormalizedSineTransition());\r\n if (name === \"cosine\")\r\n return this._cosineEvaluator ? this._cosineEvaluator : (this._cosineEvaluator = new NormalizedCosineTransition());\r\n return undefined;\r\n }\r\n}\r\n\r\n/**\r\n * Transition functions for clothoid spiral.\r\n * * Curvature variation is linear from (0,0) to (1,1).\r\n * @internal\r\n */\r\nexport class NormalizedClothoidTransition extends NormalizedTransition {\r\n // clothoid curvature is f(x) = x\r\n // derivative f'(x) = 1\r\n // integral If(x) = x^2 / 2\r\n constructor() {\r\n super();\r\n }\r\n /** At fractional position on the x axis, return the (normalized) curvature fraction. */\r\n public fractionToCurvatureFraction(fractionX: number): number {\r\n return fractionX;\r\n }\r\n /** Return the derivative of the (normalized) curvature fraction. */\r\n public fractionToCurvatureFractionDerivative(_u: number): number {\r\n return 1.0;\r\n }\r\n /**\r\n * Return the integrated area under the curve.\r\n * * This fraction is the angular change fraction.\r\n */\r\n public fractionToArea(fractionX: number): number {\r\n return fractionX * fractionX * 0.5;\r\n }\r\n}\r\n\r\n/**\r\n * Transition functions for bloss spiral.\r\n * * curvature variation is cubic from (0,0) with slope 0 to (1,1) with slope 1.\r\n * @internal\r\n */\r\nexport class NormalizedBlossTransition extends NormalizedTransition {\r\n // bloss curvature is x^2 (3 - 2x)\r\n // derivative 6x (1-x)\r\n // integral is x^3 (1-x/2)\r\n constructor() {\r\n super();\r\n }\r\n /** At fractional position on the x axis, return the (normalized) curvature fraction. */\r\n public fractionToCurvatureFraction(u: number): number {\r\n return u * u * (3 - 2 * u);\r\n }\r\n /** Return the derivative of the (normalized) curvature fraction. */\r\n public fractionToCurvatureFractionDerivative(u: number): number {\r\n return 6.0 * u * (1.0 - u);\r\n }\r\n /**\r\n * Return the integrated area under the curve.\r\n * * This fraction is the angular change fraction.\r\n */\r\n public fractionToArea(u: number): number {\r\n return u * u * u * (1 - 0.5 * u);\r\n }\r\n}\r\n\r\n/**\r\n * Transition functions for biquadratic transition.\r\n * * Curvature is a pair of joining quadratics.\r\n * * In lower half of the interval, the quadratic is from (0,0) to (0.5, 0.5) with zero slope at origin.\r\n * * In upper half of the interval, the quadratic is from (0.5,0.5) to (1,1) with zero slope at 1.\r\n * @internal\r\n */\r\nexport class NormalizedBiQuadraticTransition extends NormalizedTransition {\r\n constructor() {\r\n super();\r\n }\r\n private integratedBasis(u: number): number {\r\n return u * u * u * (2.0 / 3.0);\r\n }\r\n private basis(u: number): number {\r\n return 2 * u * u;\r\n }\r\n private basisDerivative(u: number): number {\r\n return 4 * u;\r\n }\r\n /**\r\n * At fractional position on the x axis, return the (normalized) curvature fraction.\r\n * * For [u <= 0.5, u > 0.5]\r\n * * f(u) = [2u^2, 1 - 2(1-u)^2]\r\n * * f'(u) = [4u, 4(1-u)]\r\n * * If(u) = [2u^3 / 3, u + 2(1-u)^3 /3]\r\n */\r\n public fractionToCurvatureFraction(u: number): number {\r\n return u <= 0.5 ? this.basis(u) : 1.0 - this.basis(1.0 - u);\r\n }\r\n /** Return the derivative of the (normalized) curvature fraction. */\r\n public fractionToCurvatureFractionDerivative(u: number): number {\r\n return u <= 0.5 ? this.basisDerivative(u) : this.basisDerivative(1 - u);\r\n }\r\n /**\r\n * Return the integrated area under the curve.\r\n * * This fraction is the angular change fraction.\r\n */\r\n public fractionToArea(u: number): number {\r\n if (u <= 0.5)\r\n return this.integratedBasis(u);\r\n // if u > 0.5, integral[0 to u] would be integral[0 to 0.5] of \"2u^2\" + integral[0.5 to u] of \"1 - 2(1-u)^2\"\r\n const v = 1 - u;\r\n return 0.5 - v + this.integratedBasis(v);\r\n }\r\n}\r\n\r\n/**\r\n * Transition functions for sine transition.\r\n * * curvature variation is the sum of\r\n * * straight line from (0,0) to (1,1), like clothoid.\r\n * * additional full period of a sine wave, producing 0 slope at both ends.\r\n * @internal\r\n */\r\nexport class NormalizedSineTransition extends NormalizedTransition {\r\n // sine transition curvature is x - sin(2 pi x) / (2 pi)\r\n // derivative 1 - cos(2 pi x)\r\n // integral x^2 / 2 + (cos(2 pi x) - 1) / (4 pi^2)\r\n // note: this is the only snap function whose antiderivative is chosen with nonzero integration constant.\r\n constructor() {\r\n super();\r\n }\r\n /** At fractional position on the x axis, return the (normalized) curvature fraction. */\r\n public fractionToCurvatureFraction(u: number): number {\r\n const a = 2.0 * Math.PI;\r\n return u - Math.sin(u * a) / a;\r\n }\r\n /** Return the derivative of the (normalized) curvature fraction. */\r\n public fractionToCurvatureFractionDerivative(u: number): number {\r\n const a = 2.0 * Math.PI;\r\n return 1 - Math.cos(u * a);\r\n }\r\n /**\r\n * Return the integrated area under the curve.\r\n * * This fraction is the angular change fraction.\r\n */\r\n public fractionToArea(u: number): number {\r\n const a = 2.0 * Math.PI;\r\n return 0.5 * u * u + (Math.cos(u * a) - 1.0) / (a * a);\r\n }\r\n}\r\n\r\n/**\r\n * Transition functions for cosine.\r\n * * curvature variation is a half period of a cosine.\r\n * @internal\r\n */\r\nexport class NormalizedCosineTransition extends NormalizedTransition {\r\n // cosine transition curvature is 0.5 (1 - cos(pi x))\r\n // derivative 0.5 pi sin(pi x)\r\n // integral 0.5 (x - sin(pi x) / pi)\r\n constructor() {\r\n super();\r\n }\r\n /** At fractional position on the x axis, return the (normalized) curvature fraction. */\r\n public fractionToCurvatureFraction(u: number): number {\r\n const a = Math.PI;\r\n return 0.5 * (1 - Math.cos(u * a));\r\n }\r\n /** Return the derivative of the (normalized) curvature fraction. */\r\n public fractionToCurvatureFractionDerivative(u: number): number {\r\n const a = Math.PI;\r\n return 0.5 * a * Math.sin(u * a);\r\n }\r\n /**\r\n * Return the integrated area under the curve.\r\n * * This fraction is the angular change fraction.\r\n */\r\n public fractionToArea(u: number): number {\r\n const a = Math.PI;\r\n return 0.5 * u - 0.5 * Math.sin(u * a) / a;\r\n }\r\n}\r\n"]}
1
+ {"version":3,"file":"NormalizedTransition.js","sourceRoot":"","sources":["../../../../src/curve/spiral/NormalizedTransition.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAE/F;;GAEG;AAEH;;;;;;;;;;;;;GAaG;AACH,2CAA2C;AAC3C,MAAM,OAAgB,oBAAoB;IACxC,gHAAgH;IAChH,gBAAgB,CAAC;IAUT,MAAM,CAAC,kBAAkB,CAAgC;IACzD,MAAM,CAAC,qBAAqB,CAAmC;IAC/D,MAAM,CAAC,eAAe,CAA6B;IACnD,MAAM,CAAC,cAAc,CAA4B;IACjD,MAAM,CAAC,gBAAgB,CAA8B;IAC7D;;;;;;;;;;;OAWG;IACI,MAAM,CAAC,aAAa,CAAC,IAAY;QACtC,IAAI,IAAI,KAAK,UAAU;YACrB,OAAO,IAAI,CAAC,kBAAkB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GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC;IACzD,CAAC;CACF;AAED;;;;GAIG;AACH,MAAM,OAAO,0BAA2B,SAAQ,oBAAoB;IAClE,qDAAqD;IACrD,8BAA8B;IAC9B,oCAAoC;IACpC;QACE,KAAK,EAAE,CAAC;IACV,CAAC;IACD,wFAAwF;IACjF,2BAA2B,CAAC,CAAS;QAC1C,MAAM,CAAC,GAAG,IAAI,CAAC,EAAE,CAAC;QAClB,OAAO,GAAG,GAAG,CAAC,CAAC,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;IACrC,CAAC;IACD,oEAAoE;IAC7D,qCAAqC,CAAC,CAAS;QACpD,MAAM,CAAC,GAAG,IAAI,CAAC,EAAE,CAAC;QAClB,OAAO,GAAG,GAAG,CAAC,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC;IACnC,CAAC;IACD;;;OAGG;IACI,cAAc,CAAC,CAAS;QAC7B,MAAM,CAAC,GAAG,IAAI,CAAC,EAAE,CAAC;QAClB,OAAO,GAAG,GAAG,CAAC,GAAG,GAAG,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC;IAC7C,CAAC;CACF","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n\n/** @packageDocumentation\n * @module Curve\n */\n\n/**\n * NormalizedTransition is the (abstract) base class for clothoid, bloss, biquadratic, sine, and cosine transition functions.\n * * Each function maps fractional progress to a curvature value.\n * * f(0) === 0\n * * f(1) === 1\n * * f(u) === 1 - f(1-u)\n * * Each implementation provides:\n * * fractionToCurvature -- the f(u) function described above\n * * fractionToCurvatureDerivative -- df(u)/du\n * * fractionToArea -- antiderivative A of f, chosen such that A(0) = 0. The value of this function at\n * fraction u is the area under f from 0 to u. In particular, the symmetry condition on f implies that\n * 1/2 = \"integral of f over [0,1]\" = A(1) - A(0) = A(1).\n * @internal\n */\n// see internaldocs/Spiral.md for more info\nexport abstract class NormalizedTransition {\n /** Constructor initializes with 0..1 values. Call \"setBearingCurvatureLengthCurvature\" to apply real values. */\n constructor() { }\n /** At fractional position on the x axis, return the (normalized) curvature fraction. */\n public abstract fractionToCurvatureFraction(fractionX: number): number;\n /** Return the derivative of the (normalized) curvature fraction. */\n public abstract fractionToCurvatureFractionDerivative(fractionX: number): number;\n /**\n * Return the integrated area under the curve.\n * * This is equal to the accumulated angle change.\n */\n public abstract fractionToArea(fractionX: number): number;\n private static _clothoidEvaluator?: NormalizedClothoidTransition;\n private static _biquadraticEvaluator?: NormalizedBiQuadraticTransition;\n private static _blossEvaluator?: NormalizedBlossTransition;\n private static _sineEvaluator?: NormalizedSineTransition;\n private static _cosineEvaluator?: NormalizedCosineTransition;\n /**\n * Return a standard evaluator identified by string as:\n * * clothoid\n * * bloss\n * * biquadratic\n * * sine\n * * cosine\n * Each of these types\n * * is instantiated (only once) as a single static object within the NormalizedTransition class.\n * * has no instance data or mutator methods.\n * @param name string name of the transition.\n */\n public static findEvaluator(name: string): NormalizedTransition | undefined {\n if (name === \"clothoid\")\n return this._clothoidEvaluator ? this._clothoidEvaluator : (this._clothoidEvaluator = new NormalizedClothoidTransition());\n if (name === \"bloss\")\n return this._blossEvaluator ? this._blossEvaluator : (this._blossEvaluator = new NormalizedBlossTransition());\n if (name === \"biquadratic\")\n return this._biquadraticEvaluator ? this._biquadraticEvaluator : (this._biquadraticEvaluator = new NormalizedBiQuadraticTransition());\n if (name === \"sine\")\n return this._sineEvaluator ? this._sineEvaluator : (this._sineEvaluator = new NormalizedSineTransition());\n if (name === \"cosine\")\n return this._cosineEvaluator ? this._cosineEvaluator : (this._cosineEvaluator = new NormalizedCosineTransition());\n return undefined;\n }\n}\n\n/**\n * Transition functions for clothoid spiral.\n * * Curvature variation is linear from (0,0) to (1,1).\n * @internal\n */\nexport class NormalizedClothoidTransition extends NormalizedTransition {\n // clothoid curvature is f(x) = x\n // derivative f'(x) = 1\n // integral If(x) = x^2 / 2\n constructor() {\n super();\n }\n /** At fractional position on the x axis, return the (normalized) curvature fraction. */\n public fractionToCurvatureFraction(fractionX: number): number {\n return fractionX;\n }\n /** Return the derivative of the (normalized) curvature fraction. */\n public fractionToCurvatureFractionDerivative(_u: number): number {\n return 1.0;\n }\n /**\n * Return the integrated area under the curve.\n * * This fraction is the angular change fraction.\n */\n public fractionToArea(fractionX: number): number {\n return fractionX * fractionX * 0.5;\n }\n}\n\n/**\n * Transition functions for bloss spiral.\n * * curvature variation is cubic from (0,0) with slope 0 to (1,1) with slope 1.\n * @internal\n */\nexport class NormalizedBlossTransition extends NormalizedTransition {\n // bloss curvature is x^2 (3 - 2x)\n // derivative 6x (1-x)\n // integral is x^3 (1-x/2)\n constructor() {\n super();\n }\n /** At fractional position on the x axis, return the (normalized) curvature fraction. */\n public fractionToCurvatureFraction(u: number): number {\n return u * u * (3 - 2 * u);\n }\n /** Return the derivative of the (normalized) curvature fraction. */\n public fractionToCurvatureFractionDerivative(u: number): number {\n return 6.0 * u * (1.0 - u);\n }\n /**\n * Return the integrated area under the curve.\n * * This fraction is the angular change fraction.\n */\n public fractionToArea(u: number): number {\n return u * u * u * (1 - 0.5 * u);\n }\n}\n\n/**\n * Transition functions for biquadratic transition.\n * * Curvature is a pair of joining quadratics.\n * * In lower half of the interval, the quadratic is from (0,0) to (0.5, 0.5) with zero slope at origin.\n * * In upper half of the interval, the quadratic is from (0.5,0.5) to (1,1) with zero slope at 1.\n * @internal\n */\nexport class NormalizedBiQuadraticTransition extends NormalizedTransition {\n constructor() {\n super();\n }\n private integratedBasis(u: number): number {\n return u * u * u * (2.0 / 3.0);\n }\n private basis(u: number): number {\n return 2 * u * u;\n }\n private basisDerivative(u: number): number {\n return 4 * u;\n }\n /**\n * At fractional position on the x axis, return the (normalized) curvature fraction.\n * * For [u <= 0.5, u > 0.5]\n * * f(u) = [2u^2, 1 - 2(1-u)^2]\n * * f'(u) = [4u, 4(1-u)]\n * * If(u) = [2u^3 / 3, u + 2(1-u)^3 /3]\n */\n public fractionToCurvatureFraction(u: number): number {\n return u <= 0.5 ? this.basis(u) : 1.0 - this.basis(1.0 - u);\n }\n /** Return the derivative of the (normalized) curvature fraction. */\n public fractionToCurvatureFractionDerivative(u: number): number {\n return u <= 0.5 ? this.basisDerivative(u) : this.basisDerivative(1 - u);\n }\n /**\n * Return the integrated area under the curve.\n * * This fraction is the angular change fraction.\n */\n public fractionToArea(u: number): number {\n if (u <= 0.5)\n return this.integratedBasis(u);\n // if u > 0.5, integral[0 to u] would be integral[0 to 0.5] of \"2u^2\" + integral[0.5 to u] of \"1 - 2(1-u)^2\"\n const v = 1 - u;\n return 0.5 - v + this.integratedBasis(v);\n }\n}\n\n/**\n * Transition functions for sine transition.\n * * curvature variation is the sum of\n * * straight line from (0,0) to (1,1), like clothoid.\n * * additional full period of a sine wave, producing 0 slope at both ends.\n * @internal\n */\nexport class NormalizedSineTransition extends NormalizedTransition {\n // sine transition curvature is x - sin(2 pi x) / (2 pi)\n // derivative 1 - cos(2 pi x)\n // integral x^2 / 2 + (cos(2 pi x) - 1) / (4 pi^2)\n // note: this is the only snap function whose antiderivative is chosen with nonzero integration constant.\n constructor() {\n super();\n }\n /** At fractional position on the x axis, return the (normalized) curvature fraction. */\n public fractionToCurvatureFraction(u: number): number {\n const a = 2.0 * Math.PI;\n return u - Math.sin(u * a) / a;\n }\n /** Return the derivative of the (normalized) curvature fraction. */\n public fractionToCurvatureFractionDerivative(u: number): number {\n const a = 2.0 * Math.PI;\n return 1 - Math.cos(u * a);\n }\n /**\n * Return the integrated area under the curve.\n * * This fraction is the angular change fraction.\n */\n public fractionToArea(u: number): number {\n const a = 2.0 * Math.PI;\n return 0.5 * u * u + (Math.cos(u * a) - 1.0) / (a * a);\n }\n}\n\n/**\n * Transition functions for cosine.\n * * curvature variation is a half period of a cosine.\n * @internal\n */\nexport class NormalizedCosineTransition extends NormalizedTransition {\n // cosine transition curvature is 0.5 (1 - cos(pi x))\n // derivative 0.5 pi sin(pi x)\n // integral 0.5 (x - sin(pi x) / pi)\n constructor() {\n super();\n }\n /** At fractional position on the x axis, return the (normalized) curvature fraction. */\n public fractionToCurvatureFraction(u: number): number {\n const a = Math.PI;\n return 0.5 * (1 - Math.cos(u * a));\n }\n /** Return the derivative of the (normalized) curvature fraction. */\n public fractionToCurvatureFractionDerivative(u: number): number {\n const a = Math.PI;\n return 0.5 * a * Math.sin(u * a);\n }\n /**\n * Return the integrated area under the curve.\n * * This fraction is the angular change fraction.\n */\n public fractionToArea(u: number): number {\n const a = Math.PI;\n return 0.5 * u - 0.5 * Math.sin(u * a) / a;\n }\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"PolishCubicSpiralEvaluator.js","sourceRoot":"","sources":["../../../../src/curve/spiral/PolishCubicSpiralEvaluator.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAE/F;;GAEG;AACH,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAC1C,OAAO,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AACrD,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAElD;;;;;;;;GAQG;AACH,MAAM,OAAO,oBAAqB,SAAQ,cAAc;IAC/C,cAAc,CAAS;IACvB,cAAc,CAAS;IAC9B,uEAAuE;IACvE,YAAoB,OAAe,EAAE,OAAe,EAAE,UAAkB,EAAE,MAAc;QACtF,KAAK,CAAC,UAAU,EAAE,MAAM,CAAC,CAAC;QAC1B,IAAI,CAAC,cAAc,GAAG,OAAO,CAAC;QAC9B,IAAI,CAAC,cAAc,GAAG,OAAO,CAAC;IAChC,CAAC;IACD,wCAAwC;IACjC,MAAM,CAAC,aAAa,CAAC,OAAe,EAAE,OAAe;QAC1D,OAAO,GAAG,GAAG,CAAC,GAAG,GAAG,OAAO,GAA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AAG,IAAI,GAAG,GAAG,GAAG,GAAG,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;QAC7F,OAAO,EAAE,CAAC;IACZ,CAAC;IACD,kDAAkD;IAC3C,MAAM,CAAC,2BAA2B,CAAC,CAAS,EAAE,OAAe,EAAE,OAAe;QACnF,MAAM,IAAI,GAAG,YAAY,CAAC,WAAW,CAAC,CAAC,EACrC,CAAC,CAAS,EAAE,EAAE,CAAC,CAAC,IAAI,CAAC,sBAAsB,CAAC,CAAC,EAAE,OAAO,EAAE,OAAO,CAAC,GAAG,CAAC,CAAC,EACrE,CAAC,CAAS,EAAE,EAAE,CAAC,IAAI,CAAC,gCAAgC,CAAC,CAAC,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC,CAAC;QAC7E,OAAO,IAAI,CAAC;IACd,CAAC;CACF","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n\r\n/** @packageDocumentation\r\n * @module Curve\r\n */\r\nimport { Geometry } from \"../../Geometry\";\r\nimport { SimpleNewton } from \"../../numerics/Newton\";\r\nimport { CubicEvaluator } from \"./CubicEvaluator\";\r\n\r\n/**\r\n * Polish Cubic.\r\n * * Construction takes nominal length and end radius.\r\n * curve is y = m*x^3 with\r\n * * x any point on the x axis.\r\n * * m is (1/6RL).\r\n * * Lx = x length is along the axis, determined by inversion of a distance series at nominal length.\r\n * @internal\r\n */\r\nexport class PolishCubicEvaluator extends CubicEvaluator {\r\n public nominalLength1: number;\r\n public nominalRadius1: number;\r\n /** Constructor is private. Caller responsible for cubicM validity. */\r\n private constructor(length1: number, radius1: number, axisLength: number, cubicM: number) {\r\n super(axisLength, cubicM);\r\n this.nominalLength1 = length1;\r\n this.nominalRadius1 = radius1;\r\n }\r\n /** Compute the czech cubic constant. */\r\n public static computeCubicM(length1: number, radius1: number): number {\r\n return 1.0 / (6.0 * length1 * radius1);\r\n }\r\n public static create(length1: number, radius1: number): PolishCubicEvaluator | undefined {\r\n const m = this.computeCubicM(length1, radius1);\r\n if (m === undefined)\r\n return undefined;\r\n const xMax = PolishCubicEvaluator.approximateDistanceAlongToX(length1, radius1, length1);\r\n if (xMax === undefined)\r\n return undefined;\r\n return new PolishCubicEvaluator(length1, radius1, xMax, m);\r\n }\r\n public override scaleInPlace(scaleFactor: number) {\r\n this.nominalLength1 *= scaleFactor;\r\n this.nominalRadius1 *= scaleFactor;\r\n super.scaleInPlace(scaleFactor);\r\n }\r\n /** Return a deep copy of the evaluator. */\r\n public clone(): PolishCubicEvaluator {\r\n return new PolishCubicEvaluator(this.nominalLength1, this.nominalRadius1, this.axisLength, this.cubicM);\r\n }\r\n /** Member by member matchup. */\r\n public isAlmostEqual(other: any): boolean {\r\n if (other instanceof PolishCubicEvaluator) {\r\n return Geometry.isSameCoordinate(this.nominalLength1, other.nominalLength1)\r\n && Geometry.isSameCoordinate(this.nominalRadius1, other.nominalRadius1);\r\n }\r\n return false;\r\n }\r\n /** Compute the coefficient of x^4 in the x-to-distance series expansion. */\r\n public static computeX4SeriesCoefficient(length1: number, radius1: number): number {\r\n return 1.0 / (4.0 * length1 * length1 * radius1 * radius1);\r\n }\r\n /**\r\n * Evaluate a series approximation of distance along the true curve.\r\n * @param x distance along x axis.\r\n * @param radius1 nominal end radius.\r\n * @param length1 nominal length along curve.\r\n * @returns\r\n */\r\n public static xToApproximateDistance(x: number, radius1: number, length1: number): number {\r\n // C31 * ( 1 + 1 / 10 * E31 - 1 / 72 * E31^2 + 1 / 208 * E31^3 - 5 / 2176 * E31^4 )\r\n const a4 = this.computeX4SeriesCoefficient(length1, radius1);\r\n const ax2 = a4 * x * x;\r\n const ax3 = ax2 * x;\r\n const ax4 = ax3 * x;\r\n const s0 = x * (1.0 + ax4 * (0.1 + ax4 * (-1.0 / 72.0 + ax4 * (1.0 / 208.0 - 5.0 * ax4 / 2176.0))));\r\n return s0;\r\n }\r\n /**\r\n * Evaluate the derivative of the x-to-distance series.\r\n * @param x distance along x axis.\r\n * @param radius1 nominal end radius.\r\n * @param length1 nominal length along curve.\r\n * @returns\r\n */\r\n public static xToApproximateDistanceDerivative(x: number, radius1: number, length1: number): number {\r\n // C31 * ( 1 + 1 / 10 * E31 - 1 / 72 * E31^2 + 1 / 208 * E31^3 - 5 / 2176 * E31^4 )\r\n const a4 = this.computeX4SeriesCoefficient(length1, radius1);\r\n const ax2 = a4 * x * x;\r\n const ax3 = ax2 * x;\r\n const ax4 = ax3 * x;\r\n // derivative notes:\r\n // take away leading x -- this reduces each power by 1\r\n // multiply each coefficient by its original power:\r\n // 0.1 ==> 0.5\r\n // 1/72 ==> 9/72 = 1/8\r\n // 1/208 ==> 13/208 = 1/16\r\n // 1/2176 ==> 17/2176 = 1/128\r\n const ds = (1.0 + ax4 * (0.5 + ax4 * (-1.0 / 8.0 + ax4 * (1.0 / 16.0 - 5.0 * ax4 / 128.0))));\r\n return ds;\r\n }\r\n /** Invert the xToApproximateDistance function. */\r\n public static approximateDistanceAlongToX(s: number, radius1: number, length1: number): number | undefined {\r\n const root = SimpleNewton.runNewton1D(s,\r\n (x: number) => (this.xToApproximateDistance(x, radius1, length1) - s),\r\n (x: number) => this.xToApproximateDistanceDerivative(x, radius1, length1));\r\n return root;\r\n }\r\n}\r\n"]}
1
+ {"version":3,"file":"PolishCubicSpiralEvaluator.js","sourceRoot":"","sources":["../../../../src/curve/spiral/PolishCubicSpiralEvaluator.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAE/F;;GAEG;AACH,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAC1C,OAAO,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AACrD,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAElD;;;;;;;;GAQG;AACH,MAAM,OAAO,oBAAqB,SAAQ,cAAc;IAC/C,cAAc,CAAS;IACvB,cAAc,C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B,MAAM,GAAG,GAAG,GAAG,GAAG,CAAC,CAAC;QACpB,MAAM,GAAG,GAAG,GAAG,GAAG,CAAC,CAAC;QACpB,oBAAoB;QACpB,sDAAsD;QACtD,mDAAmD;QACnD,cAAc;QACd,uBAAuB;QACvB,0BAA0B;QAC1B,6BAA6B;QAC7B,MAAM,EAAE,GAAG,CAAC,GAAG,GAAG,GAAG,GAAG,CAAC,GAAG,GAAG,GAAG,GAAG,CAAC,CAAC,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,CAAC,GAAG,GAAG,IAAI,GAAG,GAAG,GAAG,GAAG,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;QAC7F,OAAO,EAAE,CAAC;IACZ,CAAC;IACD,kDAAkD;IAC3C,MAAM,CAAC,2BAA2B,CAAC,CAAS,EAAE,OAAe,EAAE,OAAe;QACnF,MAAM,IAAI,GAAG,YAAY,CAAC,WAAW,CAAC,CAAC,EACrC,CAAC,CAAS,EAAE,EAAE,CAAC,CAAC,IAAI,CAAC,sBAAsB,CAAC,CAAC,EAAE,OAAO,EAAE,OAAO,CAAC,GAAG,CAAC,CAAC,EACrE,CAAC,CAAS,EAAE,EAAE,CAAC,IAAI,CAAC,gCAAgC,CAAC,CAAC,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC,CAAC;QAC7E,OAAO,IAAI,CAAC;IACd,CAAC;CACF","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n\n/** @packageDocumentation\n * @module Curve\n */\nimport { Geometry } from \"../../Geometry\";\nimport { SimpleNewton } from \"../../numerics/Newton\";\nimport { CubicEvaluator } from \"./CubicEvaluator\";\n\n/**\n * Polish Cubic.\n * * Construction takes nominal length and end radius.\n * curve is y = m*x^3 with\n * * x any point on the x axis.\n * * m is (1/6RL).\n * * Lx = x length is along the axis, determined by inversion of a distance series at nominal length.\n * @internal\n */\nexport class PolishCubicEvaluator extends CubicEvaluator {\n public nominalLength1: number;\n public nominalRadius1: number;\n /** Constructor is private. Caller responsible for cubicM validity. */\n private constructor(length1: number, radius1: number, axisLength: number, cubicM: number) {\n super(axisLength, cubicM);\n this.nominalLength1 = length1;\n this.nominalRadius1 = radius1;\n }\n /** Compute the czech cubic constant. */\n public static computeCubicM(length1: number, radius1: number): number {\n return 1.0 / (6.0 * length1 * radius1);\n }\n public static create(length1: number, radius1: number): PolishCubicEvaluator | undefined {\n const m = this.computeCubicM(length1, radius1);\n if (m === undefined)\n return undefined;\n const xMax = PolishCubicEvaluator.approximateDistanceAlongToX(length1, radius1, length1);\n if (xMax === undefined)\n return undefined;\n return new PolishCubicEvaluator(length1, radius1, xMax, m);\n }\n public override scaleInPlace(scaleFactor: number) {\n this.nominalLength1 *= scaleFactor;\n this.nominalRadius1 *= scaleFactor;\n super.scaleInPlace(scaleFactor);\n }\n /** Return a deep copy of the evaluator. */\n public clone(): PolishCubicEvaluator {\n return new PolishCubicEvaluator(this.nominalLength1, this.nominalRadius1, this.axisLength, this.cubicM);\n }\n /** Member by member matchup. */\n public isAlmostEqual(other: any): boolean {\n if (other instanceof PolishCubicEvaluator) {\n return Geometry.isSameCoordinate(this.nominalLength1, other.nominalLength1)\n && Geometry.isSameCoordinate(this.nominalRadius1, other.nominalRadius1);\n }\n return false;\n }\n /** Compute the coefficient of x^4 in the x-to-distance series expansion. */\n public static computeX4SeriesCoefficient(length1: number, radius1: number): number {\n return 1.0 / (4.0 * length1 * length1 * radius1 * radius1);\n }\n /**\n * Evaluate a series approximation of distance along the true curve.\n * @param x distance along x axis.\n * @param radius1 nominal end radius.\n * @param length1 nominal length along curve.\n * @returns\n */\n public static xToApproximateDistance(x: number, radius1: number, length1: number): number {\n // C31 * ( 1 + 1 / 10 * E31 - 1 / 72 * E31^2 + 1 / 208 * E31^3 - 5 / 2176 * E31^4 )\n const a4 = this.computeX4SeriesCoefficient(length1, radius1);\n const ax2 = a4 * x * x;\n const ax3 = ax2 * x;\n const ax4 = ax3 * x;\n const s0 = x * (1.0 + ax4 * (0.1 + ax4 * (-1.0 / 72.0 + ax4 * (1.0 / 208.0 - 5.0 * ax4 / 2176.0))));\n return s0;\n }\n /**\n * Evaluate the derivative of the x-to-distance series.\n * @param x distance along x axis.\n * @param radius1 nominal end radius.\n * @param length1 nominal length along curve.\n * @returns\n */\n public static xToApproximateDistanceDerivative(x: number, radius1: number, length1: number): number {\n // C31 * ( 1 + 1 / 10 * E31 - 1 / 72 * E31^2 + 1 / 208 * E31^3 - 5 / 2176 * E31^4 )\n const a4 = this.computeX4SeriesCoefficient(length1, radius1);\n const ax2 = a4 * x * x;\n const ax3 = ax2 * x;\n const ax4 = ax3 * x;\n // derivative notes:\n // take away leading x -- this reduces each power by 1\n // multiply each coefficient by its original power:\n // 0.1 ==> 0.5\n // 1/72 ==> 9/72 = 1/8\n // 1/208 ==> 13/208 = 1/16\n // 1/2176 ==> 17/2176 = 1/128\n const ds = (1.0 + ax4 * (0.5 + ax4 * (-1.0 / 8.0 + ax4 * (1.0 / 16.0 - 5.0 * ax4 / 128.0))));\n return ds;\n }\n /** Invert the xToApproximateDistance function. */\n public static approximateDistanceAlongToX(s: number, radius1: number, length1: number): number | undefined {\n const root = SimpleNewton.runNewton1D(s,\n (x: number) => (this.xToApproximateDistance(x, radius1, length1) - s),\n (x: number) => this.xToApproximateDistanceDerivative(x, radius1, length1));\n return root;\n }\n}\n"]}