@itwin/core-geometry 5.2.0-dev.26 → 5.2.0-dev.29
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.d.ts +10 -3
- package/lib/cjs/clipping/ClipPlane.d.ts.map +1 -1
- package/lib/cjs/clipping/ClipPlane.js +9 -2
- 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.d.ts +12 -9
- package/lib/cjs/clipping/ConvexClipPlaneSet.d.ts.map +1 -1
- package/lib/cjs/clipping/ConvexClipPlaneSet.js +17 -12
- package/lib/cjs/clipping/ConvexClipPlaneSet.js.map +1 -1
- package/lib/cjs/clipping/UnionOfConvexClipPlaneSets.d.ts +20 -3
- package/lib/cjs/clipping/UnionOfConvexClipPlaneSets.d.ts.map +1 -1
- package/lib/cjs/clipping/UnionOfConvexClipPlaneSets.js +22 -5
- 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.d.ts.map +1 -1
- package/lib/cjs/curve/internalContexts/PolygonOffsetContext.js +30 -50
- 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.d.ts +18 -9
- package/lib/cjs/geometry3d/PolygonOps.d.ts.map +1 -1
- package/lib/cjs/geometry3d/PolygonOps.js +53 -26
- 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.d.ts +16 -0
- package/lib/cjs/geometry4d/Matrix4d.d.ts.map +1 -1
- package/lib/cjs/geometry4d/Matrix4d.js +26 -0
- 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.d.ts +1 -3
- package/lib/cjs/polyface/Polyface.d.ts.map +1 -1
- package/lib/cjs/polyface/Polyface.js +2 -6
- 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.d.ts +2 -0
- package/lib/cjs/polyface/PolyfaceData.d.ts.map +1 -1
- package/lib/cjs/polyface/PolyfaceData.js +7 -3
- 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/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.d.ts +10 -3
- package/lib/esm/clipping/ClipPlane.d.ts.map +1 -1
- package/lib/esm/clipping/ClipPlane.js +9 -2
- 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.d.ts +12 -9
- package/lib/esm/clipping/ConvexClipPlaneSet.d.ts.map +1 -1
- package/lib/esm/clipping/ConvexClipPlaneSet.js +17 -12
- package/lib/esm/clipping/ConvexClipPlaneSet.js.map +1 -1
- package/lib/esm/clipping/UnionOfConvexClipPlaneSets.d.ts +20 -3
- package/lib/esm/clipping/UnionOfConvexClipPlaneSets.d.ts.map +1 -1
- package/lib/esm/clipping/UnionOfConvexClipPlaneSets.js +22 -5
- 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.d.ts.map +1 -1
- package/lib/esm/curve/internalContexts/PolygonOffsetContext.js +30 -50
- 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.d.ts +18 -9
- package/lib/esm/geometry3d/PolygonOps.d.ts.map +1 -1
- package/lib/esm/geometry3d/PolygonOps.js +53 -26
- 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.d.ts +16 -0
- package/lib/esm/geometry4d/Matrix4d.d.ts.map +1 -1
- package/lib/esm/geometry4d/Matrix4d.js +26 -0
- 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.d.ts +1 -3
- package/lib/esm/polyface/Polyface.d.ts.map +1 -1
- package/lib/esm/polyface/Polyface.js +2 -6
- 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.d.ts +2 -0
- package/lib/esm/polyface/PolyfaceData.d.ts.map +1 -1
- package/lib/esm/polyface/PolyfaceData.js +7 -3
- 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/XYParitySearchContext.js.map +1 -1
- package/package.json +3 -3
|
@@ -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,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAEjD,OAAO,EAAE,KAAK,EAAE,MAAM,wBAAwB,CAAC;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a,CAAC,MAAM,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,CAAC,CAAC;IACnF,CAAC;IACD,mFAAmF;IAC5E,yBAAyB,CAAC,OAAwB;QACvD,OAAO,OAAO,CAAC,sBAAsB,CAAC,IAAI,CAAC,CAAC;IAC9C,CAAC;IAED,4CAA4C;IAC5B,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 * 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\nexport class IntegratedSpiral3d extends TransitionSpiral3d {\r\n /** String name for schema properties */\r\n public readonly curvePrimitiveType = \"transitionSpiral\";\r\n\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 /** stroked approximation of active spiral.\r\n * * Same count as global -- possibly overly fine, but it gives some consistency between same clothoid constructed as partial versus complete.\r\n * * If no trimming, this points to the same place as the _globalStrokes !!! Don't double transform!!!\r\n */\r\n private _activeStrokes?: LineString3d;\r\n /** Return the internal stroked form of the (possibly partial) spiral */\r\n public get activeStrokes(): LineString3d { return this._activeStrokes !== undefined ? this._activeStrokes : this._globalStrokes; }\r\n 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 /** evaluator for transition */\r\n // constructor demands all bearing, radius, and length data -- caller determines usual dependency of \"any 4 determine the 5th\"\r\n private constructor(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 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\r\n /** use the integrated function to return an angle at fractional position. */\r\n\r\n public globalFractionToBearingRadians(fraction: number): number {\r\n const areaFraction = this._evaluator.fractionToArea(fraction);\r\n const dx = this._arcLength01;\r\n return this.bearing01.startRadians + areaFraction * dx * this._curvature01.signedDelta() + fraction * this._curvature01.x0 * dx;\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\r\n /** Return the bearing at given fraction of the active interval .... */\r\n\r\n public fractionToBearingRadians(activeFraction: number): number {\r\n const fraction = this.activeFractionInterval.fractionToPoint(activeFraction);\r\n return this.bearing01.startRadians + fraction * this._arcLength01 * (this._curvature01.x0 + 0.5 * fraction * (this._curvature01.x1 - this._curvature01.x0));\r\n }\r\n /** Return the curvature at given fraction of the active interval ...\r\n * * 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\r\n // These static variables are reused on calls to integrateFromStartFraction\r\n\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 /** Evaluate and sum the gauss quadrature formulas to integrate cos(theta), sin(theta) fractional subset of a reference length.\r\n * (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 unitArcLength length of curve for 0 to 1 fractional\r\n */\r\n private fullSpiralIncrementalIntegral(xyz: Point3d, fractionA: number, fractionB: number, applyMatrix: boolean) {\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 }\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 this._globalStrokes.clear();\r\n const currentPoint = Point3d.create();\r\n this._globalStrokes.appendStrokePoint(currentPoint);\r\n const numInterval = 16;\r\n\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 // finer strokes in the active interval ... same fraction step, but mapped\r\n // This assumes factionToPoint acts normally within refreshComputedProperties -- that depends on the global strokes we just computed, but not on the active strokes\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 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(radius01: Segment1d, bearing01: AngleSweep, activeFractionInterval: Segment1d, localToWorld: Transform, typeName?: string) {\r\n const arcLength = TransitionSpiral3d.radiusRadiusSweepRadiansToArcLength(radius01.x0, radius01.x1, bearing01.sweepRadians);\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(typeName, evaluator,\r\n radius01.clone(),\r\n bearing01.clone(), activeFractionInterval.clone(), localToWorld.clone(), arcLength,\r\n new TransitionConditionalProperties(radius01.x0, radius01.x1,\r\n bearing01.startAngle.clone(), bearing01.endAngle.clone(),\r\n undefined));\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 [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): IntegratedSpiral3d | undefined {\r\n if (spiralType === undefined)\r\n spiralType = \"clothoid\";\r\n const evaluator = NormalizedTransition.findEvaluator(spiralType);\r\n if (!evaluator)\r\n return undefined;\r\n const data = new TransitionConditionalProperties(radius0, radius1, bearing0, bearing1, arcLength);\r\n const data1 = data.clone();\r\n if (!data.tryResolveAnySingleUnknown())\r\n return undefined;\r\n if (fractionInterval === undefined)\r\n fractionInterval = Segment1d.create(0, 1);\r\n return new IntegratedSpiral3d(\r\n spiralType,\r\n evaluator,\r\n Segment1d.create(data.radius0, data.radius1),\r\n AngleSweep.createStartEnd(data.bearing0!, data.bearing1!),\r\n fractionInterval ? fractionInterval.clone() : Segment1d.create(0, 1),\r\n localToWorld, data.curveLength!, data1);\r\n }\r\n /** Copy all defining data from another spiral. */\r\n public setFrom(other: IntegratedSpiral3d): IntegratedSpiral3d {\r\n this.localToWorld.setFrom(other.localToWorld);\r\n this.radius01.setFrom(other.radius01);\r\n this._curvature01.setFrom(other._curvature01);\r\n this.bearing01.setFrom(other.bearing01);\r\n this.localToWorld.setFrom(other.localToWorld);\r\n this.activeFractionInterval.setFrom(other.activeFractionInterval);\r\n this._arcLength01 = other._arcLength01;\r\n return this;\r\n }\r\n /** Deep clone of this spiral */\r\n public override clone(): IntegratedSpiral3d {\r\n return new IntegratedSpiral3d(this._spiralType, this._evaluator,\r\n this.radius01.clone(), this.bearing01.clone(),\r\n this.activeFractionInterval.clone(), this.localToWorld.clone(), 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\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\r\n /** Return the spiral start point. */\r\n public override startPoint(): Point3d { return this.activeStrokes.startPoint(); }\r\n /** return the spiral end point. */\r\n public override endPoint(): Point3d { return this.activeStrokes.endPoint(); }\r\n /** test if the local to world transform places the spiral xy plane into `plane` */\r\n public isInPlane(plane: Plane3dByOriginAndUnitNormal): boolean {\r\n return plane.isPointInPlane(this.localToWorld.origin as Point3d)\r\n && Geometry.isSameCoordinate(0.0, this.localToWorld.matrix.dotColumnX(plane.getNormalRef()))\r\n && Geometry.isSameCoordinate(0.0, this.localToWorld.matrix.dotColumnY(plane.getNormalRef()));\r\n }\r\n /** Return length of the spiral. Because TransitionSpiral is parameterized directly in terms of distance along, this is a simple return value. */\r\n public quickLength() { return this.curveLength(); }\r\n /** Return length of the spiral. Because TransitionSpiral is parameterized directly in terms of distance along, this is a simple return value. */\r\n public override curveLength() { return this._arcLength01 * (this._activeFractionInterval.absoluteDelta()); }\r\n /** Return (unsigned) length of the spiral between fractions. Because TransitionSpiral is parameterized directly in terms of distance along, this is a simple return value. */\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 { return other instanceof TransitionSpiral3d; }\r\n /** Add strokes from this spiral to `dest`.\r\n * * Linestrings will usually stroke as just their points.\r\n * * If maxEdgeLength is given, this will sub-stroke within the linestring -- not what we want.\r\n */\r\n public emitStrokes(dest: LineString3d, options?: StrokeOptions): void { this.activeStrokes.emitStrokes(dest, options); }\r\n /** emit stroke fragments to `dest` handler. */\r\n public emitStrokableParts(dest: IStrokeHandler, options?: StrokeOptions): void {\r\n const n = this.computeStrokeCountForOptions(options);\r\n 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 /**\r\n * return the stroke count required for given options.\r\n * @param options StrokeOptions that determine count\r\n */\r\n\r\n public computeStrokeCountForOptions(options?: StrokeOptions): number {\r\n let numStroke;\r\n 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\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\r\n /** Return the frenet frame at fractional position. */\r\n\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\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 /** Return a plane with\r\n *\r\n * * origin at fractional position along the curve\r\n * * vectorU is the first derivative, i.e. tangent vector with length equal to the rate of change with respect to the fraction.\r\n * * vectorV is the second derivative, i.e.derivative of vectorU.\r\n */\r\n public fractionToPointAnd2Derivatives(activeFraction: number, result?: Plane3dByOriginAndVectors): 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\r\n /** compare various coordinate quantities */\r\n public override isAlmostEqual(other?: GeometryQuery): boolean {\r\n if (other instanceof IntegratedSpiral3d) {\r\n return this.radius01.isAlmostEqual(other.radius01)\r\n && this.bearing01.isAlmostEqualAllowPeriodShift(other.bearing01)\r\n && this.localToWorld.isAlmostEqual(other.localToWorld)\r\n && Geometry.isSameCoordinate(this._arcLength01, other._arcLength01)\r\n && this.activeFractionInterval.isAlmostEqual(other.activeFractionInterval)\r\n && this._curvature01.isAlmostEqual(other._curvature01);\r\n }\r\n return false;\r\n }\r\n}\r\n// at load time, initialize gauss quadrature workspace\r\nIntegratedSpiral3d.initWorkSpace();\r\n"]}
|
|
1
|
+
{"version":3,"file":"IntegratedSpiral3d.js","sourceRoot":"","sources":["../../../../src/curve/spiral/IntegratedSpiral3d.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAEH,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAC1D,OAAO,EAAE,SAAS,EAAE,MAAM,4BAA4B,CAAC;AACvD,OAAO,EAAE,UAAU,EAAE,MAAM,6B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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 * 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 */\nexport class IntegratedSpiral3d extends TransitionSpiral3d {\n /** String name for schema properties */\n public readonly curvePrimitiveType = \"transitionSpiral\";\n\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 /** stroked approximation of active spiral.\n * * Same count as global -- possibly overly fine, but it gives some consistency between same clothoid constructed as partial versus complete.\n * * If no trimming, this points to the same place as the _globalStrokes !!! Don't double transform!!!\n */\n private _activeStrokes?: LineString3d;\n /** Return the internal stroked form of the (possibly partial) spiral */\n public get activeStrokes(): LineString3d { return this._activeStrokes !== undefined ? this._activeStrokes : this._globalStrokes; }\n 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 /** evaluator for transition */\n // constructor demands all bearing, radius, and length data -- caller determines usual dependency of \"any 4 determine the 5th\"\n private constructor(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 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\n /** use the integrated function to return an angle at fractional position. */\n\n public globalFractionToBearingRadians(fraction: number): number {\n const areaFraction = this._evaluator.fractionToArea(fraction);\n const dx = this._arcLength01;\n return this.bearing01.startRadians + areaFraction * dx * this._curvature01.signedDelta() + fraction * this._curvature01.x0 * dx;\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\n /** Return the bearing at given fraction of the active interval .... */\n\n public fractionToBearingRadians(activeFraction: number): number {\n const fraction = this.activeFractionInterval.fractionToPoint(activeFraction);\n return this.bearing01.startRadians + fraction * this._arcLength01 * (this._curvature01.x0 + 0.5 * fraction * (this._curvature01.x1 - this._curvature01.x0));\n }\n /** Return the curvature at given fraction of the active interval ...\n * * 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\n // These static variables are reused on calls to integrateFromStartFraction\n\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 /** Evaluate and sum the gauss quadrature formulas to integrate cos(theta), sin(theta) fractional subset of a reference length.\n * (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 unitArcLength length of curve for 0 to 1 fractional\n */\n private fullSpiralIncrementalIntegral(xyz: Point3d, fractionA: number, fractionB: number, applyMatrix: boolean) {\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 }\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 this._globalStrokes.clear();\n const currentPoint = Point3d.create();\n this._globalStrokes.appendStrokePoint(currentPoint);\n const numInterval = 16;\n\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 // finer strokes in the active interval ... same fraction step, but mapped\n // This assumes factionToPoint acts normally within refreshComputedProperties -- that depends on the global strokes we just computed, but not on the active strokes\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 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(radius01: Segment1d, bearing01: AngleSweep, activeFractionInterval: Segment1d, localToWorld: Transform, typeName?: string) {\n const arcLength = TransitionSpiral3d.radiusRadiusSweepRadiansToArcLength(radius01.x0, radius01.x1, bearing01.sweepRadians);\n if (typeName === undefined)\n typeName = \"clothoid\";\n const evaluator = NormalizedTransition.findEvaluator(typeName);\n if (!evaluator)\n return undefined;\n return new IntegratedSpiral3d(typeName, evaluator,\n radius01.clone(),\n bearing01.clone(), activeFractionInterval.clone(), localToWorld.clone(), arcLength,\n new TransitionConditionalProperties(radius01.x0, radius01.x1,\n bearing01.startAngle.clone(), bearing01.endAngle.clone(),\n undefined));\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 [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): IntegratedSpiral3d | undefined {\n if (spiralType === undefined)\n spiralType = \"clothoid\";\n const evaluator = NormalizedTransition.findEvaluator(spiralType);\n if (!evaluator)\n return undefined;\n const data = new TransitionConditionalProperties(radius0, radius1, bearing0, bearing1, arcLength);\n const data1 = data.clone();\n if (!data.tryResolveAnySingleUnknown())\n return undefined;\n if (fractionInterval === undefined)\n fractionInterval = Segment1d.create(0, 1);\n return new IntegratedSpiral3d(\n spiralType,\n evaluator,\n Segment1d.create(data.radius0, data.radius1),\n AngleSweep.createStartEnd(data.bearing0!, data.bearing1!),\n fractionInterval ? fractionInterval.clone() : Segment1d.create(0, 1),\n localToWorld, data.curveLength!, data1);\n }\n /** Copy all defining data from another spiral. */\n public setFrom(other: IntegratedSpiral3d): IntegratedSpiral3d {\n this.localToWorld.setFrom(other.localToWorld);\n this.radius01.setFrom(other.radius01);\n this._curvature01.setFrom(other._curvature01);\n this.bearing01.setFrom(other.bearing01);\n this.localToWorld.setFrom(other.localToWorld);\n this.activeFractionInterval.setFrom(other.activeFractionInterval);\n this._arcLength01 = other._arcLength01;\n return this;\n }\n /** Deep clone of this spiral */\n public override clone(): IntegratedSpiral3d {\n return new IntegratedSpiral3d(this._spiralType, this._evaluator,\n this.radius01.clone(), this.bearing01.clone(),\n this.activeFractionInterval.clone(), this.localToWorld.clone(), 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\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\n /** Return the spiral start point. */\n public override startPoint(): Point3d { return this.activeStrokes.startPoint(); }\n /** return the spiral end point. */\n public override endPoint(): Point3d { return this.activeStrokes.endPoint(); }\n /** test if the local to world transform places the spiral xy plane into `plane` */\n public isInPlane(plane: Plane3dByOriginAndUnitNormal): boolean {\n return plane.isPointInPlane(this.localToWorld.origin as Point3d)\n && Geometry.isSameCoordinate(0.0, this.localToWorld.matrix.dotColumnX(plane.getNormalRef()))\n && Geometry.isSameCoordinate(0.0, this.localToWorld.matrix.dotColumnY(plane.getNormalRef()));\n }\n /** Return length of the spiral. Because TransitionSpiral is parameterized directly in terms of distance along, this is a simple return value. */\n public quickLength() { return this.curveLength(); }\n /** Return length of the spiral. Because TransitionSpiral is parameterized directly in terms of distance along, this is a simple return value. */\n public override curveLength() { return this._arcLength01 * (this._activeFractionInterval.absoluteDelta()); }\n /** Return (unsigned) length of the spiral between fractions. Because TransitionSpiral is parameterized directly in terms of distance along, this is a simple return value. */\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 { return other instanceof TransitionSpiral3d; }\n /** Add strokes from this spiral to `dest`.\n * * Linestrings will usually stroke as just their points.\n * * If maxEdgeLength is given, this will sub-stroke within the linestring -- not what we want.\n */\n public emitStrokes(dest: LineString3d, options?: StrokeOptions): void { this.activeStrokes.emitStrokes(dest, options); }\n /** emit stroke fragments to `dest` handler. */\n public emitStrokableParts(dest: IStrokeHandler, options?: StrokeOptions): void {\n const n = this.computeStrokeCountForOptions(options);\n 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 /**\n * return the stroke count required for given options.\n * @param options StrokeOptions that determine count\n */\n\n public computeStrokeCountForOptions(options?: StrokeOptions): number {\n let numStroke;\n 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\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\n /** Return the frenet frame at fractional position. */\n\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\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 /** Return a plane with\n *\n * * origin at fractional position along the curve\n * * vectorU is the first derivative, i.e. tangent vector with length equal to the rate of change with respect to the fraction.\n * * vectorV is the second derivative, i.e.derivative of vectorU.\n */\n public fractionToPointAnd2Derivatives(activeFraction: number, result?: Plane3dByOriginAndVectors): 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\n /** compare various coordinate quantities */\n public override isAlmostEqual(other?: GeometryQuery): boolean {\n if (other instanceof IntegratedSpiral3d) {\n return this.radius01.isAlmostEqual(other.radius01)\n && this.bearing01.isAlmostEqualAllowPeriodShift(other.bearing01)\n && this.localToWorld.isAlmostEqual(other.localToWorld)\n && Geometry.isSameCoordinate(this._arcLength01, other._arcLength01)\n && this.activeFractionInterval.isAlmostEqual(other.activeFractionInterval)\n && this._curvature01.isAlmostEqual(other._curvature01);\n }\n return false;\n }\n}\n// at load time, initialize gauss quadrature workspace\nIntegratedSpiral3d.initWorkSpace();\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MXCubicAlongArcSpiralEvaluator.js","sourceRoot":"","sources":["../../../../src/curve/spiral/MXCubicAlongArcSpiralEvaluator.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAE/F;;GAEG;AACH,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAC1C,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD;;;;;;;;;;;;;;GAcG;AACH,MAAM,OAAO,wBAAyB,SAAQ,cAAc;IACnD,cAAc,CAAS;IACvB,cAAc,CAAS;IAE9B,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;IAED,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,GAA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,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":["/*---------------------------------------------------------------------------------------------\
|
|
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;AAClD;;;;;;;;;;;;;;GAcG;AACH,MAAM,OAAO,wBAAyB,SAAQ,cAAc;IACnD,cAAc,CAAS;IACvB,cAAc,CAAS;IAE9B,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;IAED,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;IAEM,MAAM,CAAC,MAAM,CAAC,OAAe,EAAE,OAAe;QACnD,MAAM,CAAC,GAAG,IAAI,CAAC,aAAa,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;QAC/C,IAAI,CAAC,KAAK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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 * 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 * *\n * @param localToWorld\n * @param nominalL1\n * @param nominalR1\n * @param activeInterval\n * @internal\n */\nexport class MXCubicAlongArcEvaluator extends CubicEvaluator {\n public nominalLength1: number;\n public nominalRadius1: number;\n\n /** Constructor is private. Caller responsible for cubicM validity. */\n private constructor(length1: number, radius1: number, axisLength: number, cubicM: number) {\n super(axisLength, cubicM);\n this.nominalLength1 = length1;\n this.nominalRadius1 = radius1;\n }\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\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\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 { return new MXCubicAlongArcEvaluator(this.nominalLength1, this.nominalRadius1, this.axisLength, this.cubicM); }\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 CurvePrimitive measurements.\n * @param x distance along the x axis.\n */\n public static approximateDistanceAlongToX(nominalLength1: number, nominalRadius1: number, nominalDistanceAlong: number): number {\n const l2 = nominalLength1 * nominalLength1;\n const r2 = nominalRadius1 * nominalRadius1;\n const xx = nominalDistanceAlong * nominalDistanceAlong;\n return nominalDistanceAlong * (1.0 - xx * xx / (40.0 * r2 * l2));\n }\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NormalizedTransition.js","sourceRoot":"","sources":["../../../../src/curve/spiral/NormalizedTransition.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAE/F;;GAEG;AACH;;;;;;;;;;;;GAYG;AACH,MAAM,OAAgB,oBAAoB;IACxC,iHAAiH;IACjH,gBAAgB,CAAC;IAST,MAAM,CAAC,kBAAkB,CAAgC;IACzD,MAAM,CAAC,qBAAqB,CAAmC;IAC/D,MAAM,CAAC,eAAe,CAA6B;IACnD,MAAM,CAAC,cAAc,CAA4B;IACjD,MAAM,CAAC,gBAAgB,CAA8B;IAE7D;;;;;;;;;;;OAWG;IACI,MAAM,CAAC,aAAa,CAAC,IAAY;QACtC,IAAI,IAAI,KAAK,UAAU;YACrB,OAAO,IAAI,CAAC,kBAAkB,CAAC,CAAC,CAAC,IAAI,CAAC,kBAAkB,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,kBAAkB,GAAG,IAAI,4BAA4B,EAAE,CAAC,CAAC;QAC5H,IAAI,IAAI,KAAK,OAAO;YAClB,OAAO,IAAI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,CAAC,GAAG,IAAI,CAAC,EAAE,CAAC;QAClB,OAAO,GAAG,GAAG,CAAC,CAAC,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;IACrC,CAAC;IACD,mEAAmE;IAC5D,qCAAqC,CAAC,CAAS;QACpD,MAAM,CAAC,GAAG,IAAI,CAAC,EAAE,CAAC;QAClB,OAAO,GAAG,GAAG,CAAC,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC;IACnC,CAAC;IACD;;OAEG;IACI,cAAc,CAAC,CAAS;QAC7B,MAAM,CAAC,GAAG,IAAI,CAAC,EAAE,CAAC;QAClB,OAAO,GAAG,GAAG,CAAC,GAAG,GAAG,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC;IAC7C,CAAC;CACF","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n\r\n/** @packageDocumentation\r\n * @module Curve\r\n */\r\n/**\r\n * NormalizedTransition is the (abstract) base class for clothoid, bloss, biquadratic, sine, and cosine transition functions.\r\n * * Each function maps fractional progress to a curvature value.\r\n * * f(0) === 0\r\n * * f(1) === 1\r\n * * f(u) === 1 - f (1-u)\r\n * * Each implementation provides:\r\n * * fractionToCurvature -- the f(u) function described above\r\n * * fractionToCurvatureDerivative -- df(u)/du\r\n * * fractionToArea -- integral of the area under f(u) from 0 to u.\r\n * * the symmetry condition ensures that the integral from 0 to 1 is 1/2\r\n * @internal\r\n */\r\nexport abstract class NormalizedTransition {\r\n /** Constructor initializes with 0..1 values .. call \"setBearingCurvatureLengthCurvature\" to apply real values */\r\n constructor() { }\r\n /** At fractional position on the x axis, return the (normalized) curvature fraction. */\r\n public abstract fractionToCurvatureFraction(fractionX: number): number;\r\n /** Return the derivative of the (normalized) curvature fraction */\r\n public abstract fractionToCurvatureFractionDerivative(fractionX: number): number;\r\n /** Return the integrated area under the curve\r\n * * This is equal to the accumulated angle change.\r\n */\r\n public abstract fractionToArea(fractionX: number): number;\r\n private static _clothoidEvaluator?: NormalizedClothoidTransition;\r\n private static _biquadraticEvaluator?: NormalizedBiQuadraticTransition;\r\n private static _blossEvaluator?: NormalizedBlossTransition;\r\n private static _sineEvaluator?: NormalizedSineTransition;\r\n private static _cosineEvaluator?: NormalizedCosineTransition;\r\n\r\n /**\r\n * Return a standard evaluator identified by string as:\r\n * * clothoid\r\n * * bloss\r\n * * biquadratic\r\n * * sine\r\n * * cosine\r\n * Each of these types\r\n * * is instantiated (only once) as a single static object within the NormalizedTransition class.\r\n * * has no instance data or mutator methods.\r\n * @param name string name of the transition.\r\n */\r\n public static findEvaluator(name: string): NormalizedTransition | undefined {\r\n if (name === \"clothoid\")\r\n return this._clothoidEvaluator ? this._clothoidEvaluator : (this._clothoidEvaluator = new NormalizedClothoidTransition());\r\n if (name === \"bloss\")\r\n return this._blossEvaluator ? this._blossEvaluator : (this._blossEvaluator = new NormalizedBlossTransition());\r\n if (name === \"biquadratic\")\r\n return this._biquadraticEvaluator ? this._biquadraticEvaluator : (this._biquadraticEvaluator = new NormalizedBiQuadraticTransition());\r\n if (name === \"sine\")\r\n return this._sineEvaluator ? this._sineEvaluator : (this._sineEvaluator = new NormalizedSineTransition());\r\n if (name === \"cosine\")\r\n return this._cosineEvaluator ? this._cosineEvaluator : (this._cosineEvaluator = new NormalizedCosineTransition());\r\n return undefined;\r\n }\r\n}\r\n/**\r\n * Transition functions for clothoid spiral.\r\n * * curvature variation is linear from (0,0) to (1,1)\r\n * @internal\r\n */\r\nexport class NormalizedClothoidTransition extends NormalizedTransition {\r\n constructor() { super(); }\r\n /** At fractional position on the x axis, return the (normalized) curvature fraction. */\r\n public fractionToCurvatureFraction(fractionX: number): number { return fractionX; }\r\n /** Return the derivative of the (normalized) curvature fraction */\r\n public fractionToCurvatureFractionDerivative(_u: number): number { return 1.0; }\r\n /** Return the integrated area under the curve.\r\n * * This fraction is the angular change fraction.\r\n */\r\n public fractionToArea(fractionX: number): number {\r\n return fractionX * fractionX * 0.5;\r\n }\r\n}\r\n\r\n/**\r\n * Transition functions for bloss spiral.\r\n * * curvature variation is cubic from (0,0) with slope 0 to (1,1) with slope 1\r\n * @internal\r\n */\r\nexport class NormalizedBlossTransition extends NormalizedTransition {\r\n // bloss curve is (3 - 2x) x ^2 = 3 x^2 - 2 x^3\r\n // derivative 6x (1-x)\r\n // 2nd derivative 6 - 12 x\r\n // derivatives zero at 0,1\r\n // inflection zero at 0.5\r\n // integral is x^3 - x^4 / 2 = x^3 ( 1-x/2)\r\n constructor() { super(); }\r\n /** At fractional position on the x axis, return the (normalized) curvature fraction. */\r\n public fractionToCurvatureFraction(u: number): number { return u * u * (3 - 2 * u); }\r\n /** Return the derivative of the (normalized) curvature fraction */\r\n public fractionToCurvatureFractionDerivative(u: number): number {\r\n return 6.0 * u * (1.0 - u);\r\n }\r\n /** Return the integrated area under the curve.\r\n * * This fraction is the angular change fraction.\r\n */\r\n public fractionToArea(u: number): number {\r\n return u * u * u * (1 - 0.5 * u);\r\n }\r\n}\r\n\r\n/**\r\n * Transition functions for biquadratic transition\r\n * * Curvature is a pair of joining quadratics.\r\n * * In lower half of the interval, the quadratic is from (0,0) to (0.5, 0.5) with zero slope at origin\r\n * * In upper half of the interval, the quadratic is from (0.5,0.5) to (1,1) with zero slope at 1\r\n * @internal\r\n */\r\nexport class NormalizedBiQuadraticTransition extends NormalizedTransition {\r\n constructor() { super(); }\r\n private integratedBasis(u: number): number { return u * u * u * (2.0 / 3.0); }\r\n private basis(u: number): number { return 2 * u * u; }\r\n private basisDerivative(u: number): number { return 4 * u; }\r\n /** At fractional position on the x axis, return the (normalized) curvature fraction.\r\n * * * For [u <= 0.5, u >= 0.5]\r\n * * f(u) = [2 u^2, 1 - 2 (1-u)^2]\r\n * * f'(u) = [4 u, 4 (1-u)]\r\n * * If(u) = [2 u^3 / 3, 0.5 (1 -u )^3/3]\r\n */\r\n public fractionToCurvatureFraction(u: number): number {\r\n return u <= 0.5 ? this.basis(u) : 1.0 - this.basis(1.0 - u);\r\n }\r\n /** Return the derivative of the (normalized) curvature fraction */\r\n public fractionToCurvatureFractionDerivative(u: number): number {\r\n return u < 0.5 ? this.basisDerivative(u) : this.basisDerivative(1 - u);\r\n }\r\n /** Return the integrated area under the curve.\r\n * * This fraction is the angular change fraction.\r\n */\r\n public fractionToArea(u: number): number {\r\n if (u <= 0.5)\r\n return this.integratedBasis(u);\r\n const v = 1 - u;\r\n return 0.5 - v + this.integratedBasis(v);\r\n }\r\n}\r\n\r\n/**\r\n * Transition functions for sine transition\r\n * * curvature variation is the sum of\r\n * * straight line from (0,0) to (1,1), like clothoid\r\n * * additional full period of a sine wave, producing 0 slope at both ends\r\n * @internal\r\n */\r\nexport class NormalizedSineTransition extends NormalizedTransition {\r\n constructor() { super(); }\r\n /** At fractional position on the x axis, return the (normalized) curvature fraction. */\r\n public fractionToCurvatureFraction(u: number): number {\r\n const a = 2.0 * Math.PI;\r\n return u - Math.sin(u * a) / a;\r\n }\r\n /** Return the derivative of the (normalized) curvature fraction */\r\n public fractionToCurvatureFractionDerivative(u: number): number {\r\n const a = 2.0 * Math.PI;\r\n return 1 - Math.cos(u * a);\r\n }\r\n /** Return the integrated area under the curve.\r\n * * This fraction is the angular change fraction.\r\n */\r\n public fractionToArea(u: number): number {\r\n const a = 2.0 * Math.PI;\r\n return 0.5 * u * u + (Math.cos(u * a) - 1.0) / (a * a);\r\n }\r\n}\r\n/**\r\n * Transition functions for cosine\r\n * * curvature variation is a half period of a cosine\r\n * @internal\r\n */\r\nexport class NormalizedCosineTransition extends NormalizedTransition {\r\n constructor() { super(); }\r\n /** At fractional position on the x axis, return the (normalized) curvature fraction. */\r\n public fractionToCurvatureFraction(u: number): number {\r\n const a = Math.PI;\r\n return 0.5 * (1 - Math.cos(u * a));\r\n }\r\n /** Return the derivative of the (normalized) curvature fraction */\r\n public fractionToCurvatureFractionDerivative(u: number): number {\r\n const a = Math.PI;\r\n return 0.5 * a * Math.sin(u * a);\r\n }\r\n /** Return the integrated area under the curve.\r\n * * This fraction is the angular change fraction.\r\n */\r\n public fractionToArea(u: number): number {\r\n const a = Math.PI;\r\n return 0.5 * u - 0.5 * Math.sin(u * a) / a;\r\n }\r\n}\r\n"]}
|
|
1
|
+
{"version":3,"file":"NormalizedTransition.js","sourceRoot":"","sources":["../../../../src/curve/spiral/NormalizedTransition.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAE/F;;GAEG;AACH;;;;;;;;;;;;GAYG;AACH,MAAM,OAAgB,oBAAoB;IACxC,iHAAiH;IACjH,gBAAgB,CAAC;IAST,MAAM,CAAC,kBAAkB,CAAgC;IACzD,MAAM,CAAC,qBAAqB,CAAmC;IAC/D,MAAM,CAAC,eAAe,CAA6B;IACnD,MAAM,CAAC,cAAc,CAA4B;IACjD,MAAM,CAAC,gBAAgB,CAA8B;IAE7D;;;;;;;;;;;OAWG;IACI,MAAM,CAAC,aAAa,CAAC,IAAY;QACtC,IAAI,IAAI,KAAK,UAAU;YACrB,OAAO,IAAI,CAAC,kBAAkB,CAAC,CAAC,CAAC,IAAI,CAAC,kBAAkB,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,kBAAkB,GAAG,IAAI,4BAA4B,EAAE,CAAC,CAAC;QAC5H,IAAI,IAAI,KAAK,OAAO;YAClB,OAAO,IAAI,CAAC,eAAe,CAAC,CAAC,CAAC,IAAI,CAAC,eAAe,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,eAAe,GAAG,IAAI,yBAAyB,EAAE,CAAC,CAAC;QAChH,IAAI,IAAI,KAAK,aAAa;YACxB,OAAO,IAAI,CAAC,qBAAqB,CAAC,CAAC,CAAC,IAAI,CAAC,qBAAqB,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,qBAAqB,GAAG,IAAI,+BAA+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,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC;IACnC,CAAC;IACD;;OAEG;IACI,cAAc,CAAC,CAAS;QAC7B,MAAM,CAAC,GAAG,IAAI,CAAC,EAAE,CAAC;QAClB,OAAO,GAAG,GAAG,CAAC,GAAG,GAAG,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC;IAC7C,CAAC;CACF","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n\n/** @packageDocumentation\n * @module Curve\n */\n/**\n * NormalizedTransition is the (abstract) base class for clothoid, bloss, biquadratic, sine, and cosine transition functions.\n * * Each function maps fractional progress to a curvature value.\n * * f(0) === 0\n * * f(1) === 1\n * * f(u) === 1 - f (1-u)\n * * Each implementation provides:\n * * fractionToCurvature -- the f(u) function described above\n * * fractionToCurvatureDerivative -- df(u)/du\n * * fractionToArea -- integral of the area under f(u) from 0 to u.\n * * the symmetry condition ensures that the integral from 0 to 1 is 1/2\n * @internal\n */\nexport abstract class NormalizedTransition {\n /** Constructor initializes with 0..1 values .. call \"setBearingCurvatureLengthCurvature\" to apply real values */\n constructor() { }\n /** At fractional position on the x axis, return the (normalized) curvature fraction. */\n public abstract fractionToCurvatureFraction(fractionX: number): number;\n /** Return the derivative of the (normalized) curvature fraction */\n public abstract fractionToCurvatureFractionDerivative(fractionX: number): number;\n /** Return the integrated area under the curve\n * * This is equal to the accumulated angle change.\n */\n public abstract fractionToArea(fractionX: number): number;\n private static _clothoidEvaluator?: NormalizedClothoidTransition;\n private static _biquadraticEvaluator?: NormalizedBiQuadraticTransition;\n private static _blossEvaluator?: NormalizedBlossTransition;\n private static _sineEvaluator?: NormalizedSineTransition;\n private static _cosineEvaluator?: NormalizedCosineTransition;\n\n /**\n * Return a standard evaluator identified by string as:\n * * clothoid\n * * bloss\n * * biquadratic\n * * sine\n * * cosine\n * Each of these types\n * * is instantiated (only once) as a single static object within the NormalizedTransition class.\n * * has no instance data or mutator methods.\n * @param name string name of the transition.\n */\n public static findEvaluator(name: string): NormalizedTransition | undefined {\n if (name === \"clothoid\")\n return this._clothoidEvaluator ? this._clothoidEvaluator : (this._clothoidEvaluator = new NormalizedClothoidTransition());\n if (name === \"bloss\")\n return this._blossEvaluator ? this._blossEvaluator : (this._blossEvaluator = new NormalizedBlossTransition());\n if (name === \"biquadratic\")\n return this._biquadraticEvaluator ? this._biquadraticEvaluator : (this._biquadraticEvaluator = new NormalizedBiQuadraticTransition());\n if (name === \"sine\")\n return this._sineEvaluator ? this._sineEvaluator : (this._sineEvaluator = new NormalizedSineTransition());\n if (name === \"cosine\")\n return this._cosineEvaluator ? this._cosineEvaluator : (this._cosineEvaluator = new NormalizedCosineTransition());\n return undefined;\n }\n}\n/**\n * Transition functions for clothoid spiral.\n * * curvature variation is linear from (0,0) to (1,1)\n * @internal\n */\nexport class NormalizedClothoidTransition extends NormalizedTransition {\n constructor() { super(); }\n /** At fractional position on the x axis, return the (normalized) curvature fraction. */\n public fractionToCurvatureFraction(fractionX: number): number { return fractionX; }\n /** Return the derivative of the (normalized) curvature fraction */\n public fractionToCurvatureFractionDerivative(_u: number): number { return 1.0; }\n /** Return the integrated area under the curve.\n * * This fraction is the angular change fraction.\n */\n public fractionToArea(fractionX: number): number {\n return fractionX * fractionX * 0.5;\n }\n}\n\n/**\n * Transition functions for bloss spiral.\n * * curvature variation is cubic from (0,0) with slope 0 to (1,1) with slope 1\n * @internal\n */\nexport class NormalizedBlossTransition extends NormalizedTransition {\n // bloss curve is (3 - 2x) x ^2 = 3 x^2 - 2 x^3\n // derivative 6x (1-x)\n // 2nd derivative 6 - 12 x\n // derivatives zero at 0,1\n // inflection zero at 0.5\n // integral is x^3 - x^4 / 2 = x^3 ( 1-x/2)\n constructor() { super(); }\n /** At fractional position on the x axis, return the (normalized) curvature fraction. */\n public fractionToCurvatureFraction(u: number): number { return u * u * (3 - 2 * u); }\n /** Return the derivative of the (normalized) curvature fraction */\n public fractionToCurvatureFractionDerivative(u: number): number {\n return 6.0 * u * (1.0 - u);\n }\n /** Return the integrated area under the curve.\n * * This fraction is the angular change fraction.\n */\n public fractionToArea(u: number): number {\n return u * u * u * (1 - 0.5 * u);\n }\n}\n\n/**\n * Transition functions for biquadratic transition\n * * Curvature is a pair of joining quadratics.\n * * In lower half of the interval, the quadratic is from (0,0) to (0.5, 0.5) with zero slope at origin\n * * In upper half of the interval, the quadratic is from (0.5,0.5) to (1,1) with zero slope at 1\n * @internal\n */\nexport class NormalizedBiQuadraticTransition extends NormalizedTransition {\n constructor() { super(); }\n private integratedBasis(u: number): number { return u * u * u * (2.0 / 3.0); }\n private basis(u: number): number { return 2 * u * u; }\n private basisDerivative(u: number): number { return 4 * u; }\n /** At fractional position on the x axis, return the (normalized) curvature fraction.\n * * * For [u <= 0.5, u >= 0.5]\n * * f(u) = [2 u^2, 1 - 2 (1-u)^2]\n * * f'(u) = [4 u, 4 (1-u)]\n * * If(u) = [2 u^3 / 3, 0.5 (1 -u )^3/3]\n */\n public fractionToCurvatureFraction(u: number): number {\n return u <= 0.5 ? this.basis(u) : 1.0 - this.basis(1.0 - u);\n }\n /** Return the derivative of the (normalized) curvature fraction */\n public fractionToCurvatureFractionDerivative(u: number): number {\n return u < 0.5 ? this.basisDerivative(u) : this.basisDerivative(1 - u);\n }\n /** Return the integrated area under the curve.\n * * This fraction is the angular change fraction.\n */\n public fractionToArea(u: number): number {\n if (u <= 0.5)\n return this.integratedBasis(u);\n const v = 1 - u;\n return 0.5 - v + this.integratedBasis(v);\n }\n}\n\n/**\n * Transition functions for sine transition\n * * curvature variation is the sum of\n * * straight line from (0,0) to (1,1), like clothoid\n * * additional full period of a sine wave, producing 0 slope at both ends\n * @internal\n */\nexport class NormalizedSineTransition extends NormalizedTransition {\n constructor() { super(); }\n /** At fractional position on the x axis, return the (normalized) curvature fraction. */\n public fractionToCurvatureFraction(u: number): number {\n const a = 2.0 * Math.PI;\n return u - Math.sin(u * a) / a;\n }\n /** Return the derivative of the (normalized) curvature fraction */\n public fractionToCurvatureFractionDerivative(u: number): number {\n const a = 2.0 * Math.PI;\n return 1 - Math.cos(u * a);\n }\n /** Return the integrated area under the curve.\n * * This fraction is the angular change fraction.\n */\n public fractionToArea(u: number): number {\n const a = 2.0 * Math.PI;\n return 0.5 * u * u + (Math.cos(u * a) - 1.0) / (a * a);\n }\n}\n/**\n * Transition functions for cosine\n * * curvature variation is a half period of a cosine\n * @internal\n */\nexport class NormalizedCosineTransition extends NormalizedTransition {\n constructor() { super(); }\n /** At fractional position on the x axis, return the (normalized) curvature fraction. */\n public fractionToCurvatureFraction(u: number): number {\n const a = Math.PI;\n return 0.5 * (1 - Math.cos(u * a));\n }\n /** Return the derivative of the (normalized) curvature fraction */\n public fractionToCurvatureFractionDerivative(u: number): number {\n const a = Math.PI;\n return 0.5 * a * Math.sin(u * a);\n }\n /** Return the integrated area under the curve.\n * * This fraction is the angular change fraction.\n */\n public fractionToArea(u: number): number {\n const a = Math.PI;\n return 0.5 * u - 0.5 * Math.sin(u * a) / a;\n }\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PolishCubicSpiralEvaluator.js","sourceRoot":"","sources":["../../../../src/curve/spiral/PolishCubicSpiralEvaluator.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAE/F;;GAEG;AACH,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAC1C,OAAO,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AACrD,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD;;;;;;;;;;;;;GAaG;AACH,MAAM,OAAO,oBAAqB,SAAQ,cAAc;IAC/C,cAAc,CAAS;IACvB,cAAc,CAAS;IAE9B,uEAAuE;IACvE,YAAoB,OAAe,EAAE,OAAe,EAAE,UAAkB,EAAE,MAAc;QACtF,K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AG,CAAC,CAAC;QACpB,sBAAsB;QACtB,sDAAsD;QACtD,mDAAmD;QACnD,aAAa;QACb,qBAAqB;QACrB,sBAAsB;QACtB,0BAA0B;QAC1B,MAAM,EAAE,GAAG,CAAC,GAAG,GAAG,GAAG,GAAG,CAAC,GAAG,GAAG,GAAG,GAAG,CAAC,CAAC,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,CAAC,GAAG,GAAG,IAAI,GAAG,GAAG,GAAG,GAAG,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;QAC7F,OAAO,EAAE,CAAC;IACZ,CAAC;IAED,kDAAkD;IAC3C,MAAM,CAAC,2BAA2B,CAAC,CAAS,EAAE,OAAe,EAAE,OAAe;QACnF,MAAM,IAAI,GAAG,YAAY,CAAC,WAAW,CAAC,CAAC,EACrC,CAAC,CAAS,EAAE,EAAE,CAAC,CAAC,IAAI,CAAC,sBAAsB,CAAC,CAAC,EAAE,OAAO,EAAE,OAAO,CAAC,GAAG,CAAC,CAAC,EACrE,CAAC,CAAS,EAAE,EAAE,CAAC,IAAI,CAAC,gCAAgC,CAAC,CAAC,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC,CAAC;QAC7E,OAAO,IAAI,CAAC;IACd,CAAC;CACF","sourcesContent":["/*---------------------------------------------------------------------------------------------\
|
|
1
|
+
{"version":3,"file":"PolishCubicSpiralEvaluator.js","sourceRoot":"","sources":["../../../../src/curve/spiral/PolishCubicSpiralEvaluator.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAE/F;;GAEG;AACH,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAC1C,OAAO,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AACrD,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD;;;;;;;;;;;;;GAaG;AACH,MAAM,OAAO,oBAAqB,SAAQ,cAAc;IAC/C,cAAc,CAAS;IACvB,cAAc,CAAS;IAE9B,uEAAuE;IAC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AAG,GAAG,GAAG,CAAC,CAAC;QACpB,MAAM,GAAG,GAAG,GAAG,GAAG,CAAC,CAAC;QACpB,sBAAsB;QACtB,sDAAsD;QACtD,mDAAmD;QACnD,aAAa;QACb,qBAAqB;QACrB,sBAAsB;QACtB,0BAA0B;QAC1B,MAAM,EAAE,GAAG,CAAC,GAAG,GAAG,GAAG,GAAG,CAAC,GAAG,GAAG,GAAG,GAAG,CAAC,CAAC,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,CAAC,GAAG,GAAG,IAAI,GAAG,GAAG,GAAG,GAAG,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;QAC7F,OAAO,EAAE,CAAC;IACZ,CAAC;IAED,kDAAkD;IAC3C,MAAM,CAAC,2BAA2B,CAAC,CAAS,EAAE,OAAe,EAAE,OAAe;QACnF,MAAM,IAAI,GAAG,YAAY,CAAC,WAAW,CAAC,CAAC,EACrC,CAAC,CAAS,EAAE,EAAE,CAAC,CAAC,IAAI,CAAC,sBAAsB,CAAC,CAAC,EAAE,OAAO,EAAE,OAAO,CAAC,GAAG,CAAC,CAAC,EACrE,CAAC,CAAS,EAAE,EAAE,CAAC,IAAI,CAAC,gCAAgC,CAAC,CAAC,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC,CAAC;QAC7E,OAAO,IAAI,CAAC;IACd,CAAC;CACF","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n\n/** @packageDocumentation\n * @module Curve\n */\nimport { Geometry } from \"../../Geometry\";\nimport { SimpleNewton } from \"../../numerics/Newton\";\nimport { CubicEvaluator } from \"./CubicEvaluator\";\n/**\n * Polish Cubic.\n * * Construction takes nominal length and end radius.\n * curve is is y= m*x^3 with\n * * x any point on the x axis\n * * m is (1/6RL)\n * * Lx = x length is along the axis, determined by inversion of a distance series at nominal length\n * *\n * @param localToWorld\n * @param nominalL1\n * @param nominalR1\n * @param activeInterval\n * @internal\n */\nexport class PolishCubicEvaluator extends CubicEvaluator {\n public nominalLength1: number;\n public nominalRadius1: number;\n\n /** Constructor is private. Caller responsible for cubicM validity. */\n private constructor(length1: number, radius1: number, axisLength: number, cubicM: number) {\n super(axisLength, cubicM);\n this.nominalLength1 = length1;\n this.nominalRadius1 = radius1;\n }\n\n /** Compute the czech cubic constant. */\n public static computeCubicM(length1: number, radius1: number): number {\n return 1.0 / (6.0 * length1 * radius1);\n }\n\n public static create(length1: number, radius1: number): PolishCubicEvaluator | undefined {\n const m = this.computeCubicM(length1, radius1);\n if (m === undefined)\n return undefined;\n const xMax = PolishCubicEvaluator.approximateDistanceAlongToX(length1, radius1, length1);\n if (xMax === undefined)\n return undefined;\n return new PolishCubicEvaluator(length1, radius1, xMax, m);\n }\n\n public override scaleInPlace(scaleFactor: number) {\n this.nominalLength1 *= scaleFactor;\n this.nominalRadius1 *= scaleFactor;\n super.scaleInPlace(scaleFactor);\n }\n /** return a deep copy of the evaluator */\n public clone(): PolishCubicEvaluator { return new PolishCubicEvaluator(this.nominalLength1, this.nominalRadius1, this.axisLength, this.cubicM); }\n /** Member by member matchup ... */\n public isAlmostEqual(other: any): boolean {\n if (other instanceof PolishCubicEvaluator) {\n return Geometry.isSameCoordinate(this.nominalLength1, other.nominalLength1)\n && Geometry.isSameCoordinate(this.nominalRadius1, other.nominalRadius1);\n }\n return false;\n }\n\n /** Compute the coefficient of x^4 in the x-to-distance series expansion */\n public static computeX4SeriesCoefficient(length1: number, radius1: number): number {\n return 1.0 / (4.0 * length1 * length1 * radius1 * radius1);\n }\n /**\n * Evaluate a series approximation of distance along the true curve.\n * @param x distance along x axis\n * @param radius1 nominal end radius\n * @param length1 nominal length along curve\n * @returns\n */\n public static xToApproximateDistance(x: number, radius1: number, length1: number): number {\n // C31 * ( 1 + 1 / 10 * E31 - 1 / 72 * E31^2 + 1 / 208 * E31^3 - 5 / 2176 * E31^4 )\n const a4 = this.computeX4SeriesCoefficient(length1, radius1);\n const ax2 = a4 * x * x;\n const ax3 = ax2 * x;\n const ax4 = ax3 * x;\n const s0 = x * (1.0 + ax4 * (0.1 + ax4 * (-1.0 / 72.0 + ax4 * (1.0 / 208.0 - 5.0 * ax4 / 2176.0))));\n return s0;\n }\n\n /**\n * Evaluate the derivative of the x-to-distance series.\n * @param x distance along x axis\n * @param radius1 nominal end radius\n * @param length1 nominal length along curve\n * @returns\n */\n public static xToApproximateDistanceDerivative(x: number, radius1: number, length1: number): number {\n // C31 * ( 1 + 1 / 10 * E31 - 1 / 72 * E31^2 + 1 / 208 * E31^3 - 5 / 2176 * E31^4 )\n const a4 = this.computeX4SeriesCoefficient(length1, radius1);\n const ax2 = a4 * x * x;\n const ax3 = ax2 * x;\n const ax4 = ax3 * x;\n // derivative notes ..\n // take away leading x -- this reduces each power by 1\n // multiply each coefficient by its original power:\n // 0.1==>0.5\n // 1/72==> 9/72 = 1/8\n // 1/208==>13/208=1/16\n // 1/2176==>17/2176= 1/128\n const ds = (1.0 + ax4 * (0.5 + ax4 * (-1.0 / 8.0 + ax4 * (1.0 / 16.0 - 5.0 * ax4 / 128.0))));\n return ds;\n }\n\n /** Invert the xToApproximateDistance function. */\n public static approximateDistanceAlongToX(s: number, radius1: number, length1: number): number | undefined {\n const root = SimpleNewton.runNewton1D(s,\n (x: number) => (this.xToApproximateDistance(x, radius1, length1) - s),\n (x: number) => this.xToApproximateDistanceDerivative(x, radius1, length1));\n return root;\n }\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TransitionConditionalProperties.js","sourceRoot":"","sources":["../../../../src/curve/spiral/TransitionConditionalProperties.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAE/F;;GAEG;AACH,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAC1C,OAAO,EAAE,KAAK,EAAE,MAAM,wBAAwB,CAAC;AAC/C,OAAO,EAAE,kBAAkB,EAAE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,CAAC,WAAW,EAAE,KAAK,CAAC,WAAW,CAAC;YAClE,OAAO,KAAK,CAAC;QACf,OAAO,IAAI,CAAC;IACd,CAAC;IACD,qDAAqD;IAC9C,gBAAgB,CAAC,CAAS;QAC/B,IAAI,IAAI,CAAC,OAAO,KAAK,SAAS;YAC5B,IAAI,CAAC,OAAO,IAAI,CAAC,CAAC;QACpB,IAAI,IAAI,CAAC,OAAO,KAAK,SAAS;YAC5B,IAAI,CAAC,OAAO,IAAI,CAAC,CAAC;QACpB,IAAI,IAAI,CAAC,WAAW,KAAK,SAAS;YAChC,IAAI,CAAC,WAAW,IAAI,CAAC,CAAC;IAC1B,CAAC;IACM,MAAM,CAAC,cAAc,CAAC,CAA8C,EAAE,CAA8C;QACzH,IAAI,CAAC,KAAK,SAAS;YACjB,OAAO,CAAC,KAAK,SAAS,CAAC;QACzB,OAAO,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC;IAC5B,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 { Angle } from \"../../geometry3d/Angle\";\r\nimport { TransitionSpiral3d } from \"./TransitionSpiral3d\";\r\n// import {} from \"./\";\r\n/** A true transition spiral is a curve defined by its curvature, with the curvature function symmetric about midpoint.\r\n * * The symmetry condition creates a relationship among the following 4 quantities:\r\n * ** curvature0 = curvature (i.e. 1/radius) at start\r\n * ** curvature1 = curvature (i.e. 1/radius) at end\r\n * ** sweepRadians = signed turning angle from start to end\r\n * ** arcLength = length of curve\r\n * * The relationship is the equation\r\n * ** `sweepRadians = arcLength * average Curvature = arcLength * 0.5 * (curvature0 + curvature1)`\r\n * * That is, regardless of any curvature properties other than symmetry, specifying any 3 of the quantities fully determines the remaining one.\r\n * @public\r\n */\r\nexport class TransitionConditionalProperties {\r\n /** radius (or 0 at start) */\r\n public radius0: number | undefined;\r\n /** radius (or 0) at end */\r\n public radius1: number | undefined;\r\n /** bearing at start, measured from x towards y */\r\n public bearing0: Angle | undefined;\r\n /** bearing at end, measured from x towards y */\r\n public bearing1: Angle | undefined;\r\n /** curve length */\r\n public curveLength: number | undefined;\r\n /**\r\n * capture numeric or undefined values\r\n * @param radius0 start radius or undefined\r\n * @param radius1 end radius or undefined\r\n * @param bearing0 start bearing or undefined\r\n * @param bearing1 end bearing or undefined\r\n * @param arcLength arc length or undefined\r\n */\r\n public constructor(\r\n radius0: number | undefined,\r\n radius1: number | undefined,\r\n bearing0: Angle | undefined,\r\n bearing1: Angle | undefined,\r\n arcLength: number | undefined) {\r\n this.radius0 = radius0;\r\n this.radius1 = radius1;\r\n this.bearing0 = bearing0;\r\n this.bearing1 = bearing1;\r\n this.curveLength = arcLength;\r\n }\r\n /** return the number of defined values among the 5 properties. */\r\n public numDefinedProperties() {\r\n return Geometry.defined01(this.radius0)\r\n + Geometry.defined01(this.radius1)\r\n + Geometry.defined01(this.bearing0)\r\n + Geometry.defined01(this.bearing1)\r\n + Geometry.defined01(this.curveLength);\r\n }\r\n /** clone with all properties (i.e. preserve undefined states) */\r\n public clone(): TransitionConditionalProperties {\r\n return new TransitionConditionalProperties(\r\n this.radius0,\r\n this.radius1,\r\n this.bearing0 === undefined ? undefined : this.bearing0.clone(),\r\n this.bearing1 === undefined ? undefined : this.bearing1.clone(),\r\n this.curveLength);\r\n }\r\n /** Return true if all components are defined and agree equationally. */\r\n public getIsValidCompleteSet() {\r\n if (this.curveLength !== undefined && this.bearing0 !== undefined && this.bearing1 !== undefined\r\n && this.radius0 !== undefined && this.radius1 !== undefined) {\r\n const length1 = TransitionSpiral3d.radiusRadiusSweepRadiansToArcLength(this.radius0, this.radius1,\r\n this.bearing1.radians - this.bearing0.radians);\r\n return Geometry.isSameCoordinate(this.curveLength, length1);\r\n }\r\n return false;\r\n }\r\n /** Examine which properties are defined and compute the (single) undefined.\r\n * @returns Return true if the input state had precisely one undefined member.\r\n */\r\n public tryResolveAnySingleUnknown(): boolean {\r\n if (this.getIsValidCompleteSet())\r\n return true;\r\n if (this.bearing0 && this.bearing1) {\r\n const sweepRadians = this.bearing1.radians - this.bearing0.radians;\r\n if (this.curveLength === undefined && this.radius0 !== undefined && this.radius1 !== undefined) {\r\n this.curveLength = TransitionSpiral3d.radiusRadiusSweepRadiansToArcLength(this.radius0, this.radius1, sweepRadians);\r\n return true;\r\n }\r\n if (this.curveLength !== undefined && this.radius0 === undefined && this.radius1 !== undefined) {\r\n this.radius0 = TransitionSpiral3d.radius1LengthSweepRadiansToRadius0(this.radius1, this.curveLength, sweepRadians);\r\n return true;\r\n }\r\n if (this.curveLength !== undefined && this.radius0 !== undefined && this.radius1 === undefined) {\r\n this.radius1 = TransitionSpiral3d.radius0LengthSweepRadiansToRadius1(this.radius0, this.curveLength, sweepRadians);\r\n return true;\r\n }\r\n return false;\r\n }\r\n // at least one bearing is undefined ...\r\n if (this.curveLength === undefined || this.radius0 === undefined || this.radius1 === undefined)\r\n return false;\r\n\r\n if (this.bearing0) { // bearing 1 is undefined\r\n this.bearing1 = Angle.createRadians(this.bearing0.radians + TransitionSpiral3d.radiusRadiusLengthToSweepRadians(this.radius0, this.radius1, this.curveLength));\r\n return true;\r\n }\r\n\r\n if (this.bearing1) { // bearing 0 is undefined\r\n this.bearing0 = Angle.createRadians(this.bearing1.radians - TransitionSpiral3d.radiusRadiusLengthToSweepRadians(this.radius0, this.radius1, this.curveLength));\r\n return true;\r\n }\r\n return false;\r\n }\r\n private almostEqualCoordinate(a: number | undefined, b: number | undefined): boolean {\r\n if (a === undefined && b === undefined)\r\n return true;\r\n if (a !== undefined && b !== undefined)\r\n return Geometry.isSameCoordinate(a, b);\r\n return false;\r\n }\r\n private almostEqualBearing(a: Angle | undefined, b: Angle | undefined): boolean {\r\n if (a === undefined && b === undefined)\r\n return true;\r\n if (a !== undefined && b !== undefined)\r\n return a.isAlmostEqualNoPeriodShift(b);\r\n return false;\r\n }\r\n\r\n /**\r\n * Test if this and other have matching numeric and undefined members.\r\n */\r\n\r\n public isAlmostEqual(other?: TransitionConditionalProperties) {\r\n if (!other)\r\n return false;\r\n if (!this.almostEqualCoordinate(this.radius0, other.radius0))\r\n return false;\r\n if (!this.almostEqualCoordinate(this.radius1, other.radius1))\r\n return false;\r\n if (!this.almostEqualBearing(this.bearing0, other.bearing0))\r\n return false;\r\n if (!this.almostEqualBearing(this.bearing1, other.bearing1))\r\n return false;\r\n if (!this.almostEqualCoordinate(this.curveLength, other.curveLength))\r\n return false;\r\n return true;\r\n }\r\n /** Apply a NONZERO scale factor to all distances. */\r\n public applyScaleFactor(a: number) {\r\n if (this.radius0 !== undefined)\r\n this.radius0 *= a;\r\n if (this.radius1 !== undefined)\r\n this.radius1 *= a;\r\n if (this.curveLength !== undefined)\r\n this.curveLength *= a;\r\n }\r\n public static areAlmostEqual(a: TransitionConditionalProperties | undefined, b: TransitionConditionalProperties | undefined): boolean {\r\n if (a === undefined)\r\n return b === undefined;\r\n return a.isAlmostEqual(b);\r\n }\r\n}\r\n"]}
|
|
1
|
+
{"version":3,"file":"TransitionConditionalProperties.js","sourceRoot":"","sources":["../../../../src/curve/spiral/TransitionConditionalProperties.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAE/F;;GAEG;AACH,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAC1C,OAAO,EAAE,KAAK,EAAE,MAAM,wBAAwB,CAAC;AAC/C,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAC1D,uBAAuB;AACvB;;;;;;;;;;GAUG;AACH,MAAM,OAAO,+BAA+B;IAC1C,6BAA6B;IACtB,OAAO,CAAqB;IACnC,2BAA2B;IACpB,OAAO,CAAqB;IACnC,kDAAkD;IAC3C,QAAQ,CAAoB;IACnC,gDAAgD;IACzC,QAAQ,CAAoB;IACn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QACpB,IAAI,IAAI,CAAC,OAAO,KAAK,SAAS;YAC5B,IAAI,CAAC,OAAO,IAAI,CAAC,CAAC;QACpB,IAAI,IAAI,CAAC,WAAW,KAAK,SAAS;YAChC,IAAI,CAAC,WAAW,IAAI,CAAC,CAAC;IAC1B,CAAC;IACM,MAAM,CAAC,cAAc,CAAC,CAA8C,EAAE,CAA8C;QACzH,IAAI,CAAC,KAAK,SAAS;YACjB,OAAO,CAAC,KAAK,SAAS,CAAC;QACzB,OAAO,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC;IAC5B,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 { Angle } from \"../../geometry3d/Angle\";\nimport { TransitionSpiral3d } from \"./TransitionSpiral3d\";\n// import {} from \"./\";\n/** A true transition spiral is a curve defined by its curvature, with the curvature function symmetric about midpoint.\n * * The symmetry condition creates a relationship among the following 4 quantities:\n * ** curvature0 = curvature (i.e. 1/radius) at start\n * ** curvature1 = curvature (i.e. 1/radius) at end\n * ** sweepRadians = signed turning angle from start to end\n * ** arcLength = length of curve\n * * The relationship is the equation\n * ** `sweepRadians = arcLength * average Curvature = arcLength * 0.5 * (curvature0 + curvature1)`\n * * That is, regardless of any curvature properties other than symmetry, specifying any 3 of the quantities fully determines the remaining one.\n * @public\n */\nexport class TransitionConditionalProperties {\n /** radius (or 0 at start) */\n public radius0: number | undefined;\n /** radius (or 0) at end */\n public radius1: number | undefined;\n /** bearing at start, measured from x towards y */\n public bearing0: Angle | undefined;\n /** bearing at end, measured from x towards y */\n public bearing1: Angle | undefined;\n /** curve length */\n public curveLength: number | undefined;\n /**\n * capture numeric or undefined values\n * @param radius0 start radius or undefined\n * @param radius1 end radius or undefined\n * @param bearing0 start bearing or undefined\n * @param bearing1 end bearing or undefined\n * @param arcLength arc length or undefined\n */\n public constructor(\n radius0: number | undefined,\n radius1: number | undefined,\n bearing0: Angle | undefined,\n bearing1: Angle | undefined,\n arcLength: number | undefined) {\n this.radius0 = radius0;\n this.radius1 = radius1;\n this.bearing0 = bearing0;\n this.bearing1 = bearing1;\n this.curveLength = arcLength;\n }\n /** return the number of defined values among the 5 properties. */\n public numDefinedProperties() {\n return Geometry.defined01(this.radius0)\n + Geometry.defined01(this.radius1)\n + Geometry.defined01(this.bearing0)\n + Geometry.defined01(this.bearing1)\n + Geometry.defined01(this.curveLength);\n }\n /** clone with all properties (i.e. preserve undefined states) */\n public clone(): TransitionConditionalProperties {\n return new TransitionConditionalProperties(\n this.radius0,\n this.radius1,\n this.bearing0 === undefined ? undefined : this.bearing0.clone(),\n this.bearing1 === undefined ? undefined : this.bearing1.clone(),\n this.curveLength);\n }\n /** Return true if all components are defined and agree equationally. */\n public getIsValidCompleteSet() {\n if (this.curveLength !== undefined && this.bearing0 !== undefined && this.bearing1 !== undefined\n && this.radius0 !== undefined && this.radius1 !== undefined) {\n const length1 = TransitionSpiral3d.radiusRadiusSweepRadiansToArcLength(this.radius0, this.radius1,\n this.bearing1.radians - this.bearing0.radians);\n return Geometry.isSameCoordinate(this.curveLength, length1);\n }\n return false;\n }\n /** Examine which properties are defined and compute the (single) undefined.\n * @returns Return true if the input state had precisely one undefined member.\n */\n public tryResolveAnySingleUnknown(): boolean {\n if (this.getIsValidCompleteSet())\n return true;\n if (this.bearing0 && this.bearing1) {\n const sweepRadians = this.bearing1.radians - this.bearing0.radians;\n if (this.curveLength === undefined && this.radius0 !== undefined && this.radius1 !== undefined) {\n this.curveLength = TransitionSpiral3d.radiusRadiusSweepRadiansToArcLength(this.radius0, this.radius1, sweepRadians);\n return true;\n }\n if (this.curveLength !== undefined && this.radius0 === undefined && this.radius1 !== undefined) {\n this.radius0 = TransitionSpiral3d.radius1LengthSweepRadiansToRadius0(this.radius1, this.curveLength, sweepRadians);\n return true;\n }\n if (this.curveLength !== undefined && this.radius0 !== undefined && this.radius1 === undefined) {\n this.radius1 = TransitionSpiral3d.radius0LengthSweepRadiansToRadius1(this.radius0, this.curveLength, sweepRadians);\n return true;\n }\n return false;\n }\n // at least one bearing is undefined ...\n if (this.curveLength === undefined || this.radius0 === undefined || this.radius1 === undefined)\n return false;\n\n if (this.bearing0) { // bearing 1 is undefined\n this.bearing1 = Angle.createRadians(this.bearing0.radians + TransitionSpiral3d.radiusRadiusLengthToSweepRadians(this.radius0, this.radius1, this.curveLength));\n return true;\n }\n\n if (this.bearing1) { // bearing 0 is undefined\n this.bearing0 = Angle.createRadians(this.bearing1.radians - TransitionSpiral3d.radiusRadiusLengthToSweepRadians(this.radius0, this.radius1, this.curveLength));\n return true;\n }\n return false;\n }\n private almostEqualCoordinate(a: number | undefined, b: number | undefined): boolean {\n if (a === undefined && b === undefined)\n return true;\n if (a !== undefined && b !== undefined)\n return Geometry.isSameCoordinate(a, b);\n return false;\n }\n private almostEqualBearing(a: Angle | undefined, b: Angle | undefined): boolean {\n if (a === undefined && b === undefined)\n return true;\n if (a !== undefined && b !== undefined)\n return a.isAlmostEqualNoPeriodShift(b);\n return false;\n }\n\n /**\n * Test if this and other have matching numeric and undefined members.\n */\n\n public isAlmostEqual(other?: TransitionConditionalProperties) {\n if (!other)\n return false;\n if (!this.almostEqualCoordinate(this.radius0, other.radius0))\n return false;\n if (!this.almostEqualCoordinate(this.radius1, other.radius1))\n return false;\n if (!this.almostEqualBearing(this.bearing0, other.bearing0))\n return false;\n if (!this.almostEqualBearing(this.bearing1, other.bearing1))\n return false;\n if (!this.almostEqualCoordinate(this.curveLength, other.curveLength))\n return false;\n return true;\n }\n /** Apply a NONZERO scale factor to all distances. */\n public applyScaleFactor(a: number) {\n if (this.radius0 !== undefined)\n this.radius0 *= a;\n if (this.radius1 !== undefined)\n this.radius1 *= a;\n if (this.curveLength !== undefined)\n this.curveLength *= a;\n }\n public static areAlmostEqual(a: TransitionConditionalProperties | undefined, b: TransitionConditionalProperties | undefined): boolean {\n if (a === undefined)\n return b === undefined;\n return a.isAlmostEqual(b);\n }\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TransitionSpiral3d.js","sourceRoot":"","sources":["../../../../src/curve/spiral/TransitionSpiral3d.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAE/F;;GAEG;AAEH,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAE1C,OAAO,EAAW,OAAO,EAAE,MAAM,wBAAwB,CAAC;AAC1D,OAAO,EAAE,SAAS,EAAE,MAAM,4BAA4B,CAAC;AACvD,OAAO,EAAE,SAAS,EAAE,MAAM,4BAA4B,CAAC;AACvD,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AACnD,OAAO,EAAE,oBAAoB,EAAE,MAAM,0CAA0C,CAAC;AAChF,OAAO,EAAE,yBAAyB,EAAE,MAAM,+CAA+C,CAAC;AAE1F,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAuCjD;;;;;;;;;;;;GAYG;AACH,MAAM,OAAgB,kBAAmB,SAAQ,cAAc;IAC7D,iCAAiC;IACvB,WAAW,CAAS;IAC9B,oCAAoC;IAC1B,iBAAiB,CAA8C;IAEzE;;OAEG;IACO,uBAAuB,CAAY;IAC7C,wEAAwE;IACxE,IAAW,sBAAsB,KAAgB,OAAO,IAAI,CAAC,uBAAuB,CAAC,CAAC,CAAC;IAGvF,0BAA0B;IAChB,aAAa,CAAY;IACnC,0CAA0C;IAC1C,IAAW,YAAY,KAAgB,OAAO,IAAI,CAAC,aAAa,CAAC,CAAC,CAAC;IAEnE,YAAsB,UAA8B,EAAE,YAAuB,EAAE,sBAA6C,EAAE,gBAA6D;QACzL,KAAK,EAAE,CAAC;QACR,IAAI,CAAC,WAAW,GAAG,UAAU,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,mBAAmB,CAAC;QACj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OAAO,GAAG,IAAI,oBAAoB,CAAC,IAAI,EAAE,OAAO,CAAC,kBAAkB,CAAC,CAAC;QAC3E,IAAI,CAAC,kBAAkB,CAAC,OAAO,EAAE,OAAO,CAAC,aAAa,CAAC,CAAC;QACxD,OAAO,OAAO,CAAC,WAAW,EAAE,CAAC;IAC/B,CAAC;IACD,oDAAoD;IACpC,WAAW,CAAC,aAAsB,EAAE,SAAqB;QACvE,MAAM,OAAO,GAAG,IAAI,CAAC,qBAAqB,CAAE,GAAG,EAAE,GAAG,EAAE,SAAS,CAAC,CAAC;QACjE,aAAa,CAAC,WAAW,CAAE,OAAO,CAAC,CAAC;IACtC,CAAC;IAED;;OAEG;IACc,qBAAqB,CAAC,SAAiB,EAAE,SAAiB,EAAE,SAAqB;QAChG,MAAM,OAAO,GAAG,IAAI,CAAC,aAAa,CAAC;QACnC,IAAI,SAAS,KAAK,OAAO;YACvB,OAAO,OAAO,CAAC,UAAU,EAAG,CAAC;QAC/B,IAAI,KAAK,GAAG,IAAI,CAAC,IAAI,CAAE,OAAO,CAAC,SAAS,EAAE,GAAG,IAAI,CAAC,GAAG,CAAE,SAAS,GAAG,SAAS,CAAC,CAAC,CAAC;QAC/E,KAAK,GAAG,QAAQ,CAAC,KAAK,CAAE,CAAC,EAAE,KAAK,EAAE,EAAE,CAAC,CAAC;QACtC,OAAO,IAAI,CAAC,4BAA4B,CAAE,SAAS,EAAE,SAAS,EAAE,KAAK,EAAE,SAAS,EAAE,GAAG,CAAC,CAAC;IACzF,CAAC;IACD;;;;OAIG;IACa,uBAAuB,CAAC,GAAqB,EAAE,OAAiB;QAC9E,OAAO,yBAAyB,CAAC,kCAAkC,CAAC,IAAI,EAAE,GAAG,EAAE,OAAO,CAAC,CAAC;IAC1F,CAAC;CACF","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n\r\n/** @packageDocumentation\r\n * @module Curve\r\n */\r\n\r\nimport { Geometry } from \"../../Geometry\";\r\nimport { Matrix3d } from \"../../geometry3d/Matrix3d\";\r\nimport { Range1d, Range3d } from \"../../geometry3d/Range\";\r\nimport { Segment1d } from \"../../geometry3d/Segment1d\";\r\nimport { Transform } from \"../../geometry3d/Transform\";\r\nimport { CurvePrimitive } from \"../CurvePrimitive\";\r\nimport { CurveOffsetXYHandler } from \"../internalContexts/CurveOffsetXYHandler\";\r\nimport { PlaneAltitudeRangeContext } from \"../internalContexts/PlaneAltitudeRangeContext\";\r\nimport { LineString3d } from \"../LineString3d\";\r\nimport { OffsetOptions } from \"../OffsetOptions\";\r\nimport { TransitionConditionalProperties } from \"./TransitionConditionalProperties\";\r\n\r\nimport type { Vector3d } from \"../../geometry3d/Point3dVector3d\";\r\nimport type { Ray3d } from \"../../geometry3d/Ray3d\";\r\n\r\n/**\r\n * This is the set of valid type names for \"integrated\" spirals\r\n * * Behavior is expressed by a `NormalizedTransition` snap function.\r\n * * The snap function varies smoothly from f(0)=0 to f(1)=1\r\n * * The various snap functions are:\r\n * * clothoid: linear\r\n * * biquadratic: 2 quadratics pieced together, joining with 1st derivative continuity at f(0.) = 0.5, with zero slope f'(0)=0 and f'(1)= 0\r\n * * bloss: A single cubic with zero slope at 0 and 1\r\n * * cosine: half of a cosine wave, centered around 0.5\r\n * * sine: full period of a sine wave added to the line f(u)=u\r\n * *\r\n * @public\r\n */\r\nexport type IntegratedSpiralTypeName = \"clothoid\" | \"bloss\" | \"biquadratic\" | \"cosine\" | \"sine\";\r\n\r\n/**\r\n * This is the set of valid type names for \"direct\" spirals.\r\n * \"Direct\" spirals can evaluate fractionToPoint by direct equations, i.e. not requiring the numeric integrations in \"Integrated\" spiral types.\r\n * @public\r\n */\r\nexport type DirectSpiralTypeName =\r\n \"JapaneseCubic\" // 1 term from each of the X,Y clothoid series expansions: y = x^3 / (6RL)\r\n | \"Arema\" // 2 terms from each of the X,Y clothoid series expansions. Identical to ChineseCubic!\r\n | \"ChineseCubic\" // Identical to Arema!\r\n | \"HalfCosine\" // high continuity cosine variation from quadratic.\r\n | \"AustralianRailCorp\" // cubic with high accuracy distance series\r\n | \"WesternAustralian\" // simple cubic -- 2 terms of x series, 1 term of y series.\r\n | \"Czech\" // simple cubic with two term distance approximation\r\n | \"MXCubicAlongArc\" // x obtained from fractional distance via 2-terms from series, y = x^3/ (6RL)\r\n | \"Polish\"\r\n | \"Italian\"\r\n ;\r\n\r\n/**\r\n * TransitionSpiral3d is a base class for multiple variants of spirals.\r\n * * The menagerie of spiral types have 2 broad categories:\r\n * * IntegratedSpiral3d -- a spiral whose direct function for curvature versus distance must be integrated to determine x,y\r\n * * The IntegratedSpiral3d types are enumerated in `IntegratedSpiralTypes`\r\n * * DirectSpiral3d -- a spiral implemented with direct calculation of x,y from fractional position along the spiral.\r\n * * The direct spiral types are enumerated in the `DirectSpiralType`\r\n * * The method set for CurvePrimitive support includes a `handleTransitionSpiral(g: TransitionSpiral3d)` which receives all the spiral types.\r\n * * The spiral class may impose expectations that its inflection is at the origin, with tangent along the x axis.\r\n * * This is generally necessary for direct spirals.\r\n * * This is not necessary for integrated spirals.\r\n * @public\r\n */\r\nexport abstract class TransitionSpiral3d extends CurvePrimitive {\r\n /** string name of spiral type */\r\n protected _spiralType: string;\r\n /** Original defining properties. */\r\n protected _designProperties: TransitionConditionalProperties | undefined;\r\n\r\n /** Fractional interval for the \"active\" part of a containing spiral.\r\n * (The radius, angle, and length conditions define a complete spiral, and some portion of it is \"active\")\r\n */\r\n protected _activeFractionInterval: Segment1d;\r\n /** Return (reference to) the active portion of the reference spiral. */\r\n public get activeFractionInterval(): Segment1d { return this._activeFractionInterval; }\r\n /** strokes in the active portion */\r\n public abstract get activeStrokes(): LineString3d;\r\n /** Placement transform */\r\n protected _localToWorld: Transform;\r\n /** (reference to) placement transform. */\r\n public get localToWorld(): Transform { return this._localToWorld; }\r\n\r\n protected constructor(spiralType: string | undefined, localToWorld: Transform, activeFractionInterval: Segment1d | undefined, designProperties: TransitionConditionalProperties | undefined) {\r\n super();\r\n this._spiralType = spiralType ? spiralType : \"unknownSpiralType\";\r\n this._designProperties = designProperties;\r\n this._localToWorld = localToWorld;\r\n this._activeFractionInterval = activeFractionInterval ? activeFractionInterval : Segment1d.create(0, 1);\r\n }\r\n\r\n public get spiralType(): string { return this._spiralType; }\r\n /** Return 1/r with convention that if true zero is given as radius it represents infinite radius (0 curvature, straight line) */\r\n public static radiusToCurvature(radius: number): number { return (radius === 0.0) ? 0.0 : 1.0 / radius; }\r\n\r\n /** Return 1/k with convention that if near-zero is given as curvature, its infinite radius is returned as 0 */\r\n public static curvatureToRadius(curvature: number): number {\r\n if (Math.abs(curvature) < Geometry.smallAngleRadians)\r\n return 0.0;\r\n return 1.0 / curvature;\r\n }\r\n\r\n /** Return a deep clone. */\r\n public abstract override clone(): TransitionSpiral3d;\r\n\r\n /** Recompute strokes */\r\n public abstract refreshComputedProperties(): void;\r\n\r\n /** Return (if possible) a spiral which is a portion of this curve. */\r\n public override clonePartialCurve(fractionA: number, fractionB: number): TransitionSpiral3d {\r\n const spiralB = this.clone();\r\n const globalFractionA = this._activeFractionInterval.fractionToPoint(fractionA);\r\n const globalFractionB = this._activeFractionInterval.fractionToPoint(fractionB);\r\n spiralB._activeFractionInterval.set(globalFractionA, globalFractionB);\r\n spiralB.refreshComputedProperties();\r\n return spiralB;\r\n }\r\n\r\n /** Clone with a transform applied */\r\n public override cloneTransformed(transform: Transform): TransitionSpiral3d {\r\n const result = this.clone();\r\n result.tryTransformInPlace(transform); // ok, we're confident it will always work.\r\n return result;\r\n }\r\n\r\n /** Return the average of the start and end curvatures. */\r\n public static averageCurvature(radiusLimits: Segment1d): number {\r\n return 0.5 * (TransitionSpiral3d.radiusToCurvature(radiusLimits.x0) + TransitionSpiral3d.radiusToCurvature(radiusLimits.x1));\r\n }\r\n /**\r\n * Given two radii (or zeros for 0 curvature) return the average curvature\r\n * @param r0 start radius, or 0 for line\r\n * @param r1 end radius, or 0 for line\r\n */\r\n public static averageCurvatureR0R1(r0: number, r1: number): number {\r\n return 0.5 * (TransitionSpiral3d.radiusToCurvature(r0) + TransitionSpiral3d.radiusToCurvature(r1));\r\n }\r\n /**\r\n * Given two radii (or zeros for 0 curvature) return the average curvature\r\n * @param r0 start radius, or 0 for line\r\n * @param r1 end radius, or 0 for line\r\n */\r\n public static interpolateCurvatureR0R1(r0: number, fraction: number, r1: number): number {\r\n return Geometry.interpolate(TransitionSpiral3d.radiusToCurvature(r0), fraction, TransitionSpiral3d.radiusToCurvature(r1));\r\n }\r\n\r\n /** Return the arc length of a transition spiral with given sweep and radius pair. */\r\n public static radiusRadiusSweepRadiansToArcLength(radius0: number, radius1: number, sweepRadians: number): number {\r\n return Math.abs(sweepRadians / TransitionSpiral3d.averageCurvatureR0R1(radius0, radius1));\r\n }\r\n\r\n /** Return the turn angle for spiral of given length between two radii */\r\n public static radiusRadiusLengthToSweepRadians(radius0: number, radius1: number, arcLength: number): number {\r\n return TransitionSpiral3d.averageCurvatureR0R1(radius0, radius1) * arcLength;\r\n }\r\n\r\n /** Return the end radius for spiral of given start radius, length, and turn angle. */\r\n public static radius0LengthSweepRadiansToRadius1(radius0: number, arcLength: number, sweepRadians: number) {\r\n return TransitionSpiral3d.curvatureToRadius((2.0 * sweepRadians / arcLength) - TransitionSpiral3d.radiusToCurvature(radius0));\r\n }\r\n /** Return the start radius for spiral of given end radius, length, and turn angle. */\r\n public static radius1LengthSweepRadiansToRadius0(radius1: number, arcLength: number, sweepRadians: number) {\r\n return TransitionSpiral3d.curvatureToRadius((2.0 * sweepRadians / arcLength) - TransitionSpiral3d.radiusToCurvature(radius1));\r\n }\r\n /** Return the original defining properties (if any) saved by the constructor. */\r\n public get designProperties(): TransitionConditionalProperties | undefined { return this._designProperties; }\r\n /**\r\n * * If transformA is rigid with uniform scale, apply the rigid part of transformA to the localToWorld transform and return the scale and rigid separation.\r\n * * If not rigid, do nothing and return undefined.\r\n * * Also apply the scale factor to the designProperties.\r\n * @param transformA\r\n */\r\n protected applyRigidPartOfTransform(transformA: Transform): { rigidAxes: Matrix3d, scale: number } | undefined {\r\n const rigidData = transformA.matrix.factorRigidWithSignedScale();\r\n if (rigidData !== undefined) {\r\n // [sQ a][R b] = [sQ*R sQb+a]\r\n // but we save it as [Q*R sQb+a] with spiral data scaled by s.\r\n const transformC0 = transformA.multiplyTransformTransform(this.localToWorld);\r\n // BUT pull the scale part out of the matrix ...\r\n const matrixC = rigidData.rigidAxes.multiplyMatrixMatrix(this.localToWorld.matrix);\r\n this._localToWorld = Transform.createOriginAndMatrix(transformC0.origin, matrixC);\r\n if (this.designProperties)\r\n this.designProperties.applyScaleFactor(rigidData.scale);\r\n\r\n return rigidData;\r\n }\r\n return undefined;\r\n }\r\n\r\n /**\r\n * Construct an offset of the instance curve as viewed in the xy-plane (ignoring z).\r\n * * No attempt is made to join the offsets of smaller constituent primitives. To construct a fully joined offset\r\n * for an aggregate instance (e.g., LineString3d, CurveChainWithDistanceIndex), use RegionOps.constructCurveXYOffset() instead.\r\n * @param offsetDistanceOrOptions offset distance (positive to left of the instance curve), or options object\r\n */\r\n public override constructOffsetXY(offsetDistanceOrOptions: number | OffsetOptions): CurvePrimitive | CurvePrimitive[] | undefined {\r\n const options = OffsetOptions.create(offsetDistanceOrOptions);\r\n const handler = new CurveOffsetXYHandler(this, options.leftOffsetDistance);\r\n this.emitStrokableParts(handler, options.strokeOptions);\r\n return handler.claimResult();\r\n }\r\n /** extend the range by the strokes of the spiral */\r\n public override extendRange(rangeToExtend: Range3d, transform?: Transform): void {\r\n const myRange = this.rangeBetweenFractions (0.0, 1.0, transform);\r\n rangeToExtend.extendRange (myRange);\r\n }\r\n\r\n /** return the range of spiral between fractions of the activeStrokes.\r\n * * Use activeStrokes point count times interval factor for initial evaluation count, but do at least 5\r\n */\r\n public override rangeBetweenFractions(fractionA: number, fractionB: number, transform?: Transform): Range3d {\r\n const strokes = this.activeStrokes;\r\n if (undefined === strokes)\r\n return Range3d.createNull ();\r\n let count = Math.ceil (strokes.numPoints() * Math.abs (fractionB - fractionA));\r\n count = Geometry.clamp (5, count, 30);\r\n return this.rangeBetweenFractionsByCount (fractionA, fractionB, count, transform, 0.5);\r\n }\r\n /** Project instance geometry (via dispatch) onto the given ray, and return the extreme fractional parameters of projection.\r\n * @param ray ray onto which the instance is projected. A `Vector3d` is treated as a `Ray3d` with zero origin.\r\n * @param lowHigh optional receiver for output\r\n * @returns range of fractional projection parameters onto the ray, where 0.0 is start of the ray and 1.0 is the end of the ray.\r\n */\r\n public override projectedParameterRange(ray: Vector3d | Ray3d, lowHigh?: Range1d): Range1d | undefined {\r\n return PlaneAltitudeRangeContext.findExtremeFractionsAlongDirection(this, ray, lowHigh);\r\n }\r\n}\r\n"]}
|
|
1
|
+
{"version":3,"file":"TransitionSpiral3d.js","sourceRoot":"","sources":["../../../../src/curve/spiral/TransitionSpiral3d.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAE/F;;GAEG;AAEH,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAE1C,OAAO,EAAW,OAAO,EAAE,MAAM,wBAAwB,CAAC;AAC1D,OAAO,EAAE,SAAS,EAAE,MAAM,4BAA4B,CAAC;AACvD,OAAO,EAAE,SAAS,EAAE,MAAM,4BAA4B,CAAC;AACvD,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AACnD,OAAO,EAAE,oBAAoB,EAAE,MAAM,0CAA0C,CAAC;AAChF,OAAO,EAAE,yBAAyB,EAAE,MAAM,+CAA+C,CAAC;AAE1F,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAuCjD;;;;;;;;;;;;GAYG;AACH,MAAM,OAAgB,kBAAmB,SAAQ,cAAc;IAC7D,iCAAiC;IACvB,WAAW,CAAS;IAC9B,oCAAoC;IAC1B,iBAAiB,CAA8C;IAEzE;;OAEG;IACO,uBAAuB,CAAY;IAC7C,wEAAwE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AE,SAAS,EAAE,SAAS,EAAE,KAAK,EAAE,SAAS,EAAE,GAAG,CAAC,CAAC;IACzF,CAAC;IACD;;;;OAIG;IACa,uBAAuB,CAAC,GAAqB,EAAE,OAAiB;QAC9E,OAAO,yBAAyB,CAAC,kCAAkC,CAAC,IAAI,EAAE,GAAG,EAAE,OAAO,CAAC,CAAC;IAC1F,CAAC;CACF","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n\n/** @packageDocumentation\n * @module Curve\n */\n\nimport { Geometry } from \"../../Geometry\";\nimport { Matrix3d } from \"../../geometry3d/Matrix3d\";\nimport { Range1d, Range3d } from \"../../geometry3d/Range\";\nimport { Segment1d } from \"../../geometry3d/Segment1d\";\nimport { Transform } from \"../../geometry3d/Transform\";\nimport { CurvePrimitive } from \"../CurvePrimitive\";\nimport { CurveOffsetXYHandler } from \"../internalContexts/CurveOffsetXYHandler\";\nimport { PlaneAltitudeRangeContext } from \"../internalContexts/PlaneAltitudeRangeContext\";\nimport { LineString3d } from \"../LineString3d\";\nimport { OffsetOptions } from \"../OffsetOptions\";\nimport { TransitionConditionalProperties } from \"./TransitionConditionalProperties\";\n\nimport type { Vector3d } from \"../../geometry3d/Point3dVector3d\";\nimport type { Ray3d } from \"../../geometry3d/Ray3d\";\n\n/**\n * This is the set of valid type names for \"integrated\" spirals\n * * Behavior is expressed by a `NormalizedTransition` snap function.\n * * The snap function varies smoothly from f(0)=0 to f(1)=1\n * * The various snap functions are:\n * * clothoid: linear\n * * biquadratic: 2 quadratics pieced together, joining with 1st derivative continuity at f(0.) = 0.5, with zero slope f'(0)=0 and f'(1)= 0\n * * bloss: A single cubic with zero slope at 0 and 1\n * * cosine: half of a cosine wave, centered around 0.5\n * * sine: full period of a sine wave added to the line f(u)=u\n * *\n * @public\n */\nexport type IntegratedSpiralTypeName = \"clothoid\" | \"bloss\" | \"biquadratic\" | \"cosine\" | \"sine\";\n\n/**\n * This is the set of valid type names for \"direct\" spirals.\n * \"Direct\" spirals can evaluate fractionToPoint by direct equations, i.e. not requiring the numeric integrations in \"Integrated\" spiral types.\n * @public\n */\nexport type DirectSpiralTypeName =\n \"JapaneseCubic\" // 1 term from each of the X,Y clothoid series expansions: y = x^3 / (6RL)\n | \"Arema\" // 2 terms from each of the X,Y clothoid series expansions. Identical to ChineseCubic!\n | \"ChineseCubic\" // Identical to Arema!\n | \"HalfCosine\" // high continuity cosine variation from quadratic.\n | \"AustralianRailCorp\" // cubic with high accuracy distance series\n | \"WesternAustralian\" // simple cubic -- 2 terms of x series, 1 term of y series.\n | \"Czech\" // simple cubic with two term distance approximation\n | \"MXCubicAlongArc\" // x obtained from fractional distance via 2-terms from series, y = x^3/ (6RL)\n | \"Polish\"\n | \"Italian\"\n ;\n\n/**\n * TransitionSpiral3d is a base class for multiple variants of spirals.\n * * The menagerie of spiral types have 2 broad categories:\n * * IntegratedSpiral3d -- a spiral whose direct function for curvature versus distance must be integrated to determine x,y\n * * The IntegratedSpiral3d types are enumerated in `IntegratedSpiralTypes`\n * * DirectSpiral3d -- a spiral implemented with direct calculation of x,y from fractional position along the spiral.\n * * The direct spiral types are enumerated in the `DirectSpiralType`\n * * The method set for CurvePrimitive support includes a `handleTransitionSpiral(g: TransitionSpiral3d)` which receives all the spiral types.\n * * The spiral class may impose expectations that its inflection is at the origin, with tangent along the x axis.\n * * This is generally necessary for direct spirals.\n * * This is not necessary for integrated spirals.\n * @public\n */\nexport abstract class TransitionSpiral3d extends CurvePrimitive {\n /** string name of spiral type */\n protected _spiralType: string;\n /** Original defining properties. */\n protected _designProperties: TransitionConditionalProperties | undefined;\n\n /** Fractional interval for the \"active\" part of a containing spiral.\n * (The radius, angle, and length conditions define a complete spiral, and some portion of it is \"active\")\n */\n protected _activeFractionInterval: Segment1d;\n /** Return (reference to) the active portion of the reference spiral. */\n public get activeFractionInterval(): Segment1d { return this._activeFractionInterval; }\n /** strokes in the active portion */\n public abstract get activeStrokes(): LineString3d;\n /** Placement transform */\n protected _localToWorld: Transform;\n /** (reference to) placement transform. */\n public get localToWorld(): Transform { return this._localToWorld; }\n\n protected constructor(spiralType: string | undefined, localToWorld: Transform, activeFractionInterval: Segment1d | undefined, designProperties: TransitionConditionalProperties | undefined) {\n super();\n this._spiralType = spiralType ? spiralType : \"unknownSpiralType\";\n this._designProperties = designProperties;\n this._localToWorld = localToWorld;\n this._activeFractionInterval = activeFractionInterval ? activeFractionInterval : Segment1d.create(0, 1);\n }\n\n public get spiralType(): string { return this._spiralType; }\n /** Return 1/r with convention that if true zero is given as radius it represents infinite radius (0 curvature, straight line) */\n public static radiusToCurvature(radius: number): number { return (radius === 0.0) ? 0.0 : 1.0 / radius; }\n\n /** Return 1/k with convention that if near-zero is given as curvature, its infinite radius is returned as 0 */\n public static curvatureToRadius(curvature: number): number {\n if (Math.abs(curvature) < Geometry.smallAngleRadians)\n return 0.0;\n return 1.0 / curvature;\n }\n\n /** Return a deep clone. */\n public abstract override clone(): TransitionSpiral3d;\n\n /** Recompute strokes */\n public abstract refreshComputedProperties(): void;\n\n /** Return (if possible) a spiral which is a portion of this curve. */\n public override clonePartialCurve(fractionA: number, fractionB: number): TransitionSpiral3d {\n const spiralB = this.clone();\n const globalFractionA = this._activeFractionInterval.fractionToPoint(fractionA);\n const globalFractionB = this._activeFractionInterval.fractionToPoint(fractionB);\n spiralB._activeFractionInterval.set(globalFractionA, globalFractionB);\n spiralB.refreshComputedProperties();\n return spiralB;\n }\n\n /** Clone with a transform applied */\n public override cloneTransformed(transform: Transform): TransitionSpiral3d {\n const result = this.clone();\n result.tryTransformInPlace(transform); // ok, we're confident it will always work.\n return result;\n }\n\n /** Return the average of the start and end curvatures. */\n public static averageCurvature(radiusLimits: Segment1d): number {\n return 0.5 * (TransitionSpiral3d.radiusToCurvature(radiusLimits.x0) + TransitionSpiral3d.radiusToCurvature(radiusLimits.x1));\n }\n /**\n * Given two radii (or zeros for 0 curvature) return the average curvature\n * @param r0 start radius, or 0 for line\n * @param r1 end radius, or 0 for line\n */\n public static averageCurvatureR0R1(r0: number, r1: number): number {\n return 0.5 * (TransitionSpiral3d.radiusToCurvature(r0) + TransitionSpiral3d.radiusToCurvature(r1));\n }\n /**\n * Given two radii (or zeros for 0 curvature) return the average curvature\n * @param r0 start radius, or 0 for line\n * @param r1 end radius, or 0 for line\n */\n public static interpolateCurvatureR0R1(r0: number, fraction: number, r1: number): number {\n return Geometry.interpolate(TransitionSpiral3d.radiusToCurvature(r0), fraction, TransitionSpiral3d.radiusToCurvature(r1));\n }\n\n /** Return the arc length of a transition spiral with given sweep and radius pair. */\n public static radiusRadiusSweepRadiansToArcLength(radius0: number, radius1: number, sweepRadians: number): number {\n return Math.abs(sweepRadians / TransitionSpiral3d.averageCurvatureR0R1(radius0, radius1));\n }\n\n /** Return the turn angle for spiral of given length between two radii */\n public static radiusRadiusLengthToSweepRadians(radius0: number, radius1: number, arcLength: number): number {\n return TransitionSpiral3d.averageCurvatureR0R1(radius0, radius1) * arcLength;\n }\n\n /** Return the end radius for spiral of given start radius, length, and turn angle. */\n public static radius0LengthSweepRadiansToRadius1(radius0: number, arcLength: number, sweepRadians: number) {\n return TransitionSpiral3d.curvatureToRadius((2.0 * sweepRadians / arcLength) - TransitionSpiral3d.radiusToCurvature(radius0));\n }\n /** Return the start radius for spiral of given end radius, length, and turn angle. */\n public static radius1LengthSweepRadiansToRadius0(radius1: number, arcLength: number, sweepRadians: number) {\n return TransitionSpiral3d.curvatureToRadius((2.0 * sweepRadians / arcLength) - TransitionSpiral3d.radiusToCurvature(radius1));\n }\n /** Return the original defining properties (if any) saved by the constructor. */\n public get designProperties(): TransitionConditionalProperties | undefined { return this._designProperties; }\n /**\n * * If transformA is rigid with uniform scale, apply the rigid part of transformA to the localToWorld transform and return the scale and rigid separation.\n * * If not rigid, do nothing and return undefined.\n * * Also apply the scale factor to the designProperties.\n * @param transformA\n */\n protected applyRigidPartOfTransform(transformA: Transform): { rigidAxes: Matrix3d, scale: number } | undefined {\n const rigidData = transformA.matrix.factorRigidWithSignedScale();\n if (rigidData !== undefined) {\n // [sQ a][R b] = [sQ*R sQb+a]\n // but we save it as [Q*R sQb+a] with spiral data scaled by s.\n const transformC0 = transformA.multiplyTransformTransform(this.localToWorld);\n // BUT pull the scale part out of the matrix ...\n const matrixC = rigidData.rigidAxes.multiplyMatrixMatrix(this.localToWorld.matrix);\n this._localToWorld = Transform.createOriginAndMatrix(transformC0.origin, matrixC);\n if (this.designProperties)\n this.designProperties.applyScaleFactor(rigidData.scale);\n\n return rigidData;\n }\n return undefined;\n }\n\n /**\n * Construct an offset of the instance curve as viewed in the xy-plane (ignoring z).\n * * No attempt is made to join the offsets of smaller constituent primitives. To construct a fully joined offset\n * for an aggregate instance (e.g., LineString3d, CurveChainWithDistanceIndex), use RegionOps.constructCurveXYOffset() instead.\n * @param offsetDistanceOrOptions offset distance (positive to left of the instance curve), or options object\n */\n public override constructOffsetXY(offsetDistanceOrOptions: number | OffsetOptions): CurvePrimitive | CurvePrimitive[] | undefined {\n const options = OffsetOptions.create(offsetDistanceOrOptions);\n const handler = new CurveOffsetXYHandler(this, options.leftOffsetDistance);\n this.emitStrokableParts(handler, options.strokeOptions);\n return handler.claimResult();\n }\n /** extend the range by the strokes of the spiral */\n public override extendRange(rangeToExtend: Range3d, transform?: Transform): void {\n const myRange = this.rangeBetweenFractions (0.0, 1.0, transform);\n rangeToExtend.extendRange (myRange);\n }\n\n /** return the range of spiral between fractions of the activeStrokes.\n * * Use activeStrokes point count times interval factor for initial evaluation count, but do at least 5\n */\n public override rangeBetweenFractions(fractionA: number, fractionB: number, transform?: Transform): Range3d {\n const strokes = this.activeStrokes;\n if (undefined === strokes)\n return Range3d.createNull ();\n let count = Math.ceil (strokes.numPoints() * Math.abs (fractionB - fractionA));\n count = Geometry.clamp (5, count, 30);\n return this.rangeBetweenFractionsByCount (fractionA, fractionB, count, transform, 0.5);\n }\n /** Project instance geometry (via dispatch) onto the given ray, and return the extreme fractional parameters of projection.\n * @param ray ray onto which the instance is projected. A `Vector3d` is treated as a `Ray3d` with zero origin.\n * @param lowHigh optional receiver for output\n * @returns range of fractional projection parameters onto the ray, where 0.0 is start of the ray and 1.0 is the end of the ray.\n */\n public override projectedParameterRange(ray: Vector3d | Ray3d, lowHigh?: Range1d): Range1d | undefined {\n return PlaneAltitudeRangeContext.findExtremeFractionsAlongDirection(this, ray, lowHigh);\n }\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"XYCurveEvaluator.js","sourceRoot":"","sources":["../../../../src/curve/spiral/XYCurveEvaluator.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAE/F;;GAEG;AACH,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAC1C,OAAO,EAAE,yBAAyB,EAAE,MAAM,4CAA4C,CAAC;AACvF,OAAO,EAAE,OAAO,EAAY,MAAM,kCAAkC,CAAC;AACrE,OAAO,EAAE,KAAK,EAAE,MAAM,wBAAwB,CAAC;AAC/C,OAAO,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC;AACvD,OAAO,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AACrD;;;;;;;GAOG;AACH,MAAM,OAAgB,gBAAgB;IAsBpC,iFAAiF;IAC1E,eAAe,CAAC,QAAgB,EAAE,MAAgB;QACvD,OAAO,OAAO,CAAC,MAAM,CAAC,IAAI,CAAC,WAAW,CAAC,QAAQ,CAAC,EAAE,IAAI,CAAC,WAAW,CAAC,QAAQ,CAAC,EAAE,GAAG,EAAE,MAAM,CAAC,CAAC;IAC7F,CAAC;IACD,4IAA4I;IACrI,4BAA4B,CAAC,QAAgB,EAAE,MAAc;QAClE,OAAO,KAAK,CAAC,YAAY,CAAC,IAAI,CAAC,WAAW,CAAC,QAAQ,CAAC,EAAE,IAAI,CAAC,WAAW,CAAC,QAAQ,CAAC,EAAE,GAAG,EACnF,IAA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OAOG;IACI,8BAA8B,CAAC,QAAgB,EAAE,EAAW,EAAE,IAAe,EAAE,IAAe,EAAE,IAAe;QACpH,EAAE,CAAC,GAAG,CAAC,IAAI,CAAC,WAAW,CAAC,QAAQ,CAAC,EAAE,IAAI,CAAC,WAAW,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC,CAAC;QAClE,IAAI,IAAI;YACN,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,YAAY,CAAC,QAAQ,CAAC,EAAE,IAAI,CAAC,YAAY,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC,CAAC;QACxE,IAAI,IAAI;YACN,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,aAAa,CAAC,QAAQ,CAAC,EAAE,IAAI,CAAC,aAAa,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC,CAAC;QAC1E,IAAI,IAAI;YACN,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,aAAa,CAAC,QAAQ,CAAC,EAAE,IAAI,CAAC,aAAa,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC,CAAC;IAC5E,CAAC;CAGF;AACD,sDAAsD;AACtD,gBAAgB,CAAC,aAAa,EAAE,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n\r\n/** @packageDocumentation\r\n * @module Curve\r\n */\r\nimport { Geometry } from \"../../Geometry\";\r\nimport { Plane3dByOriginAndVectors } from \"../../geometry3d/Plane3dByOriginAndVectors\";\r\nimport { Point3d, Vector3d } from \"../../geometry3d/Point3dVector3d\";\r\nimport { Ray3d } from \"../../geometry3d/Ray3d\";\r\nimport { Quadrature } from \"../../numerics/Quadrature\";\r\nimport { SimpleNewton } from \"../../numerics/Newton\";\r\n/**\r\n * XYCurveEvaluator is an abstract with methods for evaluating X and Y parts of a curve parameterized by a fraction.\r\n * * The required methods call for independent X and Y evaluation.\r\n * * Base class methods package those (multiple) calls into point, ray, and plane structures.\r\n * * A implementation that has evaluation substantial cost that can be shared among x,y parts or between\r\n * primary functions and derivatives might choose to implement the point and derivative methods directly.\r\n * @internal\r\n */\r\nexport abstract class XYCurveEvaluator {\r\n /** return a deep copy of the evaluator */\r\n public abstract clone(): XYCurveEvaluator;\r\n /** test for near identical evaluator */\r\n public abstract isAlmostEqual(other: any): boolean;\r\n /** Evaluate X at fractional position. */\r\n public abstract fractionToX(fraction: number): number;\r\n /** Evaluate Y at fractional position. */\r\n public abstract fractionToY(fraction: number): number;\r\n /** Evaluate derivative of X with respect to fraction at fractional position. */\r\n public abstract fractionToDX(fraction: number): number;\r\n /** Evaluate derivative of Y with respect to fraction at fractional position. */\r\n public abstract fractionToDY(fraction: number): number;\r\n /** Evaluate second derivative of X with respect to fraction at fractional position. */\r\n public abstract fractionToDDX(fraction: number): number;\r\n /** Evaluate second derivative of Y with respect to fraction at fractional position. */\r\n public abstract fractionToDDY(fraction: number): number;\r\n /** Evaluate both X and Y at fractional coordinate, return bundled as a point. */\r\n /** Evaluate second derivative of X with respect to fraction at fractional position. */\r\n public abstract fractionToD3X(fraction: number): number;\r\n /** Evaluate second derivative of Y with respect to fraction at fractional position. */\r\n public abstract fractionToD3Y(fraction: number): number;\r\n /** Evaluate both X and Y at fractional coordinate, return bundled as a point. */\r\n public fractionToPoint(fraction: number, result?: Point3d): Point3d {\r\n return Point3d.create(this.fractionToX(fraction), this.fractionToY(fraction), 0.0, result);\r\n }\r\n /** Evaluate both X and Y and their first derivatives at fractional coordinate, return bundled as origin and (non-unit) direction vector. */\r\n public fractionToPointAndDerivative(fraction: number, result?: Ray3d): Ray3d {\r\n return Ray3d.createXYZUVW(this.fractionToX(fraction), this.fractionToY(fraction), 0.0,\r\n this.fractionToDX(fraction), this.fractionToDY(fraction), 0,\r\n result);\r\n }\r\n /** Evaluate both X and Y and their second derivatives at fractional coordinate, return bundled as origin and (non-unit) vectorU an vectorV. */\r\n public fractionToPointAnd2Derivatives(fraction: number, result?: Plane3dByOriginAndVectors): Plane3dByOriginAndVectors {\r\n return Plane3dByOriginAndVectors.createOriginAndVectorsXYZ(\r\n this.fractionToX(fraction), this.fractionToY(fraction), 0.0,\r\n this.fractionToDX(fraction), this.fractionToDY(fraction), 0,\r\n this.fractionToDDX(fraction), this.fractionToDDY(fraction), 0,\r\n result);\r\n }\r\n /**\r\n * Return the magnitude of the tangent vector at fraction.\r\n * @param fraction fractional position along the curve\r\n */\r\n public fractionToTangentMagnitude(fraction: number): number {\r\n const u = this.fractionToDX(fraction);\r\n const v = this.fractionToDY(fraction);\r\n return Geometry.hypotenuseXY(u, v);\r\n }\r\n\r\n /** Invert the fractionToX function for given X. */\r\n\r\n public abstract xToFraction(x: number): number | undefined;\r\n /** Initialize class level work arrays for 5 point Gaussian Quadrature. */\r\n // Class resources for integration . . .\r\n // These static variables are reused on calls to integrateFromStartFraction\r\n protected static _gaussX: Float64Array;\r\n protected static _gaussWeight: Float64Array;\r\n protected static _gaussMapper: (xA: number, xB: number, arrayX: Float64Array, arrayW: Float64Array) => number;\r\n public static initWorkSpace() {\r\n XYCurveEvaluator._gaussX = new Float64Array(5);\r\n XYCurveEvaluator._gaussWeight = new Float64Array(5);\r\n XYCurveEvaluator._gaussMapper = (xA, xB, xMapped, wMapped) => Quadrature.setupGauss5(xA, xB, xMapped, wMapped);\r\n }\r\n /**\r\n * Integrate between nominal fractions with default gauss rule.\r\n * * The caller is expected to choose nearby fractions so that the single gauss interval accuracy is good.\r\n * @param fraction0\r\n * @param fraction1\r\n */\r\n public integrateDistanceBetweenFractions(fraction0: number, fraction1: number): number {\r\n const gaussX = XYCurveEvaluator._gaussX;\r\n const gaussWeight = XYCurveEvaluator._gaussWeight;\r\n const numEval = XYCurveEvaluator._gaussMapper(fraction0, fraction1, gaussX, gaussWeight);\r\n let sum = 0;\r\n for (let k = 0; k < numEval; k++) {\r\n sum += gaussWeight[k] * this.fractionToTangentMagnitude(gaussX[k]);\r\n }\r\n return sum;\r\n }\r\n /**\r\n * Inverse integrated distance\r\n * @param fraction0 start of fraction interval\r\n * @param fraction1 end of fraction interval\r\n * @param distance0 distance at start\r\n * @param distance1 distance at end\r\n * @param targetDistance intermediate distance.\r\n */\r\n public inverseDistanceFraction(fraction0: number, fraction1: number, distance0: number, distance1: number, targetDistance: number): number | undefined {\r\n const startFraction = Geometry.inverseInterpolate(fraction0, distance0, fraction1, distance1, targetDistance);\r\n if (startFraction !== undefined) {\r\n return SimpleNewton.runNewton1D(startFraction,\r\n (fraction: number) => {\r\n const d = this.integrateDistanceBetweenFractions(fraction0, fraction);\r\n return distance0 + d - targetDistance;\r\n },\r\n (fraction: number) => this.fractionToTangentMagnitude(fraction));\r\n }\r\n return undefined;\r\n }\r\n\r\n /**\r\n *\r\n * @param fraction fractional position along x axis\r\n * @param xy xy coordinates of point on the curve\r\n * @param d1xy\r\n * @param d2xy\r\n * @param d3xy\r\n */\r\n public fractionToPointAnd3Derivatives(fraction: number, xy: Point3d, d1xy?: Vector3d, d2xy?: Vector3d, d3xy?: Vector3d) {\r\n xy.set(this.fractionToX(fraction), this.fractionToY(fraction), 0);\r\n if (d1xy)\r\n d1xy.set(this.fractionToDX(fraction), this.fractionToDY(fraction), 0);\r\n if (d2xy)\r\n d2xy.set(this.fractionToDDX(fraction), this.fractionToDDY(fraction), 0);\r\n if (d3xy)\r\n d3xy.set(this.fractionToD3X(fraction), this.fractionToD3Y(fraction), 0);\r\n }\r\n /** Apply a uniform scale around the origin. */\r\n public abstract scaleInPlace(scaleFactor: number): void;\r\n}\r\n// at load time, initialize gauss quadrature workspace\r\nXYCurveEvaluator.initWorkSpace();\r\n"]}
|
|
1
|
+
{"version":3,"file":"XYCurveEvaluator.js","sourceRoot":"","sources":["../../../../src/curve/spiral/XYCurveEvaluator.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAE/F;;GAEG;AACH,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CA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,CAAC;QAC1E,IAAI,IAAI;YACN,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,aAAa,CAAC,QAAQ,CAAC,EAAE,IAAI,CAAC,aAAa,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC,CAAC;IAC5E,CAAC;CAGF;AACD,sDAAsD;AACtD,gBAAgB,CAAC,aAAa,EAAE,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n\n/** @packageDocumentation\n * @module Curve\n */\nimport { Geometry } from \"../../Geometry\";\nimport { Plane3dByOriginAndVectors } from \"../../geometry3d/Plane3dByOriginAndVectors\";\nimport { Point3d, Vector3d } from \"../../geometry3d/Point3dVector3d\";\nimport { Ray3d } from \"../../geometry3d/Ray3d\";\nimport { Quadrature } from \"../../numerics/Quadrature\";\nimport { SimpleNewton } from \"../../numerics/Newton\";\n/**\n * XYCurveEvaluator is an abstract with methods for evaluating X and Y parts of a curve parameterized by a fraction.\n * * The required methods call for independent X and Y evaluation.\n * * Base class methods package those (multiple) calls into point, ray, and plane structures.\n * * A implementation that has evaluation substantial cost that can be shared among x,y parts or between\n * primary functions and derivatives might choose to implement the point and derivative methods directly.\n * @internal\n */\nexport abstract class XYCurveEvaluator {\n /** return a deep copy of the evaluator */\n public abstract clone(): XYCurveEvaluator;\n /** test for near identical evaluator */\n public abstract isAlmostEqual(other: any): boolean;\n /** Evaluate X at fractional position. */\n public abstract fractionToX(fraction: number): number;\n /** Evaluate Y at fractional position. */\n public abstract fractionToY(fraction: number): number;\n /** Evaluate derivative of X with respect to fraction at fractional position. */\n public abstract fractionToDX(fraction: number): number;\n /** Evaluate derivative of Y with respect to fraction at fractional position. */\n public abstract fractionToDY(fraction: number): number;\n /** Evaluate second derivative of X with respect to fraction at fractional position. */\n public abstract fractionToDDX(fraction: number): number;\n /** Evaluate second derivative of Y with respect to fraction at fractional position. */\n public abstract fractionToDDY(fraction: number): number;\n /** Evaluate both X and Y at fractional coordinate, return bundled as a point. */\n /** Evaluate second derivative of X with respect to fraction at fractional position. */\n public abstract fractionToD3X(fraction: number): number;\n /** Evaluate second derivative of Y with respect to fraction at fractional position. */\n public abstract fractionToD3Y(fraction: number): number;\n /** Evaluate both X and Y at fractional coordinate, return bundled as a point. */\n public fractionToPoint(fraction: number, result?: Point3d): Point3d {\n return Point3d.create(this.fractionToX(fraction), this.fractionToY(fraction), 0.0, result);\n }\n /** Evaluate both X and Y and their first derivatives at fractional coordinate, return bundled as origin and (non-unit) direction vector. */\n public fractionToPointAndDerivative(fraction: number, result?: Ray3d): Ray3d {\n return Ray3d.createXYZUVW(this.fractionToX(fraction), this.fractionToY(fraction), 0.0,\n this.fractionToDX(fraction), this.fractionToDY(fraction), 0,\n result);\n }\n /** Evaluate both X and Y and their second derivatives at fractional coordinate, return bundled as origin and (non-unit) vectorU an vectorV. */\n public fractionToPointAnd2Derivatives(fraction: number, result?: Plane3dByOriginAndVectors): Plane3dByOriginAndVectors {\n return Plane3dByOriginAndVectors.createOriginAndVectorsXYZ(\n this.fractionToX(fraction), this.fractionToY(fraction), 0.0,\n this.fractionToDX(fraction), this.fractionToDY(fraction), 0,\n this.fractionToDDX(fraction), this.fractionToDDY(fraction), 0,\n result);\n }\n /**\n * Return the magnitude of the tangent vector at fraction.\n * @param fraction fractional position along the curve\n */\n public fractionToTangentMagnitude(fraction: number): number {\n const u = this.fractionToDX(fraction);\n const v = this.fractionToDY(fraction);\n return Geometry.hypotenuseXY(u, v);\n }\n\n /** Invert the fractionToX function for given X. */\n\n public abstract xToFraction(x: number): number | undefined;\n /** Initialize class level work arrays for 5 point Gaussian Quadrature. */\n // Class resources for integration . . .\n // These static variables are reused on calls to integrateFromStartFraction\n protected static _gaussX: Float64Array;\n protected static _gaussWeight: Float64Array;\n protected static _gaussMapper: (xA: number, xB: number, arrayX: Float64Array, arrayW: Float64Array) => number;\n public static initWorkSpace() {\n XYCurveEvaluator._gaussX = new Float64Array(5);\n XYCurveEvaluator._gaussWeight = new Float64Array(5);\n XYCurveEvaluator._gaussMapper = (xA, xB, xMapped, wMapped) => Quadrature.setupGauss5(xA, xB, xMapped, wMapped);\n }\n /**\n * Integrate between nominal fractions with default gauss rule.\n * * The caller is expected to choose nearby fractions so that the single gauss interval accuracy is good.\n * @param fraction0\n * @param fraction1\n */\n public integrateDistanceBetweenFractions(fraction0: number, fraction1: number): number {\n const gaussX = XYCurveEvaluator._gaussX;\n const gaussWeight = XYCurveEvaluator._gaussWeight;\n const numEval = XYCurveEvaluator._gaussMapper(fraction0, fraction1, gaussX, gaussWeight);\n let sum = 0;\n for (let k = 0; k < numEval; k++) {\n sum += gaussWeight[k] * this.fractionToTangentMagnitude(gaussX[k]);\n }\n return sum;\n }\n /**\n * Inverse integrated distance\n * @param fraction0 start of fraction interval\n * @param fraction1 end of fraction interval\n * @param distance0 distance at start\n * @param distance1 distance at end\n * @param targetDistance intermediate distance.\n */\n public inverseDistanceFraction(fraction0: number, fraction1: number, distance0: number, distance1: number, targetDistance: number): number | undefined {\n const startFraction = Geometry.inverseInterpolate(fraction0, distance0, fraction1, distance1, targetDistance);\n if (startFraction !== undefined) {\n return SimpleNewton.runNewton1D(startFraction,\n (fraction: number) => {\n const d = this.integrateDistanceBetweenFractions(fraction0, fraction);\n return distance0 + d - targetDistance;\n },\n (fraction: number) => this.fractionToTangentMagnitude(fraction));\n }\n return undefined;\n }\n\n /**\n *\n * @param fraction fractional position along x axis\n * @param xy xy coordinates of point on the curve\n * @param d1xy\n * @param d2xy\n * @param d3xy\n */\n public fractionToPointAnd3Derivatives(fraction: number, xy: Point3d, d1xy?: Vector3d, d2xy?: Vector3d, d3xy?: Vector3d) {\n xy.set(this.fractionToX(fraction), this.fractionToY(fraction), 0);\n if (d1xy)\n d1xy.set(this.fractionToDX(fraction), this.fractionToDY(fraction), 0);\n if (d2xy)\n d2xy.set(this.fractionToDDX(fraction), this.fractionToDDY(fraction), 0);\n if (d3xy)\n d3xy.set(this.fractionToD3X(fraction), this.fractionToD3Y(fraction), 0);\n }\n /** Apply a uniform scale around the origin. */\n public abstract scaleInPlace(scaleFactor: number): void;\n}\n// at load time, initialize gauss quadrature workspace\nXYCurveEvaluator.initWorkSpace();\n"]}
|