@itwin/core-geometry 5.5.0-dev.2 → 5.5.0-dev.4
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.
- package/CHANGELOG.md +6 -1
- package/lib/cjs/Constant.js.map +1 -1
- package/lib/cjs/Geometry.js.map +1 -1
- package/lib/cjs/bspline/AkimaCurve3d.js.map +1 -1
- package/lib/cjs/bspline/BSpline1dNd.js.map +1 -1
- package/lib/cjs/bspline/BSplineCurve.js.map +1 -1
- package/lib/cjs/bspline/BSplineCurve3dH.js.map +1 -1
- package/lib/cjs/bspline/BSplineCurveOps.js.map +1 -1
- package/lib/cjs/bspline/BSplineSurface.js.map +1 -1
- package/lib/cjs/bspline/Bezier1dNd.js.map +1 -1
- package/lib/cjs/bspline/BezierCurve3d.js.map +1 -1
- package/lib/cjs/bspline/BezierCurve3dH.js.map +1 -1
- package/lib/cjs/bspline/BezierCurveBase.js.map +1 -1
- package/lib/cjs/bspline/InterpolationCurve3d.js.map +1 -1
- package/lib/cjs/bspline/KnotVector.js.map +1 -1
- package/lib/cjs/bspline/SurfaceLocationDetail.js.map +1 -1
- package/lib/cjs/clipping/AlternatingConvexClipTree.js.map +1 -1
- package/lib/cjs/clipping/BooleanClipFactory.js.map +1 -1
- package/lib/cjs/clipping/BooleanClipNode.js.map +1 -1
- package/lib/cjs/clipping/ClipPlane.js.map +1 -1
- package/lib/cjs/clipping/ClipPrimitive.js.map +1 -1
- package/lib/cjs/clipping/ClipUtils.js.map +1 -1
- package/lib/cjs/clipping/ClipVector.js.map +1 -1
- package/lib/cjs/clipping/ConvexClipPlaneSet.js.map +1 -1
- package/lib/cjs/clipping/UnionOfConvexClipPlaneSets.js.map +1 -1
- package/lib/cjs/clipping/internalContexts/LineStringOffsetClipperContext.js.map +1 -1
- package/lib/cjs/core-geometry.js.map +1 -1
- package/lib/cjs/curve/Arc3d.js.map +1 -1
- package/lib/cjs/curve/ConstructCurveBetweenCurves.js.map +1 -1
- package/lib/cjs/curve/CoordinateXYZ.js.map +1 -1
- package/lib/cjs/curve/CurveChainWithDistanceIndex.js.map +1 -1
- package/lib/cjs/curve/CurveCollection.js.map +1 -1
- package/lib/cjs/curve/CurveCurve.js.map +1 -1
- package/lib/cjs/curve/CurveExtendMode.js.map +1 -1
- package/lib/cjs/curve/CurveFactory.js.map +1 -1
- package/lib/cjs/curve/CurveLocationDetail.js.map +1 -1
- package/lib/cjs/curve/CurveOps.js.map +1 -1
- package/lib/cjs/curve/CurvePrimitive.js.map +1 -1
- package/lib/cjs/curve/CurveProcessor.js.map +1 -1
- package/lib/cjs/curve/CurveTypes.js.map +1 -1
- package/lib/cjs/curve/CurveWireMomentsXYZ.js.map +1 -1
- package/lib/cjs/curve/GeometryQuery.js.map +1 -1
- package/lib/cjs/curve/LineSegment3d.js.map +1 -1
- package/lib/cjs/curve/LineString3d.js.map +1 -1
- package/lib/cjs/curve/Loop.js.map +1 -1
- package/lib/cjs/curve/OffsetOptions.js.map +1 -1
- package/lib/cjs/curve/ParityRegion.js.map +1 -1
- package/lib/cjs/curve/Path.js.map +1 -1
- package/lib/cjs/curve/PointString3d.js.map +1 -1
- package/lib/cjs/curve/ProxyCurve.js.map +1 -1
- package/lib/cjs/curve/Query/ConsolidateAdjacentPrimitivesContext.js.map +1 -1
- package/lib/cjs/curve/Query/CurveSplitContext.js.map +1 -1
- package/lib/cjs/curve/Query/CylindricalRange.js.map +1 -1
- package/lib/cjs/curve/Query/InOutTests.js.map +1 -1
- package/lib/cjs/curve/Query/PlanarSubdivision.js.map +1 -1
- package/lib/cjs/curve/Query/StrokeCountChain.js.map +1 -1
- package/lib/cjs/curve/Query/StrokeCountMap.js.map +1 -1
- package/lib/cjs/curve/RegionMomentsXY.js.map +1 -1
- package/lib/cjs/curve/RegionOps.js.map +1 -1
- package/lib/cjs/curve/RegionOpsClassificationSweeps.js.map +1 -1
- package/lib/cjs/curve/StrokeOptions.js.map +1 -1
- package/lib/cjs/curve/UnionRegion.js.map +1 -1
- package/lib/cjs/curve/internalContexts/AnnounceTangentStrokeHandler.js.map +1 -1
- package/lib/cjs/curve/internalContexts/AppendPlaneIntersectionStrokeHandler.js.map +1 -1
- package/lib/cjs/curve/internalContexts/ChainCollectorContext.js.map +1 -1
- package/lib/cjs/curve/internalContexts/CloneCurvesContext.js.map +1 -1
- package/lib/cjs/curve/internalContexts/CloneWithExpandedLineStrings.js.map +1 -1
- package/lib/cjs/curve/internalContexts/ClosestPointStrokeHandler.js.map +1 -1
- package/lib/cjs/curve/internalContexts/CountLinearPartsSearchContext.js.map +1 -1
- package/lib/cjs/curve/internalContexts/CurveCurveCloseApproachXY.js.map +1 -1
- package/lib/cjs/curve/internalContexts/CurveCurveIntersectXY.js.map +1 -1
- package/lib/cjs/curve/internalContexts/CurveCurveIntersectXYZ.js.map +1 -1
- package/lib/cjs/curve/internalContexts/CurveLengthContext.js.map +1 -1
- package/lib/cjs/curve/internalContexts/CurveOffsetXYHandler.js.map +1 -1
- package/lib/cjs/curve/internalContexts/EllipticalArcApproximationContext.js.map +1 -1
- package/lib/cjs/curve/internalContexts/GapSearchContext.js.map +1 -1
- package/lib/cjs/curve/internalContexts/MultiChainCollector.js.map +1 -1
- package/lib/cjs/curve/internalContexts/NewtonRtoRStrokeHandler.js.map +1 -1
- package/lib/cjs/curve/internalContexts/PlaneAltitudeRangeContext.js.map +1 -1
- package/lib/cjs/curve/internalContexts/PolygonOffsetContext.js.map +1 -1
- package/lib/cjs/curve/internalContexts/SumLengthsContext.js.map +1 -1
- package/lib/cjs/curve/internalContexts/TransferWithSplitArcs.js.map +1 -1
- package/lib/cjs/curve/internalContexts/TransformInPlaceContext.js.map +1 -1
- package/lib/cjs/curve/spiral/AustralianRailCorpXYEvaluator.js.map +1 -1
- package/lib/cjs/curve/spiral/ClothoidSeries.js.map +1 -1
- package/lib/cjs/curve/spiral/CubicEvaluator.js.map +1 -1
- package/lib/cjs/curve/spiral/CzechSpiralEvaluator.js.map +1 -1
- package/lib/cjs/curve/spiral/DirectHalfCosineSpiralEvaluator.js.map +1 -1
- package/lib/cjs/curve/spiral/DirectSpiral3d.js.map +1 -1
- package/lib/cjs/curve/spiral/IntegratedSpiral3d.js.map +1 -1
- package/lib/cjs/curve/spiral/MXCubicAlongArcSpiralEvaluator.js.map +1 -1
- package/lib/cjs/curve/spiral/NormalizedTransition.js.map +1 -1
- package/lib/cjs/curve/spiral/PolishCubicSpiralEvaluator.js.map +1 -1
- package/lib/cjs/curve/spiral/TransitionConditionalProperties.js.map +1 -1
- package/lib/cjs/curve/spiral/TransitionSpiral3d.js.map +1 -1
- package/lib/cjs/curve/spiral/XYCurveEvaluator.js.map +1 -1
- package/lib/cjs/geometry3d/Angle.js.map +1 -1
- package/lib/cjs/geometry3d/AngleSweep.js.map +1 -1
- package/lib/cjs/geometry3d/BarycentricTriangle.js.map +1 -1
- package/lib/cjs/geometry3d/BilinearPatch.js.map +1 -1
- package/lib/cjs/geometry3d/CoincidentGeometryOps.js.map +1 -1
- package/lib/cjs/geometry3d/Ellipsoid.js.map +1 -1
- package/lib/cjs/geometry3d/FrameBuilder.js.map +1 -1
- package/lib/cjs/geometry3d/FrustumAnimation.js.map +1 -1
- package/lib/cjs/geometry3d/GeometryHandler.js.map +1 -1
- package/lib/cjs/geometry3d/GrowableBlockedArray.js.map +1 -1
- package/lib/cjs/geometry3d/GrowableFloat64Array.js.map +1 -1
- package/lib/cjs/geometry3d/GrowableXYArray.js.map +1 -1
- package/lib/cjs/geometry3d/GrowableXYZArray.js.map +1 -1
- package/lib/cjs/geometry3d/IndexedCollectionInterval.js.map +1 -1
- package/lib/cjs/geometry3d/IndexedXYCollection.js.map +1 -1
- package/lib/cjs/geometry3d/IndexedXYZCollection.js.map +1 -1
- package/lib/cjs/geometry3d/LongitudeLatitudeAltitude.js.map +1 -1
- package/lib/cjs/geometry3d/Matrix3d.js.map +1 -1
- package/lib/cjs/geometry3d/OrderedRotationAngles.js.map +1 -1
- package/lib/cjs/geometry3d/Plane3d.js.map +1 -1
- package/lib/cjs/geometry3d/Plane3dByOriginAndUnitNormal.js.map +1 -1
- package/lib/cjs/geometry3d/Plane3dByOriginAndVectors.js.map +1 -1
- package/lib/cjs/geometry3d/Point2dArrayCarrier.js.map +1 -1
- package/lib/cjs/geometry3d/Point2dVector2d.js.map +1 -1
- package/lib/cjs/geometry3d/Point3dArrayCarrier.js.map +1 -1
- package/lib/cjs/geometry3d/Point3dVector3d.js.map +1 -1
- package/lib/cjs/geometry3d/PointHelpers.js.map +1 -1
- package/lib/cjs/geometry3d/PointStreaming.js.map +1 -1
- package/lib/cjs/geometry3d/PolygonOps.js.map +1 -1
- package/lib/cjs/geometry3d/PolylineCompressionByEdgeOffset.js.map +1 -1
- package/lib/cjs/geometry3d/PolylineOps.js.map +1 -1
- package/lib/cjs/geometry3d/Range.js.map +1 -1
- package/lib/cjs/geometry3d/Ray2d.js.map +1 -1
- package/lib/cjs/geometry3d/Ray3d.js.map +1 -1
- package/lib/cjs/geometry3d/ReusableObjectCache.js.map +1 -1
- package/lib/cjs/geometry3d/Segment1d.js.map +1 -1
- package/lib/cjs/geometry3d/SortablePolygon.js.map +1 -1
- package/lib/cjs/geometry3d/Transform.js.map +1 -1
- package/lib/cjs/geometry3d/UVSurfaceOps.js.map +1 -1
- package/lib/cjs/geometry3d/XYZProps.js.map +1 -1
- package/lib/cjs/geometry3d/YawPitchRollAngles.js.map +1 -1
- package/lib/cjs/geometry4d/Map4d.js.map +1 -1
- package/lib/cjs/geometry4d/Matrix4d.js.map +1 -1
- package/lib/cjs/geometry4d/MomentData.js.map +1 -1
- package/lib/cjs/geometry4d/PlaneByOriginAndVectors4d.js.map +1 -1
- package/lib/cjs/geometry4d/Point4d.js.map +1 -1
- package/lib/cjs/numerics/BandedSystem.js.map +1 -1
- package/lib/cjs/numerics/BezierPolynomials.js.map +1 -1
- package/lib/cjs/numerics/ClusterableArray.js.map +1 -1
- package/lib/cjs/numerics/Complex.js.map +1 -1
- package/lib/cjs/numerics/ConvexPolygon2d.js.map +1 -1
- package/lib/cjs/numerics/Newton.js.map +1 -1
- package/lib/cjs/numerics/PascalCoefficients.js.map +1 -1
- package/lib/cjs/numerics/PolarData.js.map +1 -1
- package/lib/cjs/numerics/Polynomials.js.map +1 -1
- package/lib/cjs/numerics/Quadrature.js.map +1 -1
- package/lib/cjs/numerics/Range1dArray.js.map +1 -1
- package/lib/cjs/numerics/SmallSystem.js.map +1 -1
- package/lib/cjs/numerics/TriDiagonalSystem.js.map +1 -1
- package/lib/cjs/numerics/UnionFind.js.map +1 -1
- package/lib/cjs/numerics/UsageSums.js.map +1 -1
- package/lib/cjs/polyface/AuxData.js.map +1 -1
- package/lib/cjs/polyface/BoxTopology.js.map +1 -1
- package/lib/cjs/polyface/FacetFaceData.js.map +1 -1
- package/lib/cjs/polyface/FacetLocationDetail.js.map +1 -1
- package/lib/cjs/polyface/FacetOrientation.js.map +1 -1
- package/lib/cjs/polyface/GreedyTriangulationBetweenLineStrings.js.map +1 -1
- package/lib/cjs/polyface/IndexedEdgeMatcher.js.map +1 -1
- package/lib/cjs/polyface/IndexedPolyfaceVisitor.js.map +1 -1
- package/lib/cjs/polyface/IndexedPolyfaceWalker.js.map +1 -1
- package/lib/cjs/polyface/Polyface.js.map +1 -1
- package/lib/cjs/polyface/PolyfaceBuilder.js.map +1 -1
- package/lib/cjs/polyface/PolyfaceClip.js.map +1 -1
- package/lib/cjs/polyface/PolyfaceData.js.map +1 -1
- package/lib/cjs/polyface/PolyfaceQuery.js.map +1 -1
- package/lib/cjs/polyface/RangeLengthData.js.map +1 -1
- package/lib/cjs/polyface/RangeTree/LineString3dRangeTreeContext.js.map +1 -1
- package/lib/cjs/polyface/RangeTree/MinimumValueTester.js.map +1 -1
- package/lib/cjs/polyface/RangeTree/Point3dArrayRangeTreeContext.js.map +1 -1
- package/lib/cjs/polyface/RangeTree/PolyfaceRangeTreeContext.js.map +1 -1
- package/lib/cjs/polyface/RangeTree/RangeTreeNode.js.map +1 -1
- package/lib/cjs/polyface/RangeTree/RangeTreeSearchHandlers.js.map +1 -1
- package/lib/cjs/polyface/TaggedNumericData.js.map +1 -1
- package/lib/cjs/polyface/TriangleCandidate.js.map +1 -1
- package/lib/cjs/polyface/multiclip/BuildAverageNormalsContext.js.map +1 -1
- package/lib/cjs/polyface/multiclip/GriddedRaggedRange2dSet.js.map +1 -1
- package/lib/cjs/polyface/multiclip/GriddedRaggedRange2dSetWithOverflow.js.map +1 -1
- package/lib/cjs/polyface/multiclip/LinearSearchRange2dArray.js.map +1 -1
- package/lib/cjs/polyface/multiclip/OffsetMeshContext.js.map +1 -1
- package/lib/cjs/polyface/multiclip/Range2dSearchInterface.js.map +1 -1
- package/lib/cjs/polyface/multiclip/RangeSearch.js.map +1 -1
- package/lib/cjs/polyface/multiclip/SweepLineStringToFacetContext.js.map +1 -1
- package/lib/cjs/polyface/multiclip/XYPointBuckets.js.map +1 -1
- package/lib/cjs/serialization/BGFBAccessors.js.map +1 -1
- package/lib/cjs/serialization/BGFBReader.js.map +1 -1
- package/lib/cjs/serialization/BGFBWriter.js.map +1 -1
- package/lib/cjs/serialization/BentleyGeometryFlatBuffer.js.map +1 -1
- package/lib/cjs/serialization/DeepCompare.js.map +1 -1
- package/lib/cjs/serialization/GeometrySamples.js.map +1 -1
- package/lib/cjs/serialization/IModelJsonSchema.js.map +1 -1
- package/lib/cjs/serialization/SerializationHelpers.js.map +1 -1
- package/lib/cjs/solid/Box.js.map +1 -1
- package/lib/cjs/solid/Cone.js.map +1 -1
- package/lib/cjs/solid/LinearSweep.js.map +1 -1
- package/lib/cjs/solid/RotationalSweep.js.map +1 -1
- package/lib/cjs/solid/RuledSweep.js.map +1 -1
- package/lib/cjs/solid/SolidPrimitive.js.map +1 -1
- package/lib/cjs/solid/Sphere.js.map +1 -1
- package/lib/cjs/solid/SweepContour.js.map +1 -1
- package/lib/cjs/solid/TorusPipe.js.map +1 -1
- package/lib/cjs/topology/ChainMerge.js.map +1 -1
- package/lib/cjs/topology/Graph.js.map +1 -1
- package/lib/cjs/topology/HalfEdgeGraphFromIndexedLoopsContext.js.map +1 -1
- package/lib/cjs/topology/HalfEdgeGraphSearch.js.map +1 -1
- package/lib/cjs/topology/HalfEdgeGraphSpineContext.js.map +1 -1
- package/lib/cjs/topology/HalfEdgeGraphValidation.js.map +1 -1
- package/lib/cjs/topology/HalfEdgeMarkSet.js.map +1 -1
- package/lib/cjs/topology/HalfEdgeNodeXYZUV.js.map +1 -1
- package/lib/cjs/topology/HalfEdgePointInGraphSearch.js.map +1 -1
- package/lib/cjs/topology/HalfEdgePositionDetail.js.map +1 -1
- package/lib/cjs/topology/HalfEdgePriorityQueue.js.map +1 -1
- package/lib/cjs/topology/InsertAndRetriangulateContext.js.map +1 -1
- package/lib/cjs/topology/MaskManager.js.map +1 -1
- package/lib/cjs/topology/Merging.js.map +1 -1
- package/lib/cjs/topology/RegularizeFace.js.map +1 -1
- package/lib/cjs/topology/SignedDataSummary.js.map +1 -1
- package/lib/cjs/topology/SpaceTriangulation.js.map +1 -1
- package/lib/cjs/topology/Triangulation.js.map +1 -1
- package/lib/cjs/topology/Voronoi.js.map +1 -1
- package/lib/cjs/topology/XYParitySearchContext.js.map +1 -1
- package/lib/esm/Constant.js.map +1 -1
- package/lib/esm/Geometry.js.map +1 -1
- package/lib/esm/bspline/AkimaCurve3d.js.map +1 -1
- package/lib/esm/bspline/BSpline1dNd.js.map +1 -1
- package/lib/esm/bspline/BSplineCurve.js.map +1 -1
- package/lib/esm/bspline/BSplineCurve3dH.js.map +1 -1
- package/lib/esm/bspline/BSplineCurveOps.js.map +1 -1
- package/lib/esm/bspline/BSplineSurface.js.map +1 -1
- package/lib/esm/bspline/Bezier1dNd.js.map +1 -1
- package/lib/esm/bspline/BezierCurve3d.js.map +1 -1
- package/lib/esm/bspline/BezierCurve3dH.js.map +1 -1
- package/lib/esm/bspline/BezierCurveBase.js.map +1 -1
- package/lib/esm/bspline/InterpolationCurve3d.js.map +1 -1
- package/lib/esm/bspline/KnotVector.js.map +1 -1
- package/lib/esm/bspline/SurfaceLocationDetail.js.map +1 -1
- package/lib/esm/clipping/AlternatingConvexClipTree.js.map +1 -1
- package/lib/esm/clipping/BooleanClipFactory.js.map +1 -1
- package/lib/esm/clipping/BooleanClipNode.js.map +1 -1
- package/lib/esm/clipping/ClipPlane.js.map +1 -1
- package/lib/esm/clipping/ClipPrimitive.js.map +1 -1
- package/lib/esm/clipping/ClipUtils.js.map +1 -1
- package/lib/esm/clipping/ClipVector.js.map +1 -1
- package/lib/esm/clipping/ConvexClipPlaneSet.js.map +1 -1
- package/lib/esm/clipping/UnionOfConvexClipPlaneSets.js.map +1 -1
- package/lib/esm/clipping/internalContexts/LineStringOffsetClipperContext.js.map +1 -1
- package/lib/esm/core-geometry.js.map +1 -1
- package/lib/esm/curve/Arc3d.js.map +1 -1
- package/lib/esm/curve/ConstructCurveBetweenCurves.js.map +1 -1
- package/lib/esm/curve/CoordinateXYZ.js.map +1 -1
- package/lib/esm/curve/CurveChainWithDistanceIndex.js.map +1 -1
- package/lib/esm/curve/CurveCollection.js.map +1 -1
- package/lib/esm/curve/CurveCurve.js.map +1 -1
- package/lib/esm/curve/CurveExtendMode.js.map +1 -1
- package/lib/esm/curve/CurveFactory.js.map +1 -1
- package/lib/esm/curve/CurveLocationDetail.js.map +1 -1
- package/lib/esm/curve/CurveOps.js.map +1 -1
- package/lib/esm/curve/CurvePrimitive.js.map +1 -1
- package/lib/esm/curve/CurveProcessor.js.map +1 -1
- package/lib/esm/curve/CurveTypes.js.map +1 -1
- package/lib/esm/curve/CurveWireMomentsXYZ.js.map +1 -1
- package/lib/esm/curve/GeometryQuery.js.map +1 -1
- package/lib/esm/curve/LineSegment3d.js.map +1 -1
- package/lib/esm/curve/LineString3d.js.map +1 -1
- package/lib/esm/curve/Loop.js.map +1 -1
- package/lib/esm/curve/OffsetOptions.js.map +1 -1
- package/lib/esm/curve/ParityRegion.js.map +1 -1
- package/lib/esm/curve/Path.js.map +1 -1
- package/lib/esm/curve/PointString3d.js.map +1 -1
- package/lib/esm/curve/ProxyCurve.js.map +1 -1
- package/lib/esm/curve/Query/ConsolidateAdjacentPrimitivesContext.js.map +1 -1
- package/lib/esm/curve/Query/CurveSplitContext.js.map +1 -1
- package/lib/esm/curve/Query/CylindricalRange.js.map +1 -1
- package/lib/esm/curve/Query/InOutTests.js.map +1 -1
- package/lib/esm/curve/Query/PlanarSubdivision.js.map +1 -1
- package/lib/esm/curve/Query/StrokeCountChain.js.map +1 -1
- package/lib/esm/curve/Query/StrokeCountMap.js.map +1 -1
- package/lib/esm/curve/RegionMomentsXY.js.map +1 -1
- package/lib/esm/curve/RegionOps.js.map +1 -1
- package/lib/esm/curve/RegionOpsClassificationSweeps.js.map +1 -1
- package/lib/esm/curve/StrokeOptions.js.map +1 -1
- package/lib/esm/curve/UnionRegion.js.map +1 -1
- package/lib/esm/curve/internalContexts/AnnounceTangentStrokeHandler.js.map +1 -1
- package/lib/esm/curve/internalContexts/AppendPlaneIntersectionStrokeHandler.js.map +1 -1
- package/lib/esm/curve/internalContexts/ChainCollectorContext.js.map +1 -1
- package/lib/esm/curve/internalContexts/CloneCurvesContext.js.map +1 -1
- package/lib/esm/curve/internalContexts/CloneWithExpandedLineStrings.js.map +1 -1
- package/lib/esm/curve/internalContexts/ClosestPointStrokeHandler.js.map +1 -1
- package/lib/esm/curve/internalContexts/CountLinearPartsSearchContext.js.map +1 -1
- package/lib/esm/curve/internalContexts/CurveCurveCloseApproachXY.js.map +1 -1
- package/lib/esm/curve/internalContexts/CurveCurveIntersectXY.js.map +1 -1
- package/lib/esm/curve/internalContexts/CurveCurveIntersectXYZ.js.map +1 -1
- package/lib/esm/curve/internalContexts/CurveLengthContext.js.map +1 -1
- package/lib/esm/curve/internalContexts/CurveOffsetXYHandler.js.map +1 -1
- package/lib/esm/curve/internalContexts/EllipticalArcApproximationContext.js.map +1 -1
- package/lib/esm/curve/internalContexts/GapSearchContext.js.map +1 -1
- package/lib/esm/curve/internalContexts/MultiChainCollector.js.map +1 -1
- package/lib/esm/curve/internalContexts/NewtonRtoRStrokeHandler.js.map +1 -1
- package/lib/esm/curve/internalContexts/PlaneAltitudeRangeContext.js.map +1 -1
- package/lib/esm/curve/internalContexts/PolygonOffsetContext.js.map +1 -1
- package/lib/esm/curve/internalContexts/SumLengthsContext.js.map +1 -1
- package/lib/esm/curve/internalContexts/TransferWithSplitArcs.js.map +1 -1
- package/lib/esm/curve/internalContexts/TransformInPlaceContext.js.map +1 -1
- package/lib/esm/curve/spiral/AustralianRailCorpXYEvaluator.js.map +1 -1
- package/lib/esm/curve/spiral/ClothoidSeries.js.map +1 -1
- package/lib/esm/curve/spiral/CubicEvaluator.js.map +1 -1
- package/lib/esm/curve/spiral/CzechSpiralEvaluator.js.map +1 -1
- package/lib/esm/curve/spiral/DirectHalfCosineSpiralEvaluator.js.map +1 -1
- package/lib/esm/curve/spiral/DirectSpiral3d.js.map +1 -1
- package/lib/esm/curve/spiral/IntegratedSpiral3d.js.map +1 -1
- package/lib/esm/curve/spiral/MXCubicAlongArcSpiralEvaluator.js.map +1 -1
- package/lib/esm/curve/spiral/NormalizedTransition.js.map +1 -1
- package/lib/esm/curve/spiral/PolishCubicSpiralEvaluator.js.map +1 -1
- package/lib/esm/curve/spiral/TransitionConditionalProperties.js.map +1 -1
- package/lib/esm/curve/spiral/TransitionSpiral3d.js.map +1 -1
- package/lib/esm/curve/spiral/XYCurveEvaluator.js.map +1 -1
- package/lib/esm/geometry3d/Angle.js.map +1 -1
- package/lib/esm/geometry3d/AngleSweep.js.map +1 -1
- package/lib/esm/geometry3d/BarycentricTriangle.js.map +1 -1
- package/lib/esm/geometry3d/BilinearPatch.js.map +1 -1
- package/lib/esm/geometry3d/CoincidentGeometryOps.js.map +1 -1
- package/lib/esm/geometry3d/Ellipsoid.js.map +1 -1
- package/lib/esm/geometry3d/FrameBuilder.js.map +1 -1
- package/lib/esm/geometry3d/FrustumAnimation.js.map +1 -1
- package/lib/esm/geometry3d/GeometryHandler.js.map +1 -1
- package/lib/esm/geometry3d/GrowableBlockedArray.js.map +1 -1
- package/lib/esm/geometry3d/GrowableFloat64Array.js.map +1 -1
- package/lib/esm/geometry3d/GrowableXYArray.js.map +1 -1
- package/lib/esm/geometry3d/GrowableXYZArray.js.map +1 -1
- package/lib/esm/geometry3d/IndexedCollectionInterval.js.map +1 -1
- package/lib/esm/geometry3d/IndexedXYCollection.js.map +1 -1
- package/lib/esm/geometry3d/IndexedXYZCollection.js.map +1 -1
- package/lib/esm/geometry3d/LongitudeLatitudeAltitude.js.map +1 -1
- package/lib/esm/geometry3d/Matrix3d.js.map +1 -1
- package/lib/esm/geometry3d/OrderedRotationAngles.js.map +1 -1
- package/lib/esm/geometry3d/Plane3d.js.map +1 -1
- package/lib/esm/geometry3d/Plane3dByOriginAndUnitNormal.js.map +1 -1
- package/lib/esm/geometry3d/Plane3dByOriginAndVectors.js.map +1 -1
- package/lib/esm/geometry3d/Point2dArrayCarrier.js.map +1 -1
- package/lib/esm/geometry3d/Point2dVector2d.js.map +1 -1
- package/lib/esm/geometry3d/Point3dArrayCarrier.js.map +1 -1
- package/lib/esm/geometry3d/Point3dVector3d.js.map +1 -1
- package/lib/esm/geometry3d/PointHelpers.js.map +1 -1
- package/lib/esm/geometry3d/PointStreaming.js.map +1 -1
- package/lib/esm/geometry3d/PolygonOps.js.map +1 -1
- package/lib/esm/geometry3d/PolylineCompressionByEdgeOffset.js.map +1 -1
- package/lib/esm/geometry3d/PolylineOps.js.map +1 -1
- package/lib/esm/geometry3d/Range.js.map +1 -1
- package/lib/esm/geometry3d/Ray2d.js.map +1 -1
- package/lib/esm/geometry3d/Ray3d.js.map +1 -1
- package/lib/esm/geometry3d/ReusableObjectCache.js.map +1 -1
- package/lib/esm/geometry3d/Segment1d.js.map +1 -1
- package/lib/esm/geometry3d/SortablePolygon.js.map +1 -1
- package/lib/esm/geometry3d/Transform.js.map +1 -1
- package/lib/esm/geometry3d/UVSurfaceOps.js.map +1 -1
- package/lib/esm/geometry3d/XYZProps.js.map +1 -1
- package/lib/esm/geometry3d/YawPitchRollAngles.js.map +1 -1
- package/lib/esm/geometry4d/Map4d.js.map +1 -1
- package/lib/esm/geometry4d/Matrix4d.js.map +1 -1
- package/lib/esm/geometry4d/MomentData.js.map +1 -1
- package/lib/esm/geometry4d/PlaneByOriginAndVectors4d.js.map +1 -1
- package/lib/esm/geometry4d/Point4d.js.map +1 -1
- package/lib/esm/numerics/BandedSystem.js.map +1 -1
- package/lib/esm/numerics/BezierPolynomials.js.map +1 -1
- package/lib/esm/numerics/ClusterableArray.js.map +1 -1
- package/lib/esm/numerics/Complex.js.map +1 -1
- package/lib/esm/numerics/ConvexPolygon2d.js.map +1 -1
- package/lib/esm/numerics/Newton.js.map +1 -1
- package/lib/esm/numerics/PascalCoefficients.js.map +1 -1
- package/lib/esm/numerics/PolarData.js.map +1 -1
- package/lib/esm/numerics/Polynomials.js.map +1 -1
- package/lib/esm/numerics/Quadrature.js.map +1 -1
- package/lib/esm/numerics/Range1dArray.js.map +1 -1
- package/lib/esm/numerics/SmallSystem.js.map +1 -1
- package/lib/esm/numerics/TriDiagonalSystem.js.map +1 -1
- package/lib/esm/numerics/UnionFind.js.map +1 -1
- package/lib/esm/numerics/UsageSums.js.map +1 -1
- package/lib/esm/polyface/AuxData.js.map +1 -1
- package/lib/esm/polyface/BoxTopology.js.map +1 -1
- package/lib/esm/polyface/FacetFaceData.js.map +1 -1
- package/lib/esm/polyface/FacetLocationDetail.js.map +1 -1
- package/lib/esm/polyface/FacetOrientation.js.map +1 -1
- package/lib/esm/polyface/GreedyTriangulationBetweenLineStrings.js.map +1 -1
- package/lib/esm/polyface/IndexedEdgeMatcher.js.map +1 -1
- package/lib/esm/polyface/IndexedPolyfaceVisitor.js.map +1 -1
- package/lib/esm/polyface/IndexedPolyfaceWalker.js.map +1 -1
- package/lib/esm/polyface/Polyface.js.map +1 -1
- package/lib/esm/polyface/PolyfaceBuilder.js.map +1 -1
- package/lib/esm/polyface/PolyfaceClip.js.map +1 -1
- package/lib/esm/polyface/PolyfaceData.js.map +1 -1
- package/lib/esm/polyface/PolyfaceQuery.js.map +1 -1
- package/lib/esm/polyface/RangeLengthData.js.map +1 -1
- package/lib/esm/polyface/RangeTree/LineString3dRangeTreeContext.js.map +1 -1
- package/lib/esm/polyface/RangeTree/MinimumValueTester.js.map +1 -1
- package/lib/esm/polyface/RangeTree/Point3dArrayRangeTreeContext.js.map +1 -1
- package/lib/esm/polyface/RangeTree/PolyfaceRangeTreeContext.js.map +1 -1
- package/lib/esm/polyface/RangeTree/RangeTreeNode.js.map +1 -1
- package/lib/esm/polyface/RangeTree/RangeTreeSearchHandlers.js.map +1 -1
- package/lib/esm/polyface/TaggedNumericData.js.map +1 -1
- package/lib/esm/polyface/TriangleCandidate.js.map +1 -1
- package/lib/esm/polyface/multiclip/BuildAverageNormalsContext.js.map +1 -1
- package/lib/esm/polyface/multiclip/GriddedRaggedRange2dSet.js.map +1 -1
- package/lib/esm/polyface/multiclip/GriddedRaggedRange2dSetWithOverflow.js.map +1 -1
- package/lib/esm/polyface/multiclip/LinearSearchRange2dArray.js.map +1 -1
- package/lib/esm/polyface/multiclip/OffsetMeshContext.js.map +1 -1
- package/lib/esm/polyface/multiclip/Range2dSearchInterface.js.map +1 -1
- package/lib/esm/polyface/multiclip/RangeSearch.js.map +1 -1
- package/lib/esm/polyface/multiclip/SweepLineStringToFacetContext.js.map +1 -1
- package/lib/esm/polyface/multiclip/XYPointBuckets.js.map +1 -1
- package/lib/esm/serialization/BGFBAccessors.js.map +1 -1
- package/lib/esm/serialization/BGFBReader.js.map +1 -1
- package/lib/esm/serialization/BGFBWriter.js.map +1 -1
- package/lib/esm/serialization/BentleyGeometryFlatBuffer.js.map +1 -1
- package/lib/esm/serialization/DeepCompare.js.map +1 -1
- package/lib/esm/serialization/GeometrySamples.js.map +1 -1
- package/lib/esm/serialization/IModelJsonSchema.js.map +1 -1
- package/lib/esm/serialization/SerializationHelpers.js.map +1 -1
- package/lib/esm/solid/Box.js.map +1 -1
- package/lib/esm/solid/Cone.js.map +1 -1
- package/lib/esm/solid/LinearSweep.js.map +1 -1
- package/lib/esm/solid/RotationalSweep.js.map +1 -1
- package/lib/esm/solid/RuledSweep.js.map +1 -1
- package/lib/esm/solid/SolidPrimitive.js.map +1 -1
- package/lib/esm/solid/Sphere.js.map +1 -1
- package/lib/esm/solid/SweepContour.js.map +1 -1
- package/lib/esm/solid/TorusPipe.js.map +1 -1
- package/lib/esm/topology/ChainMerge.js.map +1 -1
- package/lib/esm/topology/Graph.js.map +1 -1
- package/lib/esm/topology/HalfEdgeGraphFromIndexedLoopsContext.js.map +1 -1
- package/lib/esm/topology/HalfEdgeGraphSearch.js.map +1 -1
- package/lib/esm/topology/HalfEdgeGraphSpineContext.js.map +1 -1
- package/lib/esm/topology/HalfEdgeGraphValidation.js.map +1 -1
- package/lib/esm/topology/HalfEdgeMarkSet.js.map +1 -1
- package/lib/esm/topology/HalfEdgeNodeXYZUV.js.map +1 -1
- package/lib/esm/topology/HalfEdgePointInGraphSearch.js.map +1 -1
- package/lib/esm/topology/HalfEdgePositionDetail.js.map +1 -1
- package/lib/esm/topology/HalfEdgePriorityQueue.js.map +1 -1
- package/lib/esm/topology/InsertAndRetriangulateContext.js.map +1 -1
- package/lib/esm/topology/MaskManager.js.map +1 -1
- package/lib/esm/topology/Merging.js.map +1 -1
- package/lib/esm/topology/RegularizeFace.js.map +1 -1
- package/lib/esm/topology/SignedDataSummary.js.map +1 -1
- package/lib/esm/topology/SpaceTriangulation.js.map +1 -1
- package/lib/esm/topology/Triangulation.js.map +1 -1
- package/lib/esm/topology/Voronoi.js.map +1 -1
- package/lib/esm/topology/XYParitySearchContext.js.map +1 -1
- package/package.json +3 -3
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CzechSpiralEvaluator.js","sourceRoot":"","sources":["../../../../src/curve/spiral/CzechSpiralEvaluator.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAE/F;;GAEG;AAC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AAK,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,6BAA6B,CAAC,CAAS;QAC5C,OAAO,oBAAoB,CAAC,cAAc,CAAC,CAAC,EAAE,CAAC,GAAG,EAAE,IAAI,CAAC,cAAc,EAAE,IAAI,CAAC,cAAc,CAAC,CAAC;IAChG,CAAC;IACD;;;;OAIG;IACI,6BAA6B,CAAC,CAAS;QAC5C,OAAO,oBAAoB,CAAC,cAAc,CAAC,CAAC,EAAE,CAAC,GAAG,EAAE,IAAI,CAAC,cAAc,EAAE,IAAI,CAAC,cAAc,CAAC,CAAC;IAChG,CAAC;CACF","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n\n/** @packageDocumentation\n * @module Curve\n */\nimport { Geometry } from \"../../Geometry\";\nimport { CubicEvaluator } from \"./CubicEvaluator\";\nimport { SimpleNewton } from \"../../numerics/Newton\";\n\n/**\n * Czech cubic.\n * This is y = m*x^3 with\n * * x any point on the x axis.\n * * `fraction` along the spiral goes to `x = fraction * L`.\n * * m is gamma/(6RL).\n * * 1/(6RL) is the leading term of the sine series.\n * * `gamma = 2R/sqrt(4RR-LL)` pushes y down a little bit to simulate the lost series terms.\n * @internal\n */\nexport class CzechSpiralEvaluator 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, cubicM: number) {\n super(length1, cubicM);\n this.nominalLength1 = length1;\n this.nominalRadius1 = radius1;\n }\n /**\n * Return the scale factor between simple x^3 / (6RL) cubic and the czech correction.\n * * For typical case with l1/R1 smallish, this is just less than 1.0:\n * (0.25==>0.99215), (0.15==>0.997184), (0.10==>0.998749), (0.05==>999687)\n */\n public static gammaConstant(length1: number, radius1: number): number | undefined {\n return 2.0 * radius1 / Math.sqrt(4.0 * radius1 * radius1 - length1 * length1);\n }\n /** Compute the Czech cubic constant. */\n public static computeCubicM(length1: number, radius1: number): number | undefined {\n const gamma = CzechSpiralEvaluator.gammaConstant(length1, radius1);\n // in the private update method, the LR values should have been vetted\n if (gamma === undefined)\n return undefined;\n // if radius is negative, it shows up in gamma; but the a signed denominator undoes it so take abs of denominator\n return gamma / Math.abs((6.0 * radius1 * length1));\n }\n public static create(length1: number, radius1: number): CzechSpiralEvaluator | undefined {\n const m = this.computeCubicM(length1, radius1);\n if (m === undefined)\n return undefined;\n return new CzechSpiralEvaluator(length1, radius1, m);\n }\n public override scaleInPlace(scaleFactor: number) {\n this.nominalLength1 *= scaleFactor;\n this.nominalRadius1 *= scaleFactor;\n super.scaleInPlace(scaleFactor);\n }\n /** Return a deep copy of the evaluator. */\n public clone(): CzechSpiralEvaluator {\n return new CzechSpiralEvaluator(this.nominalLength1, this.nominalRadius1, this.cubicM);\n }\n /** Member by member matchup. */\n public isAlmostEqual(other: any): boolean {\n if (other instanceof CzechSpiralEvaluator) {\n return Geometry.isSameCoordinate(this.nominalLength1, other.nominalLength1)\n && Geometry.isSameCoordinate(this.nominalRadius1, other.nominalRadius1);\n }\n return false;\n }\n /**\n * Return a (fast but mediocre) approximation of spiral length as a function of x axis position.\n * * This x-to-distance relation is not as precise as the CurvePrimitive method moveSignedDistanceFromFraction.\n * * It is supported here for users interested in replicating the Czech distance mapping rather than the more accurate\n * CurvePrimitive measurements.\n * @param x distance along the x axis.\n */\n public xToCzechApproximateDistance(x: number): number {\n return CzechSpiralEvaluator.forwardL2R2Map(x, 1.0, this.nominalLength1, this.nominalRadius1);\n }\n /**\n * Return the inverse of the `forwardL2R2Map` function.\n * * The undefined result can only occur for distances outside the usual spirals.\n * @param d (approximate) distance along the spiral.\n */\n public czechApproximateDistanceToX(d: number): number | undefined {\n return CzechSpiralEvaluator.inverseL2R2Map(d, 1.0, this.nominalLength1, this.nominalRadius1);\n }\n /**\n * Evaluate a series expansion that is used with varying signs (plus or minus 1) in czech and italian spirals.\n * @param x distance along the x axis.\n */\n public static forwardL2R2Map(x: number, sign: number, length: number, radius: number): number {\n const l2 = length * length;\n const r2 = radius * radius;\n const Q = 4.0 * r2 - l2;\n const xx = x * x;\n return x * (1.0 + sign * xx * xx / (10.0 * Q * l2));\n }\n /**\n * Return the inverse of the `forwardL2R2Map` function.\n * * The undefined result can only occur for distances outside the usual spirals.\n * @param d (approximate) distance along the spiral.\n */\n public static inverseL2R2Map(d: number, sign: number, length: number, radius: number): number | undefined {\n const l2 = length * length;\n const r2 = radius * radius;\n const Q = 4.0 * r2 - l2;\n const a = sign / (10.0 * Q * l2);\n return SimpleNewton.runNewton1D(\n d,\n (x: number) => {\n const xx = x * x;\n return x * (1.0 + xx * xx * a) - d;\n },\n (x: number) => {\n const xx = x * x;\n return 1.0 + 5 * xx * xx * a;\n },\n );\n }\n}\n\n/**\n * Italian cubic.\n * This is y = m*x^3 with\n * * x any point on the x axis.\n * * `fraction` along the spiral goes to `x = fraction * L`.\n * * m is gamma/(6RL).\n * * 1/(6RL) is the leading term of the sine series.\n * * `gamma = 2R/sqrt(4RR-LL)` pushes y down a little bit to simulate the lost series terms.\n * @internal\n */\nexport class ItalianSpiralEvaluator extends CubicEvaluator {\n public nominalLength1: number;\n public nominalRadius1: number;\n /** Compute the Italian cubic constant. */\n private static computeCubicM(lengthXByForward: number, radius1: number): number | undefined {\n return CzechSpiralEvaluator.computeCubicM(lengthXByForward, radius1);\n }\n /** Constructor is private. Caller responsible for cubicM validity. */\n private constructor(length1: number, radius1: number, lengthX: number, cubicM: number) {\n super(lengthX, cubicM);\n this.nominalLength1 = length1;\n this.nominalRadius1 = radius1;\n }\n public static create(length1: number, radius1: number): ItalianSpiralEvaluator | undefined {\n // this seems goofy; lengthX from forward, then invert for another but that's what the native code does too\n const lengthX = CzechSpiralEvaluator.forwardL2R2Map(length1, -1.0, length1, radius1);\n const lengthX1 = CzechSpiralEvaluator.inverseL2R2Map(length1, 1.0, lengthX, radius1);\n if (lengthX1 === undefined)\n return undefined;\n const m = ItalianSpiralEvaluator.computeCubicM(lengthX, radius1);\n if (m === undefined)\n return undefined;\n return new ItalianSpiralEvaluator(length1, radius1, lengthX1, m);\n }\n public override scaleInPlace(scaleFactor: number) {\n this.nominalLength1 *= scaleFactor;\n this.nominalRadius1 *= scaleFactor;\n super.scaleInPlace(scaleFactor);\n }\n /** Return a deep copy of the evaluator. */\n public clone(): ItalianSpiralEvaluator {\n return new ItalianSpiralEvaluator(this.nominalLength1, this.nominalRadius1, super.axisLength, this.cubicM);\n }\n /** Member by member matchup. */\n public isAlmostEqual(other: any): boolean {\n if (other instanceof ItalianSpiralEvaluator) {\n return Geometry.isSameCoordinate(this.nominalLength1, other.nominalLength1)\n && Geometry.isSameCoordinate(this.nominalRadius1, other.nominalRadius1);\n }\n return false;\n }\n /**\n * Return a (fast but mediocre) approximation of spiral length as a function of x axis position.\n * * This x-to-distance relation is not as precise as the CurvePrimitive method moveSignedDistanceFromFraction.\n * * It is supported here for users interested in replicating the Czech distance mapping rather than the more accurate\n * CurvePrimitive measurements.\n * @param x distance along the x axis.\n */\n public distanceToItalianApproximateX(x: number): number {\n return CzechSpiralEvaluator.forwardL2R2Map(x, -1.0, this.nominalLength1, this.nominalRadius1);\n }\n /**\n * Return the inverse of the `forwardL2R2Map` function.\n * * The undefined result can only occur for distances outside the usual spirals.\n * @param d (approximate) distance along the spiral.\n */\n public xToItalianApproximateDistance(d: number): number | undefined {\n return CzechSpiralEvaluator.inverseL2R2Map(d, -1.0, this.nominalLength1, this.nominalRadius1);\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"CzechSpiralEvaluator.js","sourceRoot":"","sources":["../../../../src/curve/spiral/CzechSpiralEvaluator.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAE/F;;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,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,6BAA6B,CAAC,CAAS;QAC5C,OAAO,oBAAoB,CAAC,cAAc,CAAC,CAAC,EAAE,CAAC,GAAG,EAAE,IAAI,CAAC,cAAc,EAAE,IAAI,CAAC,cAAc,CAAC,CAAC;IAChG,CAAC;IACD;;;;OAIG;IACI,6BAA6B,CAAC,CAAS;QAC5C,OAAO,oBAAoB,CAAC,cAAc,CAAC,CAAC,EAAE,CAAC,GAAG,EAAE,IAAI,CAAC,cAAc,EAAE,IAAI,CAAC,cAAc,CAAC,CAAC;IAChG,CAAC;CACF","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n\r\n/** @packageDocumentation\r\n * @module Curve\r\n */\r\nimport { Geometry } from \"../../Geometry\";\r\nimport { CubicEvaluator } from \"./CubicEvaluator\";\r\nimport { SimpleNewton } from \"../../numerics/Newton\";\r\n\r\n/**\r\n * Czech cubic.\r\n * This is y = m*x^3 with\r\n * * x any point on the x axis.\r\n * * `fraction` along the spiral goes to `x = fraction * L`.\r\n * * m is gamma/(6RL).\r\n * * 1/(6RL) is the leading term of the sine series.\r\n * * `gamma = 2R/sqrt(4RR-LL)` pushes y down a little bit to simulate the lost series terms.\r\n * @internal\r\n */\r\nexport class CzechSpiralEvaluator 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, cubicM: number) {\r\n super(length1, cubicM);\r\n this.nominalLength1 = length1;\r\n this.nominalRadius1 = radius1;\r\n }\r\n /**\r\n * Return the scale factor between simple x^3 / (6RL) cubic and the czech correction.\r\n * * For typical case with l1/R1 smallish, this is just less than 1.0:\r\n * (0.25==>0.99215), (0.15==>0.997184), (0.10==>0.998749), (0.05==>999687)\r\n */\r\n public static gammaConstant(length1: number, radius1: number): number | undefined {\r\n return 2.0 * radius1 / Math.sqrt(4.0 * radius1 * radius1 - length1 * length1);\r\n }\r\n /** Compute the Czech cubic constant. */\r\n public static computeCubicM(length1: number, radius1: number): number | undefined {\r\n const gamma = CzechSpiralEvaluator.gammaConstant(length1, radius1);\r\n // in the private update method, the LR values should have been vetted\r\n if (gamma === undefined)\r\n return undefined;\r\n // if radius is negative, it shows up in gamma; but the a signed denominator undoes it so take abs of denominator\r\n return gamma / Math.abs((6.0 * radius1 * length1));\r\n }\r\n public static create(length1: number, radius1: number): CzechSpiralEvaluator | undefined {\r\n const m = this.computeCubicM(length1, radius1);\r\n if (m === undefined)\r\n return undefined;\r\n return new CzechSpiralEvaluator(length1, radius1, m);\r\n }\r\n public override scaleInPlace(scaleFactor: number) {\r\n this.nominalLength1 *= scaleFactor;\r\n this.nominalRadius1 *= scaleFactor;\r\n super.scaleInPlace(scaleFactor);\r\n }\r\n /** Return a deep copy of the evaluator. */\r\n public clone(): CzechSpiralEvaluator {\r\n return new CzechSpiralEvaluator(this.nominalLength1, this.nominalRadius1, this.cubicM);\r\n }\r\n /** Member by member matchup. */\r\n public isAlmostEqual(other: any): boolean {\r\n if (other instanceof CzechSpiralEvaluator) {\r\n return Geometry.isSameCoordinate(this.nominalLength1, other.nominalLength1)\r\n && Geometry.isSameCoordinate(this.nominalRadius1, other.nominalRadius1);\r\n }\r\n return false;\r\n }\r\n /**\r\n * Return a (fast but mediocre) approximation of spiral length as a function of x axis position.\r\n * * This x-to-distance relation is not as precise as the CurvePrimitive method moveSignedDistanceFromFraction.\r\n * * It is supported here for users interested in replicating the Czech distance mapping rather than the more accurate\r\n * CurvePrimitive measurements.\r\n * @param x distance along the x axis.\r\n */\r\n public xToCzechApproximateDistance(x: number): number {\r\n return CzechSpiralEvaluator.forwardL2R2Map(x, 1.0, this.nominalLength1, this.nominalRadius1);\r\n }\r\n /**\r\n * Return the inverse of the `forwardL2R2Map` function.\r\n * * The undefined result can only occur for distances outside the usual spirals.\r\n * @param d (approximate) distance along the spiral.\r\n */\r\n public czechApproximateDistanceToX(d: number): number | undefined {\r\n return CzechSpiralEvaluator.inverseL2R2Map(d, 1.0, this.nominalLength1, this.nominalRadius1);\r\n }\r\n /**\r\n * Evaluate a series expansion that is used with varying signs (plus or minus 1) in czech and italian spirals.\r\n * @param x distance along the x axis.\r\n */\r\n public static forwardL2R2Map(x: number, sign: number, length: number, radius: number): number {\r\n const l2 = length * length;\r\n const r2 = radius * radius;\r\n const Q = 4.0 * r2 - l2;\r\n const xx = x * x;\r\n return x * (1.0 + sign * xx * xx / (10.0 * Q * l2));\r\n }\r\n /**\r\n * Return the inverse of the `forwardL2R2Map` function.\r\n * * The undefined result can only occur for distances outside the usual spirals.\r\n * @param d (approximate) distance along the spiral.\r\n */\r\n public static inverseL2R2Map(d: number, sign: number, length: number, radius: number): number | undefined {\r\n const l2 = length * length;\r\n const r2 = radius * radius;\r\n const Q = 4.0 * r2 - l2;\r\n const a = sign / (10.0 * Q * l2);\r\n return SimpleNewton.runNewton1D(\r\n d,\r\n (x: number) => {\r\n const xx = x * x;\r\n return x * (1.0 + xx * xx * a) - d;\r\n },\r\n (x: number) => {\r\n const xx = x * x;\r\n return 1.0 + 5 * xx * xx * a;\r\n },\r\n );\r\n }\r\n}\r\n\r\n/**\r\n * Italian cubic.\r\n * This is y = m*x^3 with\r\n * * x any point on the x axis.\r\n * * `fraction` along the spiral goes to `x = fraction * L`.\r\n * * m is gamma/(6RL).\r\n * * 1/(6RL) is the leading term of the sine series.\r\n * * `gamma = 2R/sqrt(4RR-LL)` pushes y down a little bit to simulate the lost series terms.\r\n * @internal\r\n */\r\nexport class ItalianSpiralEvaluator extends CubicEvaluator {\r\n public nominalLength1: number;\r\n public nominalRadius1: number;\r\n /** Compute the Italian cubic constant. */\r\n private static computeCubicM(lengthXByForward: number, radius1: number): number | undefined {\r\n return CzechSpiralEvaluator.computeCubicM(lengthXByForward, radius1);\r\n }\r\n /** Constructor is private. Caller responsible for cubicM validity. */\r\n private constructor(length1: number, radius1: number, lengthX: number, cubicM: number) {\r\n super(lengthX, cubicM);\r\n this.nominalLength1 = length1;\r\n this.nominalRadius1 = radius1;\r\n }\r\n public static create(length1: number, radius1: number): ItalianSpiralEvaluator | undefined {\r\n // this seems goofy; lengthX from forward, then invert for another but that's what the native code does too\r\n const lengthX = CzechSpiralEvaluator.forwardL2R2Map(length1, -1.0, length1, radius1);\r\n const lengthX1 = CzechSpiralEvaluator.inverseL2R2Map(length1, 1.0, lengthX, radius1);\r\n if (lengthX1 === undefined)\r\n return undefined;\r\n const m = ItalianSpiralEvaluator.computeCubicM(lengthX, radius1);\r\n if (m === undefined)\r\n return undefined;\r\n return new ItalianSpiralEvaluator(length1, radius1, lengthX1, m);\r\n }\r\n public override scaleInPlace(scaleFactor: number) {\r\n this.nominalLength1 *= scaleFactor;\r\n this.nominalRadius1 *= scaleFactor;\r\n super.scaleInPlace(scaleFactor);\r\n }\r\n /** Return a deep copy of the evaluator. */\r\n public clone(): ItalianSpiralEvaluator {\r\n return new ItalianSpiralEvaluator(this.nominalLength1, this.nominalRadius1, super.axisLength, this.cubicM);\r\n }\r\n /** Member by member matchup. */\r\n public isAlmostEqual(other: any): boolean {\r\n if (other instanceof ItalianSpiralEvaluator) {\r\n return Geometry.isSameCoordinate(this.nominalLength1, other.nominalLength1)\r\n && Geometry.isSameCoordinate(this.nominalRadius1, other.nominalRadius1);\r\n }\r\n return false;\r\n }\r\n /**\r\n * Return a (fast but mediocre) approximation of spiral length as a function of x axis position.\r\n * * This x-to-distance relation is not as precise as the CurvePrimitive method moveSignedDistanceFromFraction.\r\n * * It is supported here for users interested in replicating the Czech distance mapping rather than the more accurate\r\n * CurvePrimitive measurements.\r\n * @param x distance along the x axis.\r\n */\r\n public distanceToItalianApproximateX(x: number): number {\r\n return CzechSpiralEvaluator.forwardL2R2Map(x, -1.0, this.nominalLength1, this.nominalRadius1);\r\n }\r\n /**\r\n * Return the inverse of the `forwardL2R2Map` function.\r\n * * The undefined result can only occur for distances outside the usual spirals.\r\n * @param d (approximate) distance along the spiral.\r\n */\r\n public xToItalianApproximateDistance(d: number): number | undefined {\r\n return CzechSpiralEvaluator.inverseL2R2Map(d, -1.0, this.nominalLength1, this.nominalRadius1);\r\n }\r\n}\r\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DirectHalfCosineSpiralEvaluator.js","sourceRoot":"","sources":["../../../../src/curve/spiral/DirectHalfCosineSpiralEvaluator.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAE/F;;GAEG;AACH,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAC1C,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACtD,OAAO,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAErD;;GAEG;AACH,MAAM,OAAO,+BAAgC,SAAQ,gBAAgB;IAC5D,cAAc,CAAS;IACvB,cAAc,CAAS;IACtB,EAAE,CAAS;IACX,GAAG,CAAS;IACZ,GAAG,CAAS;IACpB,YAAmB,OAAe,EAAE,OAAe;QACjD,KAAK,EAAE,CAAC;QACR,IAAI,CAAC,cAAc,GAAG,OAAO,CAAC;QAC9B,IAAI,CAAC,cAAc,GAAG,OAAO,CAAC;QAC9B,MAAM,EAAE,GAAG,IAAI,CAAC,EAAE,CAAC;QACnB,IAAI,CAAC,GAAG,GAAG,GAAG,GAAG,CAAC,GAAG,GAAG,EAAE,GAAG,EAAE,CAAC,CAAC;QACjC,IAAI,CAAC,GAAG,GAAG,IAAI,CAAC;QAChB,IAAI,CAAC,EAAE,GAAG,GAAG,CAAC,CAAC,sBAAsB;QACrC,IAAI,CAAC,eAAe,EAAE,CAAC;I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,CAAC,CAAC,CAAC;IACzF,CAAC;IACD,mDAAmD;IAC5C,WAAW,CAAC,CAAS;QAC1B,MAAM,SAAS,GAAG,CAAC,GAAG,IAAI,CAAC,cAAc,CAAC;QAC1C,MAAM,SAAS,GAAG,YAAY,CAAC,WAAW,CACxC,SAAS,EACT,CAAC,CAAS,EAAE,EAAE,CAAC,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,EACxC,CAAC,CAAS,EAAE,EAAE,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC,CAAC,CACpC,CAAC;QACF,IAAI,SAAS,KAAK,SAAS;YACzB,OAAO,SAAS,CAAC;QACnB,OAAO,SAAS,CAAC;IACnB,CAAC;CACF","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n\n/** @packageDocumentation\n * @module Curve\n */\nimport { Geometry } from \"../../Geometry\";\nimport { XYCurveEvaluator } from \"./XYCurveEvaluator\";\nimport { SimpleNewton } from \"../../numerics/Newton\";\n\n/**\n * @internal\n */\nexport class DirectHalfCosineSpiralEvaluator extends XYCurveEvaluator {\n public nominalLength1: number;\n public nominalRadius1: number;\n private _c: number;\n private _c1: number;\n private _c2: number;\n public constructor(length1: number, radius1: number) {\n super();\n this.nominalLength1 = length1;\n this.nominalRadius1 = radius1;\n const pi = Math.PI;\n this._c1 = 1.0 / (2.0 * pi * pi);\n this._c2 = 0.25;\n this._c = 0.0; // TO BE UPDATED BELOW\n this.updateConstants();\n }\n private updateConstants() {\n this._c = this.nominalLength1 * this.nominalLength1 / this.nominalRadius1;\n }\n public scaleInPlace(scaleFactor: number) {\n this.nominalLength1 *= scaleFactor;\n this.nominalRadius1 *= scaleFactor;\n this.updateConstants();\n }\n /** Return a deep copy of the evaluator. */\n public clone(): DirectHalfCosineSpiralEvaluator {\n return new DirectHalfCosineSpiralEvaluator(this.nominalLength1, this.nominalRadius1);\n }\n /** Member by member matchup. */\n public isAlmostEqual(other: any): boolean {\n if (other instanceof DirectHalfCosineSpiralEvaluator) {\n return Geometry.isSameCoordinate(this.nominalLength1, other.nominalLength1)\n && Geometry.isSameCoordinate(this.nominalRadius1, other.nominalRadius1);\n // remark: c,c1,c2 are computed, need not be tested.\n }\n return false;\n }\n /** Evaluate X at fractional position. */\n public fractionToX(fraction: number): number {\n return fraction * this.nominalLength1;\n }\n /** Evaluate Y at fractional position. */\n public fractionToY(fraction: number): number {\n const theta = fraction * Math.PI;\n return this._c * (this._c2 * fraction * fraction - this._c1 * (1.0 - Math.cos(theta)));\n }\n /** Evaluate derivative of X with respect to fraction at fractional position. */\n public fractionToDX(_fraction: number): number {\n return this.nominalLength1;\n }\n /** Evaluate derivative of Y with respect to fraction at fractional position. */\n public fractionToDY(fraction: number): number {\n const pi = Math.PI;\n const theta = fraction * pi;\n return this._c * (2.0 * this._c2 * fraction - this._c1 * pi * Math.sin(theta));\n }\n /** Evaluate second derivative of X with respect to fraction at fractional position. */\n public fractionToDDX(_fraction: number): number {\n return 0.0;\n }\n /** Evaluate third derivative of Y with respect to fraction at fractional position. */\n public fractionToDDY(fraction: number): number {\n const pi = Math.PI;\n const theta = fraction * pi;\n return this._c * (2.0 * this._c2 - this._c1 * pi * pi * Math.cos(theta));\n }\n /** Evaluate second derivative of X with respect to fraction at fractional position. */\n public fractionToD3X(_fraction: number): number {\n return 0.0;\n }\n /** Evaluate third derivative of Y with respect to fraction at fractional position. */\n public fractionToD3Y(fraction: number): number {\n const pi = Math.PI;\n const theta = fraction * pi;\n return this._c * this._c1 * pi * pi * pi * Math.sin(theta);\n }\n /** Return the magnitude of the first vector at fractional coordinate. */\n public override fractionToTangentMagnitude(fraction: number): number {\n return Geometry.hypotenuseXY(this.fractionToDX(fraction), this.fractionToDY(fraction));\n }\n /** Invert the fractionToX function for given X. */\n public xToFraction(x: number): number | undefined {\n const fraction0 = x / this.nominalLength1;\n const fraction1 = SimpleNewton.runNewton1D(\n fraction0,\n (f: number) => (this.fractionToX(f) - x),\n (f: number) => this.fractionToDX(f),\n );\n if (fraction1 === undefined)\n return undefined;\n return fraction1;\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"DirectHalfCosineSpiralEvaluator.js","sourceRoot":"","sources":["../../../../src/curve/spiral/DirectHalfCosineSpiralEvaluator.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAE/F;;GAEG;AACH,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAC1C,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACtD,OAAO,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAErD;;GAEG;AACH,MAAM,OAAO,+BAAgC,SAAQ,gBAAgB;IAC5D,cAAc,CAAS;IACvB,cAAc,CAAS;IACtB,EAAE,CAAS;IACX,GAAG,CAAS;IACZ,GAAG,CAAS;IACpB,YAAmB,OAAe,EAAE,OAAe;QACjD,KAAK,EAAE,CAAC;QACR,IAAI,CAAC,cAAc,GAAG,OAAO,CAAC;QAC9B,IAAI,CAAC,cAAc,GAAG,OAAO,CAAC;QAC9B,MAAM,EAAE,GAAG,IAAI,CAAC,EAAE,CAAC;QACnB,IAAI,CAAC,GAAG,GAAG,GAAG,GAAG,CAAC,GAAG,GAAG,EAAE,GAAG,EAAE,CAAC,CAAC;QACjC,IAAI,CAAC,GAAG,GAAG,IAAI,CAAC;QAChB,IAAI,CAAC,EAAE,GAAG,GAAG,CAAC,CAAC,sBAAsB;QACrC,IAAI,CAAC,eAAe,EAAE,CAAC;IACzB,CAAC;IACO,eAAe;QACrB,IAAI,CAAC,EAAE,GAAG,IAAI,CAAC,cAAc,GAAG,IAAI,CAAC,cAAc,GAAG,IAAI,CAAC,cAAc,CAAC;IAC5E,CAAC;IACM,YAAY,CAAC,WAAmB;QACrC,IAAI,CAAC,cAAc,IAAI,WAAW,CAAC;QACnC,IAAI,CAAC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C,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,EACxC,CAAC,CAAS,EAAE,EAAE,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC,CAAC,CACpC,CAAC;QACF,IAAI,SAAS,KAAK,SAAS;YACzB,OAAO,SAAS,CAAC;QACnB,OAAO,SAAS,CAAC;IACnB,CAAC;CACF","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n\r\n/** @packageDocumentation\r\n * @module Curve\r\n */\r\nimport { Geometry } from \"../../Geometry\";\r\nimport { XYCurveEvaluator } from \"./XYCurveEvaluator\";\r\nimport { SimpleNewton } from \"../../numerics/Newton\";\r\n\r\n/**\r\n * @internal\r\n */\r\nexport class DirectHalfCosineSpiralEvaluator extends XYCurveEvaluator {\r\n public nominalLength1: number;\r\n public nominalRadius1: number;\r\n private _c: number;\r\n private _c1: number;\r\n private _c2: number;\r\n public constructor(length1: number, radius1: number) {\r\n super();\r\n this.nominalLength1 = length1;\r\n this.nominalRadius1 = radius1;\r\n const pi = Math.PI;\r\n this._c1 = 1.0 / (2.0 * pi * pi);\r\n this._c2 = 0.25;\r\n this._c = 0.0; // TO BE UPDATED BELOW\r\n this.updateConstants();\r\n }\r\n private updateConstants() {\r\n this._c = this.nominalLength1 * this.nominalLength1 / this.nominalRadius1;\r\n }\r\n public scaleInPlace(scaleFactor: number) {\r\n this.nominalLength1 *= scaleFactor;\r\n this.nominalRadius1 *= scaleFactor;\r\n this.updateConstants();\r\n }\r\n /** Return a deep copy of the evaluator. */\r\n public clone(): DirectHalfCosineSpiralEvaluator {\r\n return new DirectHalfCosineSpiralEvaluator(this.nominalLength1, this.nominalRadius1);\r\n }\r\n /** Member by member matchup. */\r\n public isAlmostEqual(other: any): boolean {\r\n if (other instanceof DirectHalfCosineSpiralEvaluator) {\r\n return Geometry.isSameCoordinate(this.nominalLength1, other.nominalLength1)\r\n && Geometry.isSameCoordinate(this.nominalRadius1, other.nominalRadius1);\r\n // remark: c,c1,c2 are computed, need not be tested.\r\n }\r\n return false;\r\n }\r\n /** Evaluate X at fractional position. */\r\n public fractionToX(fraction: number): number {\r\n return fraction * this.nominalLength1;\r\n }\r\n /** Evaluate Y at fractional position. */\r\n public fractionToY(fraction: number): number {\r\n const theta = fraction * Math.PI;\r\n return this._c * (this._c2 * fraction * fraction - this._c1 * (1.0 - Math.cos(theta)));\r\n }\r\n /** Evaluate derivative of X with respect to fraction at fractional position. */\r\n public fractionToDX(_fraction: number): number {\r\n return this.nominalLength1;\r\n }\r\n /** Evaluate derivative of Y with respect to fraction at fractional position. */\r\n public fractionToDY(fraction: number): number {\r\n const pi = Math.PI;\r\n const theta = fraction * pi;\r\n return this._c * (2.0 * this._c2 * fraction - this._c1 * pi * Math.sin(theta));\r\n }\r\n /** Evaluate second derivative of X with respect to fraction at fractional position. */\r\n public fractionToDDX(_fraction: number): number {\r\n return 0.0;\r\n }\r\n /** Evaluate third derivative of Y with respect to fraction at fractional position. */\r\n public fractionToDDY(fraction: number): number {\r\n const pi = Math.PI;\r\n const theta = fraction * pi;\r\n return this._c * (2.0 * this._c2 - this._c1 * pi * pi * Math.cos(theta));\r\n }\r\n /** Evaluate second derivative of X with respect to fraction at fractional position. */\r\n public fractionToD3X(_fraction: number): number {\r\n return 0.0;\r\n }\r\n /** Evaluate third derivative of Y with respect to fraction at fractional position. */\r\n public fractionToD3Y(fraction: number): number {\r\n const pi = Math.PI;\r\n const theta = fraction * pi;\r\n return this._c * this._c1 * pi * pi * pi * Math.sin(theta);\r\n }\r\n /** Return the magnitude of the first vector at fractional coordinate. */\r\n public override fractionToTangentMagnitude(fraction: number): number {\r\n return Geometry.hypotenuseXY(this.fractionToDX(fraction), this.fractionToDY(fraction));\r\n }\r\n /** Invert the fractionToX function for given X. */\r\n public xToFraction(x: number): number | undefined {\r\n const fraction0 = x / this.nominalLength1;\r\n const fraction1 = SimpleNewton.runNewton1D(\r\n fraction0,\r\n (f: number) => (this.fractionToX(f) - x),\r\n (f: number) => this.fractionToDX(f),\r\n );\r\n if (fraction1 === undefined)\r\n return undefined;\r\n return fraction1;\r\n }\r\n}\r\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DirectSpiral3d.js","sourceRoot":"","sources":["../../../../src/curve/spiral/DirectSpiral3d.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AACH,OAAO,EAAE,QAAQ,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,kBAAkB,CAAC;IACxD,wFAAwF;IAChF,cAAc,CAAe;IACrC;;;;;OAKG;IACK,cAAc,CAAgB;IACtC,yEAAyE;IACzE,IAAW,aAAa;QACtB,OAAO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,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 { 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 strokes.ensureEmptyUVParams();\n strokes.ensureEmptyFractions();\n const distances = strokes.packedUVParams!;\n const nominalIntervalLength = Math.abs(fractionB - fractionA) * this._nominalL1;\n for (let i = 0; i <= numInterval; i++) {\n const fraction = Geometry.interpolate(fractionA, i / numInterval, fractionB);\n const nominalDistanceAlong = fraction * nominalIntervalLength;\n strokes.packedPoints.pushXYZ(this._evaluator.fractionToX(fraction), 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 /**\n * Return quick length of the spiral.\n * The tangent vector of a true clothoid is length 1 everywhere, so simple proportion of nominalL1 is a good approximation.\n */\n public quickLength() {\n const distanceData = this._globalStrokes.packedUVParams!;\n const n = distanceData.length;\n return distanceData.getYAtUncheckedPointIndex(n - 1);\n }\n // 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 /** 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
|
+
{"version":3,"file":"DirectSpiral3d.js","sourceRoot":"","sources":["../../../../src/curve/spiral/DirectSpiral3d.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AACH,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAO1C,OAAO,EAAE,SAAS,EAAE,MAAM,4BAA4B,CAAC;AAEvD,OAAO,EAAE,kBAAkB,EAAE,MAAM,wCAAwC,CAAC;AAC5E,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;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,kBAAkB,CAAC;IACxD,wFAAwF;IAChF,cAAc,CAAe;IACrC;;;;;OAKG;IACK,cAAc,CAAgB;IACtC,yEAAyE;IACzE,IAAW,aAAa;QACtB,OAAO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,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":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module Curve\r\n */\r\nimport { Geometry } from \"../../Geometry\";\r\nimport { Angle } from \"../../geometry3d/Angle\";\r\nimport { GeometryHandler, IStrokeHandler } from \"../../geometry3d/GeometryHandler\";\r\nimport { Plane3dByOriginAndUnitNormal } from \"../../geometry3d/Plane3dByOriginAndUnitNormal\";\r\nimport { Plane3dByOriginAndVectors } from \"../../geometry3d/Plane3dByOriginAndVectors\";\r\nimport { Point3d } from \"../../geometry3d/Point3dVector3d\";\r\nimport { Ray3d } from \"../../geometry3d/Ray3d\";\r\nimport { Segment1d } from \"../../geometry3d/Segment1d\";\r\nimport { Transform } from \"../../geometry3d/Transform\";\r\nimport { CurveLengthContext } from \"../internalContexts/CurveLengthContext\";\r\nimport { LineString3d } from \"../LineString3d\";\r\nimport { StrokeOptions } from \"../StrokeOptions\";\r\nimport { AustralianRailCorpXYEvaluator } from \"./AustralianRailCorpXYEvaluator\";\r\nimport { ClothoidSeriesRLEvaluator } from \"./ClothoidSeries\";\r\nimport { CzechSpiralEvaluator, ItalianSpiralEvaluator } from \"./CzechSpiralEvaluator\";\r\nimport { DirectHalfCosineSpiralEvaluator } from \"./DirectHalfCosineSpiralEvaluator\";\r\nimport { MXCubicAlongArcEvaluator } from \"./MXCubicAlongArcSpiralEvaluator\";\r\nimport { PolishCubicEvaluator } from \"./PolishCubicSpiralEvaluator\";\r\nimport { TransitionConditionalProperties } from \"./TransitionConditionalProperties\";\r\nimport { TransitionSpiral3d } from \"./TransitionSpiral3d\";\r\nimport { XYCurveEvaluator } from \"./XYCurveEvaluator\";\r\n\r\n/**\r\n* DirectSpiral3d acts like a TransitionSpiral3d for serialization purposes, but implements spiral types that have\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 strokes.ensureEmptyUVParams();\r\n strokes.ensureEmptyFractions();\r\n const distances = strokes.packedUVParams!;\r\n const nominalIntervalLength = Math.abs(fractionB - fractionA) * this._nominalL1;\r\n for (let i = 0; i <= numInterval; i++) {\r\n const fraction = Geometry.interpolate(fractionA, i / numInterval, fractionB);\r\n const nominalDistanceAlong = fraction * nominalIntervalLength;\r\n strokes.packedPoints.pushXYZ(this._evaluator.fractionToX(fraction), 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 /**\r\n * Return quick length of the spiral.\r\n * The tangent vector of a true clothoid is length 1 everywhere, so simple proportion of nominalL1 is a good approximation.\r\n */\r\n public quickLength() {\r\n const distanceData = this._globalStrokes.packedUVParams!;\r\n const n = distanceData.length;\r\n return distanceData.getYAtUncheckedPointIndex(n - 1);\r\n }\r\n // 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 /** 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 +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,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAC1D,OAAO,EAAE,SAAS,EAAE,MAAM,4BAA4B,CAAC;AACvD,OAAO,EAAE,UAAU,EAAE,MAAM,6BAA6B,CAAC;AACzD,OAAO,EAAE,SAAS,EAAE,MAAM,4BAA4B,CAAC;AACvD,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC/C,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAC9D,OAAO,EAAE,+BAA+B,EAAE,MAAM,mCAAmC,CAAC;AACpF,OAAO,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC;AACvD,OAAO,EAAE,OAAO,EAAE,MAAM,kCAAkC,CAAC;AAC3D,OAAO,EAAE,QAAQ,EAAE,MAAM,2BAA2B,CAAC;AAGrD,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AACrD,OAAO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YAAY,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;QACnE,OAAO,CAAC,YAAY,CAAC,IAAI,CAAC,yBAAyB,CAAC,cAAc,CAAC,CAAC,CAAC;QACrE,OAAO,yBAAyB,CAAC,aAAa,CAAC,MAAM,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,CAAC,CAAC;IACnF,CAAC;IACD,oFAAoF;IAC7E,yBAAyB,CAAC,OAAwB;QACvD,OAAO,OAAO,CAAC,sBAAsB,CAAC,IAAI,CAAC,CAAC;IAC9C,CAAC;IACD,6CAA6C;IAC7B,aAAa,CAAC,KAAqB;QACjD,IAAI,KAAK,YAAY,kBAAkB,EAAE,CAAC;YACxC,OAAO,IAAI,CAAC,QAAQ,CAAC,aAAa,CAAC,KAAK,CAAC,QAAQ,CAAC;mBAC7C,IAAI,CAAC,SAAS,CAAC,6BAA6B,CAAC,KAAK,CAAC,SAAS,CAAC;mBAC7D,IAAI,CAAC,YAAY,CAAC,aAAa,CAAC,KAAK,CAAC,YAAY,CAAC;mBACnD,QAAQ,CAAC,gBAAgB,CAAC,IAAI,CAAC,YAAY,EAAE,KAAK,CAAC,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 { TransitionSpiral3d } from \"./TransitionSpiral3d\";\nimport { Segment1d } from \"../../geometry3d/Segment1d\";\nimport { AngleSweep } from \"../../geometry3d/AngleSweep\";\nimport { Transform } from \"../../geometry3d/Transform\";\nimport { LineString3d } from \"../LineString3d\";\nimport { NormalizedTransition } from \"./NormalizedTransition\";\nimport { TransitionConditionalProperties } from \"./TransitionConditionalProperties\";\nimport { Quadrature } from \"../../numerics/Quadrature\";\nimport { Point3d } from \"../../geometry3d/Point3dVector3d\";\nimport { Matrix3d } from \"../../geometry3d/Matrix3d\";\nimport { Angle } from \"../../geometry3d/Angle\";\nimport { Plane3dByOriginAndUnitNormal } from \"../../geometry3d/Plane3dByOriginAndUnitNormal\";\nimport { AxisOrder, Geometry } from \"../../Geometry\";\nimport { StrokeOptions } from \"../StrokeOptions\";\nimport { GeometryHandler, IStrokeHandler } from \"../../geometry3d/GeometryHandler\";\nimport { Ray3d } from \"../../geometry3d/Ray3d\";\nimport { Plane3dByOriginAndVectors } from \"../../geometry3d/Plane3dByOriginAndVectors\";\nimport { GeometryQuery } from \"../GeometryQuery\";\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 /**\n * Return the curvature at given fraction of the active interval.\n * * The `undefined` result is to match the abstract class -- it cannot actually occur.\n */\n public override fractionToCurvature(activeFraction: number): number | undefined {\n // BUG? active interval\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,\n data.curveLength!,\n data1,\n );\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 if (activeFraction > 1.0) {\n result = this._globalStrokes.packedPoints.back(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.front(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); // this indexes the point to the left of the query\n const globalFraction0 = index0 / numStrokes;\n result = this._globalStrokes.packedPoints.getPoint3dAtUncheckedPointIndex(index0, result);\n // GeometryCoreTestIO.consoleLog(\"fractionToPoint \", activeFraction, this.activeFractionInterval, \"( global integration \" + globalFraction0 + \" to \" + globalFraction + \")\", index0);\n this.fullSpiralIncrementalIntegral(result, globalFraction0, targetGlobalFraction, true);\n\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
|
+
{"version":3,"file":"IntegratedSpiral3d.js","sourceRoot":"","sources":["../../../../src/curve/spiral/IntegratedSpiral3d.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAEH,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAC1D,OAAO,EAAE,SAAS,EAAE,MAAM,4BAA4B,CAAC;AACvD,OAAO,EAAE,UAAU,EAAE,MAAM,6BAA6B,CAAC;AACzD,OAAO,EAAE,SAAS,EAAE,MAAM,4BAA4B,CAAC;AACvD,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC/C,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAC9D,OAAO,EAAE,+BAA+B,EAAE,MAAM,mCAAmC,CAAC;AACpF,OAAO,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC;AACvD,OAAO,EAAE,OAAO,EAAE,MAAM,kCAAkC,CAAC;AAC3D,OAAO,EAAE,QAAQ,EAAE,MAAM,2BAA2B,CAAC;AAGrD,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AACrD,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;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C,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;QACnE,OAAO,CAAC,YAAY,CAAC,IAAI,CAAC,yBAAyB,CAAC,cAAc,CAAC,CAAC,CAAC;QACrE,OAAO,yBAAyB,CAAC,aAAa,CAAC,MAAM,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,CAAC,CAAC;IACnF,CAAC;IACD,oFAAoF;IAC7E,yBAAyB,CAAC,OAAwB;QACvD,OAAO,OAAO,CAAC,sBAAsB,CAAC,IAAI,CAAC,CAAC;IAC9C,CAAC;IACD,6CAA6C;IAC7B,aAAa,CAAC,KAAqB;QACjD,IAAI,KAAK,YAAY,kBAAkB,EAAE,CAAC;YACxC,OAAO,IAAI,CAAC,QAAQ,CAAC,aAAa,CAAC,KAAK,CAAC,QAAQ,CAAC;mBAC7C,IAAI,CAAC,SAAS,CAAC,6BAA6B,CAAC,KAAK,CAAC,SAAS,CAAC;mBAC7D,IAAI,CAAC,YAAY,CAAC,aAAa,CAAC,KAAK,CAAC,YAAY,CAAC;mBACnD,QAAQ,CAAC,gBAAgB,CAAC,IAAI,CAAC,YAAY,EAAE,KAAK,CAAC,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":["/*---------------------------------------------------------------------------------------------\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 { TransitionSpiral3d } from \"./TransitionSpiral3d\";\r\nimport { Segment1d } from \"../../geometry3d/Segment1d\";\r\nimport { AngleSweep } from \"../../geometry3d/AngleSweep\";\r\nimport { Transform } from \"../../geometry3d/Transform\";\r\nimport { LineString3d } from \"../LineString3d\";\r\nimport { NormalizedTransition } from \"./NormalizedTransition\";\r\nimport { TransitionConditionalProperties } from \"./TransitionConditionalProperties\";\r\nimport { Quadrature } from \"../../numerics/Quadrature\";\r\nimport { Point3d } from \"../../geometry3d/Point3dVector3d\";\r\nimport { Matrix3d } from \"../../geometry3d/Matrix3d\";\r\nimport { Angle } from \"../../geometry3d/Angle\";\r\nimport { Plane3dByOriginAndUnitNormal } from \"../../geometry3d/Plane3dByOriginAndUnitNormal\";\r\nimport { AxisOrder, Geometry } from \"../../Geometry\";\r\nimport { StrokeOptions } from \"../StrokeOptions\";\r\nimport { GeometryHandler, IStrokeHandler } from \"../../geometry3d/GeometryHandler\";\r\nimport { Ray3d } from \"../../geometry3d/Ray3d\";\r\nimport { Plane3dByOriginAndVectors } from \"../../geometry3d/Plane3dByOriginAndVectors\";\r\nimport { GeometryQuery } from \"../GeometryQuery\";\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 /**\r\n * Return the curvature at given fraction of the active interval.\r\n * * The `undefined` result is to match the abstract class -- it cannot actually occur.\r\n */\r\n public override fractionToCurvature(activeFraction: number): number | undefined {\r\n // BUG? active interval\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,\r\n data.curveLength!,\r\n data1,\r\n );\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 if (activeFraction > 1.0) {\r\n result = this._globalStrokes.packedPoints.back(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.front(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); // this indexes the point to the left of the query\r\n const globalFraction0 = index0 / numStrokes;\r\n result = this._globalStrokes.packedPoints.getPoint3dAtUncheckedPointIndex(index0, result);\r\n // GeometryCoreTestIO.consoleLog(\"fractionToPoint \", activeFraction, this.activeFractionInterval, \"( global integration \" + globalFraction0 + \" to \" + globalFraction + \")\", index0);\r\n this.fullSpiralIncrementalIntegral(result, globalFraction0, targetGlobalFraction, true);\r\n\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 +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;;;;;;;;;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,CA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AC;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
|
+
{"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,CA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;;;;;;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"]}
|