@itwin/core-geometry 5.2.0-dev.8 → 5.3.0-dev.1
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 +31 -1
- package/lib/cjs/Geometry.d.ts +30 -10
- package/lib/cjs/Geometry.d.ts.map +1 -1
- package/lib/cjs/Geometry.js +74 -10
- package/lib/cjs/Geometry.js.map +1 -1
- package/lib/cjs/bspline/AkimaCurve3d.d.ts +19 -6
- package/lib/cjs/bspline/AkimaCurve3d.d.ts.map +1 -1
- package/lib/cjs/bspline/AkimaCurve3d.js +21 -5
- package/lib/cjs/bspline/AkimaCurve3d.js.map +1 -1
- package/lib/cjs/bspline/BSplineCurve.d.ts +3 -3
- package/lib/cjs/bspline/BSplineCurve.d.ts.map +1 -1
- package/lib/cjs/bspline/BSplineCurve.js +6 -6
- package/lib/cjs/bspline/BSplineCurve.js.map +1 -1
- package/lib/cjs/bspline/BSplineCurveOps.d.ts.map +1 -1
- package/lib/cjs/bspline/BSplineCurveOps.js +1 -1
- package/lib/cjs/bspline/BSplineCurveOps.js.map +1 -1
- package/lib/cjs/bspline/BezierCurveBase.d.ts +2 -2
- package/lib/cjs/bspline/BezierCurveBase.d.ts.map +1 -1
- package/lib/cjs/bspline/BezierCurveBase.js +4 -6
- package/lib/cjs/bspline/BezierCurveBase.js.map +1 -1
- package/lib/cjs/bspline/InterpolationCurve3d.d.ts +27 -17
- package/lib/cjs/bspline/InterpolationCurve3d.d.ts.map +1 -1
- package/lib/cjs/bspline/InterpolationCurve3d.js +17 -7
- package/lib/cjs/bspline/InterpolationCurve3d.js.map +1 -1
- package/lib/cjs/clipping/ClipPlane.d.ts +19 -6
- package/lib/cjs/clipping/ClipPlane.d.ts.map +1 -1
- package/lib/cjs/clipping/ClipPlane.js +17 -2
- package/lib/cjs/clipping/ClipPlane.js.map +1 -1
- package/lib/cjs/clipping/ClipUtils.d.ts +14 -1
- package/lib/cjs/clipping/ClipUtils.d.ts.map +1 -1
- package/lib/cjs/clipping/ClipUtils.js +21 -3
- package/lib/cjs/clipping/ClipUtils.js.map +1 -1
- package/lib/cjs/clipping/ConvexClipPlaneSet.d.ts +14 -11
- package/lib/cjs/clipping/ConvexClipPlaneSet.d.ts.map +1 -1
- package/lib/cjs/clipping/ConvexClipPlaneSet.js +23 -16
- 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/curve/Arc3d.d.ts +27 -17
- package/lib/cjs/curve/Arc3d.d.ts.map +1 -1
- package/lib/cjs/curve/Arc3d.js +61 -35
- package/lib/cjs/curve/Arc3d.js.map +1 -1
- package/lib/cjs/curve/CurveCollection.d.ts +1 -0
- package/lib/cjs/curve/CurveCollection.d.ts.map +1 -1
- package/lib/cjs/curve/CurveCollection.js +1 -0
- package/lib/cjs/curve/CurveCollection.js.map +1 -1
- package/lib/cjs/curve/CurveLocationDetail.d.ts +8 -7
- package/lib/cjs/curve/CurveLocationDetail.d.ts.map +1 -1
- package/lib/cjs/curve/CurveLocationDetail.js.map +1 -1
- package/lib/cjs/curve/CurveOps.d.ts +51 -1
- package/lib/cjs/curve/CurveOps.d.ts.map +1 -1
- package/lib/cjs/curve/CurveOps.js +97 -3
- package/lib/cjs/curve/CurveOps.js.map +1 -1
- package/lib/cjs/curve/LineString3d.d.ts +4 -4
- package/lib/cjs/curve/LineString3d.d.ts.map +1 -1
- package/lib/cjs/curve/LineString3d.js +8 -8
- package/lib/cjs/curve/LineString3d.js.map +1 -1
- package/lib/cjs/curve/Query/ConsolidateAdjacentPrimitivesContext.js +3 -3
- package/lib/cjs/curve/Query/ConsolidateAdjacentPrimitivesContext.js.map +1 -1
- package/lib/cjs/curve/Query/PlanarSubdivision.d.ts +6 -2
- package/lib/cjs/curve/Query/PlanarSubdivision.d.ts.map +1 -1
- package/lib/cjs/curve/Query/PlanarSubdivision.js +12 -7
- package/lib/cjs/curve/Query/PlanarSubdivision.js.map +1 -1
- package/lib/cjs/curve/RegionOps.d.ts +9 -4
- package/lib/cjs/curve/RegionOps.d.ts.map +1 -1
- package/lib/cjs/curve/RegionOps.js +10 -5
- package/lib/cjs/curve/RegionOps.js.map +1 -1
- package/lib/cjs/curve/internalContexts/CurveCurveIntersectXY.d.ts.map +1 -1
- package/lib/cjs/curve/internalContexts/CurveCurveIntersectXY.js +2 -1
- package/lib/cjs/curve/internalContexts/CurveCurveIntersectXY.js.map +1 -1
- package/lib/cjs/curve/internalContexts/MultiChainCollector.d.ts +4 -4
- package/lib/cjs/curve/internalContexts/MultiChainCollector.d.ts.map +1 -1
- package/lib/cjs/curve/internalContexts/MultiChainCollector.js +21 -18
- package/lib/cjs/curve/internalContexts/MultiChainCollector.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/spiral/DirectSpiral3d.d.ts +2 -2
- package/lib/cjs/curve/spiral/DirectSpiral3d.d.ts.map +1 -1
- package/lib/cjs/curve/spiral/DirectSpiral3d.js +6 -2
- package/lib/cjs/curve/spiral/DirectSpiral3d.js.map +1 -1
- package/lib/cjs/curve/spiral/IntegratedSpiral3d.d.ts +2 -2
- package/lib/cjs/curve/spiral/IntegratedSpiral3d.d.ts.map +1 -1
- package/lib/cjs/curve/spiral/IntegratedSpiral3d.js +6 -2
- package/lib/cjs/curve/spiral/IntegratedSpiral3d.js.map +1 -1
- package/lib/cjs/curve/spiral/TransitionSpiral3d.d.ts +5 -1
- package/lib/cjs/curve/spiral/TransitionSpiral3d.d.ts.map +1 -1
- package/lib/cjs/curve/spiral/TransitionSpiral3d.js +0 -3
- package/lib/cjs/curve/spiral/TransitionSpiral3d.js.map +1 -1
- package/lib/cjs/geometry3d/AngleSweep.d.ts +6 -2
- package/lib/cjs/geometry3d/AngleSweep.d.ts.map +1 -1
- package/lib/cjs/geometry3d/AngleSweep.js +12 -3
- package/lib/cjs/geometry3d/AngleSweep.js.map +1 -1
- package/lib/cjs/geometry3d/FrameBuilder.d.ts +2 -1
- package/lib/cjs/geometry3d/FrameBuilder.d.ts.map +1 -1
- package/lib/cjs/geometry3d/FrameBuilder.js +14 -18
- package/lib/cjs/geometry3d/FrameBuilder.js.map +1 -1
- package/lib/cjs/geometry3d/Matrix3d.d.ts +1 -1
- package/lib/cjs/geometry3d/Matrix3d.js +1 -1
- package/lib/cjs/geometry3d/Matrix3d.js.map +1 -1
- package/lib/cjs/geometry3d/Point2dVector2d.d.ts +18 -2
- package/lib/cjs/geometry3d/Point2dVector2d.d.ts.map +1 -1
- package/lib/cjs/geometry3d/Point2dVector2d.js +37 -4
- package/lib/cjs/geometry3d/Point2dVector2d.js.map +1 -1
- package/lib/cjs/geometry3d/Point3dVector3d.d.ts +1 -1
- package/lib/cjs/geometry3d/Point3dVector3d.d.ts.map +1 -1
- package/lib/cjs/geometry3d/Point3dVector3d.js +1 -0
- package/lib/cjs/geometry3d/Point3dVector3d.js.map +1 -1
- package/lib/cjs/geometry3d/PointStreaming.d.ts +8 -0
- package/lib/cjs/geometry3d/PointStreaming.d.ts.map +1 -1
- package/lib/cjs/geometry3d/PointStreaming.js +18 -2
- 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.d.ts +8 -2
- package/lib/cjs/geometry3d/PolylineCompressionByEdgeOffset.d.ts.map +1 -1
- package/lib/cjs/geometry3d/PolylineCompressionByEdgeOffset.js +10 -4
- package/lib/cjs/geometry3d/PolylineCompressionByEdgeOffset.js.map +1 -1
- package/lib/cjs/geometry3d/PolylineOps.d.ts +14 -3
- package/lib/cjs/geometry3d/PolylineOps.d.ts.map +1 -1
- package/lib/cjs/geometry3d/PolylineOps.js +20 -4
- package/lib/cjs/geometry3d/PolylineOps.js.map +1 -1
- package/lib/cjs/geometry3d/Range.d.ts +34 -32
- package/lib/cjs/geometry3d/Range.d.ts.map +1 -1
- package/lib/cjs/geometry3d/Range.js +28 -21
- package/lib/cjs/geometry3d/Range.js.map +1 -1
- package/lib/cjs/geometry3d/Ray2d.d.ts +16 -6
- package/lib/cjs/geometry3d/Ray2d.d.ts.map +1 -1
- package/lib/cjs/geometry3d/Ray2d.js +28 -4
- package/lib/cjs/geometry3d/Ray2d.js.map +1 -1
- package/lib/cjs/geometry3d/Ray3d.d.ts.map +1 -1
- package/lib/cjs/geometry3d/Ray3d.js +3 -4
- package/lib/cjs/geometry3d/Ray3d.js.map +1 -1
- package/lib/cjs/geometry3d/Transform.d.ts +1 -1
- package/lib/cjs/geometry3d/Transform.js +1 -1
- package/lib/cjs/geometry3d/Transform.js.map +1 -1
- package/lib/cjs/geometry3d/XYZProps.d.ts +12 -1
- package/lib/cjs/geometry3d/XYZProps.d.ts.map +1 -1
- package/lib/cjs/geometry3d/XYZProps.js +17 -2
- package/lib/cjs/geometry3d/XYZProps.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/numerics/BezierPolynomials.d.ts.map +1 -1
- package/lib/cjs/numerics/BezierPolynomials.js +5 -9
- package/lib/cjs/numerics/BezierPolynomials.js.map +1 -1
- package/lib/cjs/numerics/SmallSystem.d.ts +13 -7
- package/lib/cjs/numerics/SmallSystem.d.ts.map +1 -1
- package/lib/cjs/numerics/SmallSystem.js +13 -7
- package/lib/cjs/numerics/SmallSystem.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.d.ts +25 -6
- package/lib/cjs/polyface/PolyfaceBuilder.d.ts.map +1 -1
- package/lib/cjs/polyface/PolyfaceBuilder.js +59 -8
- package/lib/cjs/polyface/PolyfaceBuilder.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.d.ts.map +1 -1
- package/lib/cjs/polyface/PolyfaceQuery.js +8 -10
- package/lib/cjs/polyface/PolyfaceQuery.js.map +1 -1
- package/lib/cjs/polyface/RangeTree/Point3dArrayRangeTreeContext.d.ts +8 -5
- package/lib/cjs/polyface/RangeTree/Point3dArrayRangeTreeContext.d.ts.map +1 -1
- package/lib/cjs/polyface/RangeTree/Point3dArrayRangeTreeContext.js +8 -4
- package/lib/cjs/polyface/RangeTree/Point3dArrayRangeTreeContext.js.map +1 -1
- package/lib/cjs/polyface/RangeTree/PolyfaceRangeTreeContext.d.ts +3 -3
- package/lib/cjs/polyface/RangeTree/PolyfaceRangeTreeContext.d.ts.map +1 -1
- package/lib/cjs/polyface/RangeTree/PolyfaceRangeTreeContext.js +1 -1
- package/lib/cjs/polyface/RangeTree/PolyfaceRangeTreeContext.js.map +1 -1
- package/lib/cjs/polyface/RangeTree/RangeTreeNode.d.ts +4 -2
- package/lib/cjs/polyface/RangeTree/RangeTreeNode.d.ts.map +1 -1
- package/lib/cjs/polyface/RangeTree/RangeTreeNode.js +9 -12
- package/lib/cjs/polyface/RangeTree/RangeTreeNode.js.map +1 -1
- package/lib/cjs/polyface/RangeTree/RangeTreeSearchHandlers.d.ts +8 -3
- package/lib/cjs/polyface/RangeTree/RangeTreeSearchHandlers.d.ts.map +1 -1
- package/lib/cjs/polyface/RangeTree/RangeTreeSearchHandlers.js +13 -6
- package/lib/cjs/polyface/RangeTree/RangeTreeSearchHandlers.js.map +1 -1
- package/lib/cjs/serialization/DeepCompare.js +1 -1
- package/lib/cjs/serialization/DeepCompare.js.map +1 -1
- package/lib/cjs/serialization/GeometrySamples.d.ts +2 -1
- package/lib/cjs/serialization/GeometrySamples.d.ts.map +1 -1
- package/lib/cjs/serialization/GeometrySamples.js +2 -1
- package/lib/cjs/serialization/GeometrySamples.js.map +1 -1
- package/lib/cjs/topology/Graph.d.ts +38 -12
- package/lib/cjs/topology/Graph.d.ts.map +1 -1
- package/lib/cjs/topology/Graph.js +91 -23
- package/lib/cjs/topology/Graph.js.map +1 -1
- package/lib/cjs/topology/HalfEdgeGraphFromIndexedLoopsContext.d.ts +5 -4
- package/lib/cjs/topology/HalfEdgeGraphFromIndexedLoopsContext.d.ts.map +1 -1
- package/lib/cjs/topology/HalfEdgeGraphFromIndexedLoopsContext.js +6 -5
- package/lib/cjs/topology/HalfEdgeGraphFromIndexedLoopsContext.js.map +1 -1
- package/lib/cjs/topology/HalfEdgeGraphSearch.d.ts +20 -11
- package/lib/cjs/topology/HalfEdgeGraphSearch.d.ts.map +1 -1
- package/lib/cjs/topology/HalfEdgeGraphSearch.js +43 -39
- package/lib/cjs/topology/HalfEdgeGraphSearch.js.map +1 -1
- package/lib/cjs/topology/Merging.d.ts +7 -4
- package/lib/cjs/topology/Merging.d.ts.map +1 -1
- package/lib/cjs/topology/Merging.js +16 -11
- package/lib/cjs/topology/Merging.js.map +1 -1
- package/lib/cjs/topology/Triangulation.d.ts +13 -11
- package/lib/cjs/topology/Triangulation.d.ts.map +1 -1
- package/lib/cjs/topology/Triangulation.js +40 -36
- package/lib/cjs/topology/Triangulation.js.map +1 -1
- package/lib/cjs/topology/Voronoi.d.ts +195 -0
- package/lib/cjs/topology/Voronoi.d.ts.map +1 -0
- package/lib/cjs/topology/Voronoi.js +700 -0
- package/lib/cjs/topology/Voronoi.js.map +1 -0
- package/lib/cjs/topology/XYParitySearchContext.d.ts +1 -1
- package/lib/cjs/topology/XYParitySearchContext.d.ts.map +1 -1
- package/lib/cjs/topology/XYParitySearchContext.js.map +1 -1
- package/lib/esm/Geometry.d.ts +30 -10
- package/lib/esm/Geometry.d.ts.map +1 -1
- package/lib/esm/Geometry.js +74 -10
- package/lib/esm/Geometry.js.map +1 -1
- package/lib/esm/bspline/AkimaCurve3d.d.ts +19 -6
- package/lib/esm/bspline/AkimaCurve3d.d.ts.map +1 -1
- package/lib/esm/bspline/AkimaCurve3d.js +21 -5
- package/lib/esm/bspline/AkimaCurve3d.js.map +1 -1
- package/lib/esm/bspline/BSplineCurve.d.ts +3 -3
- package/lib/esm/bspline/BSplineCurve.d.ts.map +1 -1
- package/lib/esm/bspline/BSplineCurve.js +6 -6
- package/lib/esm/bspline/BSplineCurve.js.map +1 -1
- package/lib/esm/bspline/BSplineCurveOps.d.ts.map +1 -1
- package/lib/esm/bspline/BSplineCurveOps.js +1 -1
- package/lib/esm/bspline/BSplineCurveOps.js.map +1 -1
- package/lib/esm/bspline/BezierCurveBase.d.ts +2 -2
- package/lib/esm/bspline/BezierCurveBase.d.ts.map +1 -1
- package/lib/esm/bspline/BezierCurveBase.js +4 -6
- package/lib/esm/bspline/BezierCurveBase.js.map +1 -1
- package/lib/esm/bspline/InterpolationCurve3d.d.ts +27 -17
- package/lib/esm/bspline/InterpolationCurve3d.d.ts.map +1 -1
- package/lib/esm/bspline/InterpolationCurve3d.js +17 -7
- package/lib/esm/bspline/InterpolationCurve3d.js.map +1 -1
- package/lib/esm/clipping/ClipPlane.d.ts +19 -6
- package/lib/esm/clipping/ClipPlane.d.ts.map +1 -1
- package/lib/esm/clipping/ClipPlane.js +17 -2
- package/lib/esm/clipping/ClipPlane.js.map +1 -1
- package/lib/esm/clipping/ClipUtils.d.ts +14 -1
- package/lib/esm/clipping/ClipUtils.d.ts.map +1 -1
- package/lib/esm/clipping/ClipUtils.js +21 -3
- package/lib/esm/clipping/ClipUtils.js.map +1 -1
- package/lib/esm/clipping/ConvexClipPlaneSet.d.ts +14 -11
- package/lib/esm/clipping/ConvexClipPlaneSet.d.ts.map +1 -1
- package/lib/esm/clipping/ConvexClipPlaneSet.js +23 -16
- 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/curve/Arc3d.d.ts +27 -17
- package/lib/esm/curve/Arc3d.d.ts.map +1 -1
- package/lib/esm/curve/Arc3d.js +61 -35
- package/lib/esm/curve/Arc3d.js.map +1 -1
- package/lib/esm/curve/CurveCollection.d.ts +1 -0
- package/lib/esm/curve/CurveCollection.d.ts.map +1 -1
- package/lib/esm/curve/CurveCollection.js +1 -0
- package/lib/esm/curve/CurveCollection.js.map +1 -1
- package/lib/esm/curve/CurveLocationDetail.d.ts +8 -7
- package/lib/esm/curve/CurveLocationDetail.d.ts.map +1 -1
- package/lib/esm/curve/CurveLocationDetail.js.map +1 -1
- package/lib/esm/curve/CurveOps.d.ts +51 -1
- package/lib/esm/curve/CurveOps.d.ts.map +1 -1
- package/lib/esm/curve/CurveOps.js +98 -4
- package/lib/esm/curve/CurveOps.js.map +1 -1
- package/lib/esm/curve/LineString3d.d.ts +4 -4
- package/lib/esm/curve/LineString3d.d.ts.map +1 -1
- package/lib/esm/curve/LineString3d.js +8 -8
- package/lib/esm/curve/LineString3d.js.map +1 -1
- package/lib/esm/curve/Query/ConsolidateAdjacentPrimitivesContext.js +3 -3
- package/lib/esm/curve/Query/ConsolidateAdjacentPrimitivesContext.js.map +1 -1
- package/lib/esm/curve/Query/PlanarSubdivision.d.ts +6 -2
- package/lib/esm/curve/Query/PlanarSubdivision.d.ts.map +1 -1
- package/lib/esm/curve/Query/PlanarSubdivision.js +12 -7
- package/lib/esm/curve/Query/PlanarSubdivision.js.map +1 -1
- package/lib/esm/curve/RegionOps.d.ts +9 -4
- package/lib/esm/curve/RegionOps.d.ts.map +1 -1
- package/lib/esm/curve/RegionOps.js +10 -5
- package/lib/esm/curve/RegionOps.js.map +1 -1
- package/lib/esm/curve/internalContexts/CurveCurveIntersectXY.d.ts.map +1 -1
- package/lib/esm/curve/internalContexts/CurveCurveIntersectXY.js +2 -1
- package/lib/esm/curve/internalContexts/CurveCurveIntersectXY.js.map +1 -1
- package/lib/esm/curve/internalContexts/MultiChainCollector.d.ts +4 -4
- package/lib/esm/curve/internalContexts/MultiChainCollector.d.ts.map +1 -1
- package/lib/esm/curve/internalContexts/MultiChainCollector.js +21 -18
- package/lib/esm/curve/internalContexts/MultiChainCollector.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/spiral/DirectSpiral3d.d.ts +2 -2
- package/lib/esm/curve/spiral/DirectSpiral3d.d.ts.map +1 -1
- package/lib/esm/curve/spiral/DirectSpiral3d.js +6 -2
- package/lib/esm/curve/spiral/DirectSpiral3d.js.map +1 -1
- package/lib/esm/curve/spiral/IntegratedSpiral3d.d.ts +2 -2
- package/lib/esm/curve/spiral/IntegratedSpiral3d.d.ts.map +1 -1
- package/lib/esm/curve/spiral/IntegratedSpiral3d.js +6 -2
- package/lib/esm/curve/spiral/IntegratedSpiral3d.js.map +1 -1
- package/lib/esm/curve/spiral/TransitionSpiral3d.d.ts +5 -1
- package/lib/esm/curve/spiral/TransitionSpiral3d.d.ts.map +1 -1
- package/lib/esm/curve/spiral/TransitionSpiral3d.js +0 -3
- package/lib/esm/curve/spiral/TransitionSpiral3d.js.map +1 -1
- package/lib/esm/geometry3d/AngleSweep.d.ts +6 -2
- package/lib/esm/geometry3d/AngleSweep.d.ts.map +1 -1
- package/lib/esm/geometry3d/AngleSweep.js +12 -3
- package/lib/esm/geometry3d/AngleSweep.js.map +1 -1
- package/lib/esm/geometry3d/FrameBuilder.d.ts +2 -1
- package/lib/esm/geometry3d/FrameBuilder.d.ts.map +1 -1
- package/lib/esm/geometry3d/FrameBuilder.js +14 -18
- package/lib/esm/geometry3d/FrameBuilder.js.map +1 -1
- package/lib/esm/geometry3d/Matrix3d.d.ts +1 -1
- package/lib/esm/geometry3d/Matrix3d.js +1 -1
- package/lib/esm/geometry3d/Matrix3d.js.map +1 -1
- package/lib/esm/geometry3d/Point2dVector2d.d.ts +18 -2
- package/lib/esm/geometry3d/Point2dVector2d.d.ts.map +1 -1
- package/lib/esm/geometry3d/Point2dVector2d.js +37 -4
- package/lib/esm/geometry3d/Point2dVector2d.js.map +1 -1
- package/lib/esm/geometry3d/Point3dVector3d.d.ts +1 -1
- package/lib/esm/geometry3d/Point3dVector3d.d.ts.map +1 -1
- package/lib/esm/geometry3d/Point3dVector3d.js +1 -0
- package/lib/esm/geometry3d/Point3dVector3d.js.map +1 -1
- package/lib/esm/geometry3d/PointStreaming.d.ts +8 -0
- package/lib/esm/geometry3d/PointStreaming.d.ts.map +1 -1
- package/lib/esm/geometry3d/PointStreaming.js +18 -2
- 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.d.ts +8 -2
- package/lib/esm/geometry3d/PolylineCompressionByEdgeOffset.d.ts.map +1 -1
- package/lib/esm/geometry3d/PolylineCompressionByEdgeOffset.js +10 -4
- package/lib/esm/geometry3d/PolylineCompressionByEdgeOffset.js.map +1 -1
- package/lib/esm/geometry3d/PolylineOps.d.ts +14 -3
- package/lib/esm/geometry3d/PolylineOps.d.ts.map +1 -1
- package/lib/esm/geometry3d/PolylineOps.js +20 -4
- package/lib/esm/geometry3d/PolylineOps.js.map +1 -1
- package/lib/esm/geometry3d/Range.d.ts +34 -32
- package/lib/esm/geometry3d/Range.d.ts.map +1 -1
- package/lib/esm/geometry3d/Range.js +28 -21
- package/lib/esm/geometry3d/Range.js.map +1 -1
- package/lib/esm/geometry3d/Ray2d.d.ts +16 -6
- package/lib/esm/geometry3d/Ray2d.d.ts.map +1 -1
- package/lib/esm/geometry3d/Ray2d.js +28 -4
- package/lib/esm/geometry3d/Ray2d.js.map +1 -1
- package/lib/esm/geometry3d/Ray3d.d.ts.map +1 -1
- package/lib/esm/geometry3d/Ray3d.js +3 -4
- package/lib/esm/geometry3d/Ray3d.js.map +1 -1
- package/lib/esm/geometry3d/Transform.d.ts +1 -1
- package/lib/esm/geometry3d/Transform.js +1 -1
- package/lib/esm/geometry3d/Transform.js.map +1 -1
- package/lib/esm/geometry3d/XYZProps.d.ts +12 -1
- package/lib/esm/geometry3d/XYZProps.d.ts.map +1 -1
- package/lib/esm/geometry3d/XYZProps.js +16 -1
- package/lib/esm/geometry3d/XYZProps.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/numerics/BezierPolynomials.d.ts.map +1 -1
- package/lib/esm/numerics/BezierPolynomials.js +5 -9
- package/lib/esm/numerics/BezierPolynomials.js.map +1 -1
- package/lib/esm/numerics/SmallSystem.d.ts +13 -7
- package/lib/esm/numerics/SmallSystem.d.ts.map +1 -1
- package/lib/esm/numerics/SmallSystem.js +13 -7
- package/lib/esm/numerics/SmallSystem.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.d.ts +25 -6
- package/lib/esm/polyface/PolyfaceBuilder.d.ts.map +1 -1
- package/lib/esm/polyface/PolyfaceBuilder.js +59 -8
- package/lib/esm/polyface/PolyfaceBuilder.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.d.ts.map +1 -1
- package/lib/esm/polyface/PolyfaceQuery.js +8 -10
- package/lib/esm/polyface/PolyfaceQuery.js.map +1 -1
- package/lib/esm/polyface/RangeTree/Point3dArrayRangeTreeContext.d.ts +8 -5
- package/lib/esm/polyface/RangeTree/Point3dArrayRangeTreeContext.d.ts.map +1 -1
- package/lib/esm/polyface/RangeTree/Point3dArrayRangeTreeContext.js +8 -4
- package/lib/esm/polyface/RangeTree/Point3dArrayRangeTreeContext.js.map +1 -1
- package/lib/esm/polyface/RangeTree/PolyfaceRangeTreeContext.d.ts +3 -3
- package/lib/esm/polyface/RangeTree/PolyfaceRangeTreeContext.d.ts.map +1 -1
- package/lib/esm/polyface/RangeTree/PolyfaceRangeTreeContext.js +1 -1
- package/lib/esm/polyface/RangeTree/PolyfaceRangeTreeContext.js.map +1 -1
- package/lib/esm/polyface/RangeTree/RangeTreeNode.d.ts +4 -2
- package/lib/esm/polyface/RangeTree/RangeTreeNode.d.ts.map +1 -1
- package/lib/esm/polyface/RangeTree/RangeTreeNode.js +9 -12
- package/lib/esm/polyface/RangeTree/RangeTreeNode.js.map +1 -1
- package/lib/esm/polyface/RangeTree/RangeTreeSearchHandlers.d.ts +8 -3
- package/lib/esm/polyface/RangeTree/RangeTreeSearchHandlers.d.ts.map +1 -1
- package/lib/esm/polyface/RangeTree/RangeTreeSearchHandlers.js +13 -6
- package/lib/esm/polyface/RangeTree/RangeTreeSearchHandlers.js.map +1 -1
- package/lib/esm/serialization/DeepCompare.js +1 -1
- package/lib/esm/serialization/DeepCompare.js.map +1 -1
- package/lib/esm/serialization/GeometrySamples.d.ts +2 -1
- package/lib/esm/serialization/GeometrySamples.d.ts.map +1 -1
- package/lib/esm/serialization/GeometrySamples.js +2 -1
- package/lib/esm/serialization/GeometrySamples.js.map +1 -1
- package/lib/esm/topology/Graph.d.ts +38 -12
- package/lib/esm/topology/Graph.d.ts.map +1 -1
- package/lib/esm/topology/Graph.js +92 -24
- package/lib/esm/topology/Graph.js.map +1 -1
- package/lib/esm/topology/HalfEdgeGraphFromIndexedLoopsContext.d.ts +5 -4
- package/lib/esm/topology/HalfEdgeGraphFromIndexedLoopsContext.d.ts.map +1 -1
- package/lib/esm/topology/HalfEdgeGraphFromIndexedLoopsContext.js +6 -5
- package/lib/esm/topology/HalfEdgeGraphFromIndexedLoopsContext.js.map +1 -1
- package/lib/esm/topology/HalfEdgeGraphSearch.d.ts +20 -11
- package/lib/esm/topology/HalfEdgeGraphSearch.d.ts.map +1 -1
- package/lib/esm/topology/HalfEdgeGraphSearch.js +43 -39
- package/lib/esm/topology/HalfEdgeGraphSearch.js.map +1 -1
- package/lib/esm/topology/Merging.d.ts +7 -4
- package/lib/esm/topology/Merging.d.ts.map +1 -1
- package/lib/esm/topology/Merging.js +17 -12
- package/lib/esm/topology/Merging.js.map +1 -1
- package/lib/esm/topology/Triangulation.d.ts +13 -11
- package/lib/esm/topology/Triangulation.d.ts.map +1 -1
- package/lib/esm/topology/Triangulation.js +40 -36
- package/lib/esm/topology/Triangulation.js.map +1 -1
- package/lib/esm/topology/Voronoi.d.ts +195 -0
- package/lib/esm/topology/Voronoi.d.ts.map +1 -0
- package/lib/esm/topology/Voronoi.js +696 -0
- package/lib/esm/topology/Voronoi.js.map +1 -0
- package/lib/esm/topology/XYParitySearchContext.d.ts +1 -1
- package/lib/esm/topology/XYParitySearchContext.d.ts.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,6DAA0D;AAC1D,0DAAuD;AACvD,4DAAyD;AACzD,0DAAuD;AACvD,kDAA+C;AAC/C,iEAA8D;AAC9D,uFAAoF;AACpF,0DAAuD;AACvD,sEAA2D;AAC3D,wDAAqD;AAGrD,6CAAqD;AACrD,oDAAiD;AAEjD,kDAA+C;AAC/C,0FAAuF;AAEvF;;;;;;;GAOG;AACH,MAAa,kBAAmB,SAAQ,uCAAkB;IACxD,wCAAwC;IACxB,kBAAkB,GAAG,kBAAkB,CAAC;IAExD,yCAAyC;IAClC,QAAQ,CAAY;IAC3B,8CAA8C;IACvC,SAAS,CAAa;IAC7B,8CAA8C;IACtC,cAAc,CAAe;IACrC;;;OAGG;IACK,cAAc,CAAgB;IACtC,0EAA0E;IAC1E,IAAW,aAAa,KAAmB,OAAO,IAAI,CAAC,cAAc,KAAK,SAAS,CAAC,CAAC,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC,CAAC;IAC1H,UAAU,CAAuB;IACzC,wCAAwC;IAChC,YAAY,CAAS;IAC7B,kDAAkD;IAC1C,YAAY,CAAY;IAChC,+BAA+B;IAC/B,8HAA8H;IAC9H,YAAoB,UAA8B,EAChD,SAA+B,EAC/B,QAAm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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;;AAjZH,gDAkZC;AACD,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
|
+
{"version":3,"file":"IntegratedSpiral3d.js","sourceRoot":"","sources":["../../../../src/curve/spiral/IntegratedSpiral3d.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAEH,6DAA0D;AAC1D,0DAAuD;AACvD,4DAAyD;AACzD,0DAAuD;AACvD,kDAA+C;AAC/C,iEAA8D;AAC9D,uFAAoF;AACpF,0DAAuD;AACvD,sEAA2D;AAC3D,wDAAqD;AAGrD,6CAAqD;AACrD,oDAAiD;AAEjD,kDAA+C;AAC/C,0FAAuF;AAEvF;;;;;;;GAOG;AACH,MAAa,kBAAmB,SAAQ,uCAAkB;IACxD,wCAAwC;IACxB,kBAAkB,GAAG,kBAAkB,CAAC;IAExD,yCAAyC;IAClC,QAAQ,CAAY;IAC3B,8CAA8C;IACvC,SAAS,CAAa;IAC7B,8CAA8C;IACtC,cAAc,CAAe;IACrC;;;OAGG;IACK,cAAc,CAAgB;IACtC,0EAA0E;IAC1E,IAAW,aAAa,KAAmB,OAAO,IAAI,CAAC,cAAc,KAAK,SAAS,CAAC,CAAC,CAAC,IAAI,CAAC,cA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,CAAC;mBAC7C,IAAI,CAAC,SAAS,CAAC,6BAA6B,CAAC,KAAK,CAAC,SAAS,CAAC;mBAC7D,IAAI,CAAC,YAAY,CAAC,aAAa,CAAC,KAAK,CAAC,YAAY,CAAC;mBACnD,mBAAQ,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;;AApZH,gDAqZC;AACD,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(result?: Point3d): Point3d {\n return this.activeStrokes.startPoint(result);\n }\n /** return the spiral end point. */\n public override endPoint(result?: Point3d): Point3d {\n return this.activeStrokes.endPoint(result);\n }\n /** test if the local to world transform places the spiral xy plane into `plane` */\n public isInPlane(plane: Plane3dByOriginAndUnitNormal): boolean {\n return plane.isPointInPlane(this.localToWorld.origin as Point3d)\n && Geometry.isSameCoordinate(0.0, this.localToWorld.matrix.dotColumnX(plane.getNormalRef()))\n && Geometry.isSameCoordinate(0.0, this.localToWorld.matrix.dotColumnY(plane.getNormalRef()));\n }\n /** Return length of the spiral. 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 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,3 +1,7 @@
|
|
|
1
|
+
/** @packageDocumentation
|
|
2
|
+
* @module Curve
|
|
3
|
+
*/
|
|
4
|
+
import { BSplineCurve3d } from "../../bspline/BSplineCurve";
|
|
1
5
|
import { Matrix3d } from "../../geometry3d/Matrix3d";
|
|
2
6
|
import { Range1d, Range3d } from "../../geometry3d/Range";
|
|
3
7
|
import { Segment1d } from "../../geometry3d/Segment1d";
|
|
@@ -112,7 +116,7 @@ export declare abstract class TransitionSpiral3d extends CurvePrimitive {
|
|
|
112
116
|
* for an aggregate instance (e.g., LineString3d, CurveChainWithDistanceIndex), use RegionOps.constructCurveXYOffset() instead.
|
|
113
117
|
* @param offsetDistanceOrOptions offset distance (positive to left of the instance curve), or options object
|
|
114
118
|
*/
|
|
115
|
-
constructOffsetXY(offsetDistanceOrOptions: number | OffsetOptions):
|
|
119
|
+
constructOffsetXY(offsetDistanceOrOptions: number | OffsetOptions): BSplineCurve3d | undefined;
|
|
116
120
|
/** extend the range by the strokes of the spiral */
|
|
117
121
|
extendRange(rangeToExtend: Range3d, transform?: Transform): void;
|
|
118
122
|
/** return the range of spiral between fractions of the activeStrokes.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TransitionSpiral3d.d.ts","sourceRoot":"","sources":["../../../../src/curve/spiral/TransitionSpiral3d.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"TransitionSpiral3d.d.ts","sourceRoot":"","sources":["../../../../src/curve/spiral/TransitionSpiral3d.ts"],"names":[],"mappings":"AAKA;;GAEG;AAEH,OAAO,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AAE5D,OAAO,EAAE,QAAQ,EAAE,MAAM,2BAA2B,CAAC;AACrD,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAC;AAC1D,OAAO,EAAE,SAAS,EAAE,MAAM,4BAA4B,CAAC;AACvD,OAAO,EAAE,SAAS,EAAE,MAAM,4BAA4B,CAAC;AACvD,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAGnD,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC/C,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AACjD,OAAO,EAAE,+BAA+B,EAAE,MAAM,mCAAmC,CAAC;AAEpF,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,kCAAkC,CAAC;AACjE,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,wBAAwB,CAAC;AACpD;;;;;;;;;;;;GAYG;AACH,MAAM,MAAM,wBAAwB,GAAG,UAAU,GAAG,OAAO,GA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E,SAAS,GAAG,OAAO;IAQ5G;;;;OAIG;IACa,uBAAuB,CAAC,GAAG,EAAE,QAAQ,GAAG,KAAK,EAAE,OAAO,CAAC,EAAE,OAAO,GAAG,OAAO,GAAG,SAAS;CAGvG"}
|
|
@@ -5,9 +5,6 @@
|
|
|
5
5
|
*--------------------------------------------------------------------------------------------*/
|
|
6
6
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
7
|
exports.TransitionSpiral3d = void 0;
|
|
8
|
-
/** @packageDocumentation
|
|
9
|
-
* @module Curve
|
|
10
|
-
*/
|
|
11
8
|
const Geometry_1 = require("../../Geometry");
|
|
12
9
|
const Range_1 = require("../../geometry3d/Range");
|
|
13
10
|
const Segment1d_1 = require("../../geometry3d/Segment1d");
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TransitionSpiral3d.js","sourceRoot":"","sources":["../../../../src/curve/spiral/TransitionSpiral3d.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;;;AAE/F;;GAEG;AAEH,6CAA0C;AAE1C,kDAA0D;AAC1D,0DAAuD;AACvD,0DAAuD;AACvD,sDAAmD;AACnD,mFAAgF;AAChF,6FAA0F;AAE1F,oDAAiD;AAuCjD;;;;;;;;;;;;GAYG;AACH,MAAsB,kBAAmB,SAAQ,+BAAc;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,GA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AAM,OAAO,GAAG,6BAAa,CAAC,MAAM,CAAC,uBAAuB,CAAC,CAAC;QAC9D,MAAM,OAAO,GAAG,IAAI,2CAAoB,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,eAAO,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,mBAAQ,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,qDAAyB,CAAC,kCAAkC,CAAC,IAAI,EAAE,GAAG,EAAE,OAAO,CAAC,CAAC;IAC1F,CAAC;CACF;AAlKD,gDAkKC","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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;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,eAAO,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,mBAAQ,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,qDAAyB,CAAC,kCAAkC,CAAC,IAAI,EAAE,GAAG,EAAE,OAAO,CAAC,CAAC;IAC1F,CAAC;CACF;AAlKD,gDAkKC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n\n/** @packageDocumentation\n * @module Curve\n */\n\nimport { BSplineCurve3d } from \"../../bspline/BSplineCurve\";\nimport { Geometry } from \"../../Geometry\";\nimport { Matrix3d } from \"../../geometry3d/Matrix3d\";\nimport { Range1d, Range3d } from \"../../geometry3d/Range\";\nimport { Segment1d } from \"../../geometry3d/Segment1d\";\nimport { Transform } from \"../../geometry3d/Transform\";\nimport { CurvePrimitive } from \"../CurvePrimitive\";\nimport { CurveOffsetXYHandler } from \"../internalContexts/CurveOffsetXYHandler\";\nimport { PlaneAltitudeRangeContext } from \"../internalContexts/PlaneAltitudeRangeContext\";\nimport { LineString3d } from \"../LineString3d\";\nimport { OffsetOptions } from \"../OffsetOptions\";\nimport { TransitionConditionalProperties } from \"./TransitionConditionalProperties\";\n\nimport type { Vector3d } from \"../../geometry3d/Point3dVector3d\";\nimport type { Ray3d } from \"../../geometry3d/Ray3d\";\n/**\n * This is the set of valid type names for \"integrated\" spirals\n * * Behavior is expressed by a `NormalizedTransition` snap function.\n * * The snap function varies smoothly from f(0)=0 to f(1)=1\n * * The various snap functions are:\n * * clothoid: linear\n * * biquadratic: 2 quadratics pieced together, joining with 1st derivative continuity at f(0.) = 0.5, with zero 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): BSplineCurve3d | undefined {\n const options = OffsetOptions.create(offsetDistanceOrOptions);\n const handler = new CurveOffsetXYHandler(this, options.leftOffsetDistance);\n this.emitStrokableParts(handler, options.strokeOptions);\n return handler.claimResult();\n }\n /** extend the range by the strokes of the spiral */\n public override extendRange(rangeToExtend: Range3d, transform?: Transform): void {\n 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"]}
|
|
@@ -91,8 +91,12 @@ export declare class AngleSweep implements BeJSONFunctions {
|
|
|
91
91
|
interpolate(fraction: number, other: AngleSweep): AngleSweep;
|
|
92
92
|
/** Copy from other AngleSweep. */
|
|
93
93
|
setFrom(other: AngleSweep): void;
|
|
94
|
-
/**
|
|
95
|
-
|
|
94
|
+
/**
|
|
95
|
+
* Create a full circle sweep (CCW).
|
|
96
|
+
* @param startRadians start angle in radians. Defaults to 0.
|
|
97
|
+
* @param result optional preallocated object to populate and return.
|
|
98
|
+
*/
|
|
99
|
+
static create360(startRadians?: number, result?: AngleSweep): AngleSweep;
|
|
96
100
|
/** Create a sweep from the south pole to the north pole (-90 to +90). */
|
|
97
101
|
static createFullLatitude(): AngleSweep;
|
|
98
102
|
/** Reverse the start and end angle in place. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AngleSweep.d.ts","sourceRoot":"","sources":["../../../src/geometry3d/AngleSweep.ts"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,EAAE,eAAe,EAAE,eAAe,EAAY,MAAM,aAAa,CAAC;AACzE,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAChC,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAE9D;;;;;;;;;;;;;;;;;;GAkBG;AACH,qBAAa,UAAW,YAAW,eAAe;IAChD,OAAO,CAAC,SAAS,CAAS;IAC1B,OAAO,CAAC,SAAS,CAAS;IAC1B,iEAAiE;IACjE,IAAW,YAAY,WAEtB;IACD,+DAA+D;IAC/D,IAAW,UAAU,WAEpB;IACD,8DAA8D;IAC9D,IAAW,YAAY,WAEtB;IACD,iEAAiE;IACjE,IAAW,YAAY,WAEtB;IACD,+DAA+D;IAC/D,IAAW,UAAU,WAEpB;IACD,8DAA8D;IAC9D,IAAW,YAAY,WAEtB;IACD,sFAAsF;IACtF,IAAW,OAAO,YAEjB;IACD,8CAA8C;IAC9C,IAAW,UAAU,UAEpB;IACD,4CAA4C;IAC5C,IAAW,QAAQ,UAElB;IACD;;;;;OAKG;WACW,MAAM,CAAC,IAAI,CAAC,EAAE,UAAU,GAAG,KAAK,GAAG,UAAU;IAO3D;;;;;;;;;;OAUG;IACH,OAAO;IAIP;;;OAGG;IACI,kBAAkB,CAAC,YAAY,GAAE,MAAU,EAAE,UAAU,GAAE,MAAsB;IAQtF,uDAAuD;IAChD,kBAAkB,CAAC,YAAY,GAAE,MAAU,EAAE,UAAU,GAAE,MAAc;IAG9E;;;OAGG;WACW,qBAAqB,CAAC,YAAY,GAAE,MAAU,EAAE,UAAU,GAAE,MAAsB,EAAE,MAAM,CAAC,EAAE,UAAU,GAAG,UAAU;IA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G5H;;;;;;;;;;;OAWG;IACI,qBAAqB,CAAC,KAAK,EAAE,KAAK,EAAE,kBAAkB,GAAE,OAAe,EAAE,gBAAgB,GAAE,MAAY,GAAG,MAAM;IAIvH,6FAA6F;WAC/E,mBAAmB,CAAC,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,gBAAgB,GAAE,OAAc,GAAG,OAAO;IASjI,4DAA4D;IACrD,gBAAgB,CAAC,OAAO,EAAE,MAAM,EAAE,gBAAgB,GAAE,OAAc,GAAG,OAAO;IAGnF,6DAA6D;IACtD,cAAc,CAAC,KAAK,EAAE,KAAK,GAAG,OAAO;IAG5C;;;;;;;;OAQG;IACI,WAAW,CAAC,IAAI,CAAC,EAAE,GAAG;IAc7B,+CAA+C;WACjC,QAAQ,CAAC,IAAI,CAAC,EAAE,eAAe,GAAG,UAAU;IAK1D;;;OAGG;IACI,MAAM,IAAI,GAAG;IAGpB;;;;;OAKG;IACI,6BAA6B,CAAC,KAAK,EAAE,UAAU,EAAE,SAAS,GAAE,MAAmC,GAAG,OAAO;IAKhH;;;;;OAKG;IACI,0BAA0B,CAAC,KAAK,EAAE,UAAU,EAAE,SAAS,GAAE,MAAmC,GAAG,OAAO;IAI7G;;;;;OAKG;IACI,aAAa,CAAC,KAAK,EAAE,UAAU,GAAG,OAAO;CAGjD"}
|
|
@@ -158,10 +158,19 @@ class AngleSweep {
|
|
|
158
158
|
this._radians0 = other._radians0;
|
|
159
159
|
this._radians1 = other._radians1;
|
|
160
160
|
}
|
|
161
|
-
/**
|
|
162
|
-
|
|
161
|
+
/**
|
|
162
|
+
* Create a full circle sweep (CCW).
|
|
163
|
+
* @param startRadians start angle in radians. Defaults to 0.
|
|
164
|
+
* @param result optional preallocated object to populate and return.
|
|
165
|
+
*/
|
|
166
|
+
static create360(startRadians, result) {
|
|
163
167
|
startRadians = startRadians ? startRadians : 0.0;
|
|
164
|
-
|
|
168
|
+
const endRadians = startRadians + 2.0 * Math.PI;
|
|
169
|
+
if (result) {
|
|
170
|
+
result.setStartEndRadians(startRadians, endRadians);
|
|
171
|
+
return result;
|
|
172
|
+
}
|
|
173
|
+
return new AngleSweep(startRadians, endRadians);
|
|
165
174
|
}
|
|
166
175
|
/** Create a sweep from the south pole to the north pole (-90 to +90). */
|
|
167
176
|
static createFullLatitude() {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AngleSweep.js","sourceRoot":"","sources":["../../../src/geometry3d/AngleSweep.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAEH,0CAAyE;AACzE,mCAAgC;AAGhC;;;;;;;;;;;;;;;;;;GAkBG;AACH,MAAa,UAAU;IACb,SAAS,CAAS;IAClB,SAAS,CAAS;IAC1B,iEAAiE;IACjE,IAAW,YAAY;QACrB,OAAO,aAAK,CAAC,gBAAgB,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;IAChD,CAAC;IACD,+DAA+D;IAC/D,IAAW,UAAU;QACnB,OAAO,aAAK,CAAC,gBAAgB,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;IAChD,CAAC;IACD,8DAA8D;IAC9D,IAAW,YAAY;QACrB,OAAO,aAAK,CAAC,gBAAgB,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC;IACnD,CAAC;IACD,iEAAiE;IACjE,IAAW,YAAY;QACrB,OAAO,IAAI,CAAC,SAAS,CAAC;IACxB,CAAC;IACD,+DAA+D;IAC/D,IAAW,UAAU;QACnB,OAAO,IAAI,CAAC,SAAS,CAAC;IACxB,CAAC;IACD,8DAA8D;IAC9D,IAAW,YAAY;QACrB,OAAO,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC,SAAS,CAAC;IACzC,CAAC;IACD,sFAAsF;IACtF,IAAW,OAAO;QAChB,OAAO,aAAK,CAAC,iCAAiC,CAAC,CAAC,EAAE,IAAI,CAAC,YAAY,CAAC,CAAC;IACvE,CAAC;IACD,8CAA8C;I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IACI,aAAa,CAAC,KAAiB;QACpC,OAAO,IAAI,CAAC,0BAA0B,CAAC,KAAK,CAAC,CAAC;IAChD,CAAC;CACF;AAziBD,gCAyiBC","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 CartesianGeometry\n */\n\nimport { AngleSweepProps, BeJSONFunctions, Geometry } from \"../Geometry\";\nimport { Angle } from \"./Angle\";\nimport { GrowableFloat64Array } from \"./GrowableFloat64Array\";\n\n/**\n * An `AngleSweep` is a pair of angles at start and end of an interval.\n *\n * * For stroking purposes, the \"included interval\" is all angles numerically reached\n * by `theta = start + f * (end - start)`, where `0 <= f <= 1`.\n * * This stroking formula is simple numbers -- 2PI shifts are not involved.\n * * 2PI shifts do become important in the reverse mapping of an angle to a fraction.\n * * Angles greater than 360 and less than 0 are fine as endpoints.\n * * An AngleSweep determines orientation only _in concert with a reference vector_, e.g., a plane normal like (0,0,1).\n * * Be careful reading orientation from an AngleSweep without a reference vector!\n * * If \"start < end\" the angles in the sweep proceed counterclockwise around the reference vector.\n * * If \"start > end\" the angles in the sweep proceed clockwise around the reference vector.\n * * (350,370) covers the same angles as (-10,10), and both sweeps are counterclockwise around the reference vector.\n * * (370,350) covers the same angles as (10,-10), and both sweeps are clockwise around the reference vector.\n * * (370,350) covers the same angles as (-10,10), but the sweeps have opposite orientation.\n * * Math details can be found at docs/learning/geometry/Angle.md .\n * * Visualization can be found at https://www.itwinjs.org/sandbox/SaeedTorabi/AngleSweep .\n * @public\n */\nexport class AngleSweep implements BeJSONFunctions {\n private _radians0: number;\n private _radians1: number;\n /** Read-property for degrees at the start of this AngleSweep. */\n public get startDegrees() {\n return Angle.radiansToDegrees(this._radians0);\n }\n /** Read-property for degrees at the end of this AngleSweep. */\n public get endDegrees() {\n return Angle.radiansToDegrees(this._radians1);\n }\n /** Read-property for signed start-to-end sweep in degrees. */\n public get sweepDegrees() {\n return Angle.radiansToDegrees(this.sweepRadians);\n }\n /** Read-property for degrees at the start of this AngleSweep. */\n public get startRadians() {\n return this._radians0;\n }\n /** Read-property for degrees at the end of this AngleSweep. */\n public get endRadians() {\n return this._radians1;\n }\n /** Read-property for signed start-to-end sweep in radians. */\n public get sweepRadians() {\n return this._radians1 - this._radians0;\n }\n /** Whether the sweep angles are within smallAngle tolerance, without period shift. */\n public get isEmpty() {\n return Angle.isAlmostEqualRadiansNoPeriodShift(0, this.sweepRadians);\n }\n /** Return the (strongly typed) start angle */\n public get startAngle() {\n return Angle.createRadians(this._radians0);\n }\n /** Return the (strongly typed) end angle */\n public get endAngle() {\n return Angle.createRadians(this._radians1);\n }\n /**\n * Create a sweep as one of\n * * A clone of a given sweep\n * * 0 to given angle\n * * full circle if no arg given (sweep 0 to 360 degrees)\n */\n public static create(data?: AngleSweep | Angle): AngleSweep {\n if (data instanceof AngleSweep)\n return data.clone();\n if (data instanceof Angle)\n return new AngleSweep(0, data.radians);\n return AngleSweep.create360();\n }\n /**\n * (private) constructor with start and end angles in radians.\n * * Use explicitly named static methods to clarify intent and units of inputs:\n *\n * * createStartEndRadians (startRadians:number, endRadians:number)\n * * createStartEndDegrees (startDegrees:number, endDegrees:number)\n * * createStartEnd (startAngle:Angle, endAngle:Angle)\n * * createStartSweepRadians (startRadians:number, sweepRadians:number)\n * * createStartSweepDegrees (startDegrees:number, sweepDegrees:number)\n * * createStartSweep (startAngle:Angle, sweepAngle:Angle)\n */\n private constructor(startRadians: number = 0, endRadians: number = 0) {\n this._radians0 = startRadians;\n this._radians1 = endRadians;\n }\n /**\n * Directly set the start and end angles in radians\n * * If the difference between startRadians and endRadians is greater than 360, the function limits the angle sweep to 360.\n */\n public setStartEndRadians(startRadians: number = 0, endRadians: number = 2.0 * Math.PI) {\n const delta = endRadians - startRadians;\n if (Angle.isFullCircleRadians(delta)) {\n endRadians = startRadians + (delta > 0 ? 2.0 : -2.0) * Math.PI;\n }\n this._radians0 = startRadians;\n this._radians1 = endRadians;\n }\n /** Directly set the start and end angles in degrees */\n public setStartEndDegrees(startDegrees: number = 0, endDegrees: number = 360.0) {\n this.setStartEndRadians(Angle.degreesToRadians(startDegrees), Angle.degreesToRadians(endDegrees));\n }\n /**\n * Create an AngleSweep from start and end angles given in radians.\n * * If the difference between startRadians and endRadians is greater than 360, the function limits the angle sweep to 360.\n */\n public static createStartEndRadians(startRadians: number = 0, endRadians: number = 2.0 * Math.PI, result?: AngleSweep): AngleSweep {\n result = result ? result : new AngleSweep();\n result.setStartEndRadians(startRadians, endRadians);\n return result;\n }\n /** Return the AngleSweep obtained by subtracting radians from the start and end angles of this sweep. */\n public cloneMinusRadians(radians: number): AngleSweep {\n return new AngleSweep(this._radians0 - radians, this._radians1 - radians);\n }\n /** Create an AngleSweep from start and end angles given in degrees. */\n public static createStartEndDegrees(startDegrees: number = 0, endDegrees: number = 360, result?: AngleSweep): AngleSweep {\n return AngleSweep.createStartEndRadians(Angle.degreesToRadians(startDegrees), Angle.degreesToRadians(endDegrees), result);\n }\n /** Create an angle sweep from strongly typed start and end angles */\n public static createStartEnd(startAngle: Angle, endAngle: Angle, result?: AngleSweep): AngleSweep {\n result = result ? result : new AngleSweep();\n result.setStartEndRadians(startAngle.radians, endAngle.radians);\n return result;\n }\n /** Create an AngleSweep from start and end angles given in radians. */\n public static createStartSweepRadians(startRadians: number = 0, sweepRadians: number = Math.PI, result?: AngleSweep): AngleSweep {\n result = result ? result : new AngleSweep();\n result.setStartEndRadians(startRadians, startRadians + sweepRadians);\n return result;\n }\n /** Create an AngleSweep from start and sweep given in degrees. */\n public static createStartSweepDegrees(startDegrees: number = 0, sweepDegrees: number = 360, result?: AngleSweep): AngleSweep {\n return AngleSweep.createStartEndRadians(Angle.degreesToRadians(startDegrees), Angle.degreesToRadians(startDegrees + sweepDegrees), result);\n }\n /** Create an angle sweep with limits given as (strongly typed) angles for start and sweep */\n public static createStartSweep(startAngle: Angle, sweepAngle: Angle, result?: AngleSweep): AngleSweep {\n return AngleSweep.createStartSweepRadians(startAngle.radians, sweepAngle.radians, result);\n }\n /** Return a sweep with limits interpolated between this and other. */\n public interpolate(fraction: number, other: AngleSweep): AngleSweep {\n return new AngleSweep(\n Geometry.interpolate(this._radians0, fraction, other._radians0),\n Geometry.interpolate(this._radians1, fraction, other._radians1),\n );\n }\n /** Copy from other AngleSweep. */\n public setFrom(other: AngleSweep) {\n this._radians0 = other._radians0;\n this._radians1 = other._radians1;\n }\n /** Create a full circle sweep (CCW). startRadians defaults to 0 */\n public static create360(startRadians?: number): AngleSweep {\n startRadians = startRadians ? startRadians : 0.0;\n return new AngleSweep(startRadians, startRadians + 2.0 * Math.PI);\n }\n /** Create a sweep from the south pole to the north pole (-90 to +90). */\n public static createFullLatitude() {\n return AngleSweep.createStartEndRadians(-0.5 * Math.PI, 0.5 * Math.PI);\n }\n /** Reverse the start and end angle in place. */\n public reverseInPlace() {\n const tmp = this._radians0;\n this._radians0 = this._radians1;\n this._radians1 = tmp;\n }\n /**\n * Return a sweep for the \"other\" part of the circle.\n * @param reverseDirection true to move backwards (CW) from start to end, false to more forwards (CCW) from start to end.\n */\n public cloneComplement(reverseDirection: boolean = false, result?: AngleSweep): AngleSweep {\n const s = this.sweepRadians >= 0 ? 2.0 : -2.0;\n if (reverseDirection)\n return AngleSweep.createStartEndRadians(this.startRadians, this.endRadians - s * Math.PI, result);\n else\n return AngleSweep.createStartEndRadians(this.endRadians, this.startRadians + s * Math.PI, result);\n }\n /** Restrict start and end angles to the degree range [-90,+90]. */\n public capLatitudeInPlace(): void {\n const limit = 0.5 * Math.PI;\n this._radians0 = Geometry.clampToStartEnd(this._radians0, -limit, limit);\n this._radians1 = Geometry.clampToStartEnd(this._radians1, -limit, limit);\n }\n /**\n * Restrict [[sweepDegrees]] to the range [-360, 360].\n * The start angle and sign of the sweep angle are unchanged.\n */\n public clampToFullCircle(result?: AngleSweep): AngleSweep {\n result = result ?? new AngleSweep();\n const sweepRadians = Geometry.clampToStartEnd(this.sweepRadians, -Angle.pi2Radians, Angle.pi2Radians);\n result.setStartEndRadians(this._radians0, this._radians0 + sweepRadians);\n return result;\n }\n /** Ask if the sweep is counterclockwise, i.e. positive sweep. */\n public get isCCW(): boolean {\n return this._radians1 >= this._radians0;\n }\n /** Ask if the sweep is a full circle. */\n public get isFullCircle(): boolean {\n return Angle.isFullCircleRadians(this.sweepRadians);\n }\n /** Ask if the sweep is a full sweep from south pole to north pole. */\n public get isFullLatitudeSweep(): boolean {\n const a = Math.PI * 0.5;\n return Angle.isAlmostEqualRadiansNoPeriodShift(this._radians0, -a)\n && Angle.isAlmostEqualRadiansNoPeriodShift(this._radians1, a);\n }\n /** Return a clone of this sweep. */\n public clone(): AngleSweep {\n return new AngleSweep(this._radians0, this._radians1);\n }\n /** Convert fractional position in the sweep to radians. */\n public fractionToRadians(fraction: number): number {\n return fraction < 0.5 ?\n this._radians0 + fraction * this.sweepRadians :\n this._radians1 + (fraction - 1.0) * this.sweepRadians;\n }\n /** Convert fractional position in the sweep to strongly typed Angle object. */\n public fractionToAngle(fraction: number) {\n return Angle.createRadians(this.fractionToRadians(fraction));\n }\n /**\n * Return 2PI divided by the sweep radians.\n * * This is the number of fractional intervals required to cover a whole circle.\n * @returns period of the sweep, or 1 if sweep is empty.\n */\n public fractionPeriod(): number {\n return this.isEmpty ? 1.0 : Angle.pi2Radians / Math.abs(this.sweepRadians);\n }\n /**\n * Return the fractionalized position of the given angle (as Angle) computed without consideration of\n * 2PI period and without consideration of angle sweep direction (CW or CCW).\n * * the start angle is at fraction 0\n * * the end angle is at fraction 1\n * * interior angles are between 0 and 1\n * * negative fraction for angles \"before\" the start angle if start < end\n * * fraction larger than one for angles \"after\" the end angle if start < end\n * * fraction larger than one for angles \"before\" the start angle if start > end\n * * negative fraction for angles \"after\" the end angle if start > end\n * * does not allow period shift\n * @returns unbounded fraction, or 1 if sweep is empty.\n */\n public angleToUnboundedFraction(theta: Angle): number {\n return this.isEmpty ? 1.0 : (theta.radians - this._radians0) / this.sweepRadians;\n }\n\n /**\n * Convert a sweep fraction to the equivalent period-shifted fraction inside the sweep, or within one period of zero\n * on the desired side.\n * @param fraction fraction of the sweep.\n * @param radians0 start angle of sweep (in radians).\n * @param radians1 end angle of sweep (in radians).\n * @param toNegativeFraction exterior fraction handling:\n * * if true, return `fraction` period-shifted to within one period of the start\n * * if false, return `fraction` period-shifted to within one period of the end\n * * if undefined, return the period-shift of `fraction` closest to [0,1].\n * @returns period-shifted fraction. If `fraction` is already in [0,1], or the sweep is empty, then `fraction` is\n * returned unchanged.\n */\n public static fractionToSignedPeriodicFractionStartEnd(fraction: number, radians0: number, radians1: number, toNegativeFraction?: boolean): number {\n const sweep = radians1 - radians0;\n if (Angle.isAlmostEqualRadiansNoPeriodShift(0, sweep))\n return fraction; // empty sweep\n if (Geometry.isIn01(fraction))\n return fraction;\n const period = Angle.pi2Radians / Math.abs(sweep);\n fraction = fraction % period; // period-shifted equivalent fraction closest to 0 with same sign as fraction\n if (fraction + period < 1)\n fraction += period; // it's really an interior fraction\n if (Geometry.isIn01(fraction))\n return fraction;\n if (toNegativeFraction === true)\n return fraction < 0 ? fraction : fraction - period;\n if (toNegativeFraction === false)\n return fraction > 1 ? fraction : fraction + period;\n const fractionDistFrom01 = fraction < 0 ? -fraction : fraction - 1;\n const fraction2 = fraction < 0 ? fraction + period : fraction - period; // period-shift with opposite sign\n const fraction2DistFrom01 = fraction2 < 0 ? -fraction2 : fraction2 - 1;\n return fractionDistFrom01 < fraction2DistFrom01 ? fraction : fraction2; // choose the period-shift closer to [0,1]\n }\n /**\n * Convert a sweep fraction to the equivalent period-shifted fraction inside this sweep, or within one period of\n * zero on the desired side.\n * @param fraction fraction of the sweep.\n * @param toNegativeFraction exterior fraction handling:\n * * if true, return `fraction` period-shifted to within one period of the start\n * * if false, return `fraction` period-shifted to within one period of the end\n * * if undefined, return the period-shift of `fraction` closest to [0,1].\n * @returns period-shifted fraction. If `fraction` is already in [0,1], or the sweep is empty, then `fraction` is\n * returned unchanged.\n */\n public fractionToSignedPeriodicFraction(fraction: number, toNegativeFraction?: boolean): number {\n return AngleSweep.fractionToSignedPeriodicFractionStartEnd(fraction, this._radians0, this._radians1, toNegativeFraction);\n }\n\n /**\n * Return the fractionalized position of the given angle (as radians), computed with consideration of 2PI period.\n * * consider radians0 as `start` angle of the sweep and radians1 as `end` angle of the sweep\n * * the start angle is at fraction 0\n * * the end angle is at fraction 1\n * * interior angles are between 0 and 1\n * * all exterior angles are at fractions greater than 1\n * * allows period shift\n * @param radians input angle (in radians)\n * @param radians0 start angle of sweep (in radians)\n * @param radians1 end angle of sweep (in radians)\n * @param zeroSweepDefault return value when the sweep is empty (default 0)\n * @returns nonnegative fraction, or `zeroSweepDefault` if the sweep is empty.\n */\n public static radiansToPositivePeriodicFractionStartEnd(radians: number, radians0: number, radians1: number, zeroSweepDefault: number = 0.0): number {\n const zeroSweepMarker = Geometry.largeCoordinateResult;\n let fraction = this.radiansToSignedPeriodicFractionStartEnd(radians, radians0, radians1, zeroSweepMarker);\n if (fraction === zeroSweepMarker)\n return zeroSweepDefault;\n if (fraction < 0) {\n const period = Angle.pi2Radians / Math.abs(radians1 - radians0);\n fraction += period;\n }\n return fraction;\n }\n /**\n * Return the fractionalized position of the given angle (as radians), computed with consideration of 2PI period.\n * * the start angle is at fraction 0\n * * the end angle is at fraction 1\n * * interior angles are between 0 and 1\n * * all exterior angles are at fractions greater than 1\n * * allows period shift\n * @param radians input angle (in radians)\n * @param zeroSweepDefault return value when this sweep is empty (default 0)\n * @returns nonnegative fraction, or `zeroSweepDefault` if the sweep is empty.\n */\n public radiansToPositivePeriodicFraction(radians: number, zeroSweepDefault: number = 0.0): number {\n return AngleSweep.radiansToPositivePeriodicFractionStartEnd(radians, this._radians0, this._radians1, zeroSweepDefault);\n }\n /**\n * Return the fractionalized position of the given angle (as Angle), computed with consideration of 2PI period.\n * * the start angle is at fraction 0\n * * the end angle is at fraction 1\n * * interior angles are between 0 and 1\n * * all exterior angles are at fractions greater than 1\n * * allows period shift\n * @param theta input angle\n * @param zeroSweepDefault return value when this sweep is empty (default 0)\n * @returns nonnegative fraction, or `zeroSweepDefault` if the sweep is empty.\n */\n public angleToPositivePeriodicFraction(theta: Angle, zeroSweepDefault: number = 0.0): number {\n return this.radiansToPositivePeriodicFraction(theta.radians, zeroSweepDefault);\n }\n /**\n * Return the fractionalized position of the given array of angles (as radian), computed with consideration of 2PI period.\n * * fraction is always positive\n * * the start angle is at fraction 0\n * * the end angle is at fraction 1\n * * interior angles are between 0 and 1\n * * all exterior angles are at fractions greater than 1\n * * allows period shift\n */\n public radiansArrayToPositivePeriodicFractions(data: GrowableFloat64Array) {\n const n = data.length;\n for (let i = 0; i < n; i++) {\n data.reassign(i, this.radiansToPositivePeriodicFraction(data.atUncheckedIndex(i)));\n }\n }\n /**\n * Return the fractionalized position of the given angle (as radians) computed with consideration of\n * 2PI period and with consideration of angle sweep direction (CW or CCW).\n * * the start angle is at fraction 0\n * * the end angle is at fraction 1\n * * interior angles are between 0 and 1\n * * negative fraction for angles \"before\" the start angle\n * * fraction larger than one for angles \"after\" the end angle\n * * allows period shift\n * @param radians input angle (in radians)\n * @param radians0 start angle of sweep (in radians)\n * @param radians1 end angle of sweep (in radians)\n * @param zeroSweepDefault return value when the sweep is empty (default 0)\n * @returns fraction, or `zeroSweepDefault` if the sweep is empty.\n */\n public static radiansToSignedPeriodicFractionStartEnd(radians: number, radians0: number, radians1: number, zeroSweepDefault: number = 0.0): number {\n const sweep = radians1 - radians0;\n if (Angle.isAlmostEqualRadiansNoPeriodShift(0, sweep))\n return zeroSweepDefault;\n if (Angle.isAlmostEqualRadiansAllowPeriodShift(radians0, radians1)) {\n // for sweep = 2nPi !== 0, allow matching without period shift, else we never return 1.0\n if (Angle.isAlmostEqualRadiansNoPeriodShift(radians, radians0))\n return 0.0;\n if (Angle.isAlmostEqualRadiansNoPeriodShift(radians, radians1))\n return 1.0;\n } else {\n if (Angle.isAlmostEqualRadiansAllowPeriodShift(radians, radians0))\n return 0.0;\n if (Angle.isAlmostEqualRadiansAllowPeriodShift(radians, radians1))\n return 1.0;\n }\n const fraction = (radians - radians0) / sweep;\n return this.fractionToSignedPeriodicFractionStartEnd(fraction, radians0, radians1, fraction < 0);\n }\n /**\n * Return the fractionalized position of the given angle (as radians) computed with consideration of\n * 2PI period and with consideration of angle sweep direction (CW or CCW).\n * * the start angle is at fraction 0\n * * the end angle is at fraction 1\n * * interior angles are between 0 and 1\n * * negative fraction for angles \"before\" the start angle\n * * fraction larger than one for angles \"after\" the end angle\n * * allows period shift\n * @param radians input angle (in radians)\n * @param zeroSweepDefault return value when this sweep is empty (default 0)\n * @returns fraction, or `zeroSweepDefault` if this sweep is empty.\n */\n public radiansToSignedPeriodicFraction(radians: number, zeroSweepDefault: number = 0.0): number {\n return AngleSweep.radiansToSignedPeriodicFractionStartEnd(radians, this._radians0, this._radians1, zeroSweepDefault);\n }\n /**\n * Return the fractionalized position of the given angle (as Angle) computed with consideration of\n * 2PI period and with consideration of angle sweep direction (CW or CCW).\n * * the start angle is at fraction 0\n * * the end angle is at fraction 1\n * * interior angles are between 0 and 1\n * * negative fraction for angles \"before\" the start angle\n * * fraction larger than one for angles \"after\" the end angle\n * * allows period shift\n * @param theta input angle\n * @param zeroSweepDefault return value when this sweep is empty (default 0)\n * @returns fraction, or `zeroSweepDefault` if this sweep is empty.\n */\n public angleToSignedPeriodicFraction(theta: Angle, zeroSweepDefault: number = 0.0): number {\n return this.radiansToSignedPeriodicFraction(theta.radians, zeroSweepDefault);\n }\n\n /**\n * Return the fractionalized position of the given radian angle with respect to the sweep.\n * * The start angle returns fraction 0\n * * The end angle returns fraction 1\n * * Interior angles (and their multiples of 2PI) return fractions in [0,1].\n * * Exterior angles return fractions outside [0,1] according to `toNegativeFraction`.\n * @param radians input angle (in radians)\n * @param radians0 start angle of sweep (in radians)\n * @param radians1 end angle of sweep (in radians)\n * @param toNegativeFraction convert an exterior angle to a negative number (true), or to\n * a number greater than one (false, default). If false, this is just [[radiansToPositivePeriodicFractionStartEnd]].\n * @param zeroSweepDefault return value when the sweep is empty (default 0).\n * @returns fraction, or `zeroSweepDefault` if the sweep is empty\n */\n public static radiansToSignedFractionStartEnd(radians: number, radians0: number, radians1: number, toNegativeFraction: boolean = false, zeroSweepDefault: number = 0.0): number {\n const zeroSweepMarker = Geometry.largeCoordinateResult;\n let fraction = this.radiansToSignedPeriodicFractionStartEnd(radians, radians0, radians1, zeroSweepMarker);\n if (fraction === zeroSweepMarker)\n return zeroSweepDefault;\n if ((toNegativeFraction && fraction > 1) || (!toNegativeFraction && fraction < 0)) {\n let period = Angle.pi2Radians / Math.abs(radians1 - radians0);\n if (toNegativeFraction)\n period = -period;\n fraction += period;\n }\n return fraction;\n }\n /**\n * Return the fractionalized position of the given radian angle with respect to this sweep.\n * * The start angle returns fraction 0\n * * The end angle returns fraction 1\n * * Interior angles (and their multiples of 2PI) return fractions in [0,1].\n * * Exterior angles return fractions outside [0,1] according to `toNegativeFraction`.\n * @param radians input angle (in radians)\n * @param toNegativeFraction convert an exterior angle to a negative number (true), or to\n * a number greater than one (false, default). If false, this is just [[radiansToPositivePeriodicFraction]].\n * @param zeroSweepDefault return value when this sweep is empty (default 0).\n * @returns fraction, or `zeroSweepDefault` if this sweep is empty\n */\n public radiansToSignedFraction(radians: number, toNegativeFraction: boolean = false, zeroSweepDefault: number = 0.0): number {\n return AngleSweep.radiansToSignedFractionStartEnd(radians, this._radians0, this._radians1, toNegativeFraction, zeroSweepDefault);\n }\n /**\n * Return the fractionalized position of the given angle with respect to this sweep.\n * * The start angle returns fraction 0\n * * The end angle returns fraction 1\n * * Interior angles (and their multiples of 2PI) return fractions in [0,1].\n * * Exterior angles return fractions outside [0,1] according to `toNegativeFraction`.\n * @param theta input angle\n * @param toNegativeFraction convert an exterior angle to a negative number (true), or to\n * a number greater than one (false, default). If false, this is just [[angleToPositivePeriodicFraction]].\n * @param zeroSweepDefault return value when this sweep is empty (default 0).\n * @returns fraction, or `zeroSweepDefault` if this sweep is empty\n */\n public angleToSignedFraction(theta: Angle, toNegativeFraction: boolean = false, zeroSweepDefault: number = 0.0): number {\n return this.radiansToSignedFraction(theta.radians, toNegativeFraction, zeroSweepDefault);\n }\n\n /** Test if the given angle (as radians) is within sweep (between radians0 and radians1) */\n public static isRadiansInStartEnd(radians: number, radians0: number, radians1: number, allowPeriodShift: boolean = true): boolean {\n const delta0 = radians - radians0;\n const delta1 = radians - radians1;\n if (delta0 * delta1 <= 0.0)\n return true;\n if (radians0 === radians1)\n return allowPeriodShift ? Angle.isAlmostEqualRadiansAllowPeriodShift(radians, radians0) : Angle.isAlmostEqualRadiansNoPeriodShift(radians, radians0);\n return allowPeriodShift ? this.radiansToPositivePeriodicFractionStartEnd(radians, radians0, radians1, 1000.0) <= 1.0 : false;\n }\n /** Test if the given angle (as radians) is within sweep */\n public isRadiansInSweep(radians: number, allowPeriodShift: boolean = true): boolean {\n return AngleSweep.isRadiansInStartEnd(radians, this.startRadians, this.endRadians, allowPeriodShift);\n }\n /** Test if the given angle (as Angle) is within the sweep */\n public isAngleInSweep(angle: Angle): boolean {\n return this.isRadiansInSweep(angle.radians);\n }\n /**\n * Set this AngleSweep from various sources:\n * * if json is undefined, a full-circle sweep is returned.\n * * If json is an AngleSweep object, it is cloned\n * * If json is an array of 2 numbers, those numbers are start and end angles in degrees.\n * * If `json.degrees` is an array of 2 numbers, those numbers are start and end angles in degrees.\n * * If `json.radians` is an array of 2 numbers, those numbers are start and end angles in radians.\n * * Otherwise, a full-circle sweep is returned.\n */\n public setFromJSON(json?: any) {\n if (!json)\n this.setStartEndRadians(); // default full circle\n else if (json instanceof AngleSweep)\n this.setFrom(json);\n else if (Geometry.isNumberArray(json.degrees, 2))\n this.setStartEndDegrees(json.degrees[0], json.degrees[1]);\n else if (Geometry.isNumberArray(json.radians, 2))\n this.setStartEndRadians(json.radians[0], json.radians[1]);\n else if (Geometry.isNumberArray(json, 2))\n this.setStartEndDegrees(json[0], json[1]);\n else\n this.setStartEndRadians(); // default full circle\n }\n /** Create an AngleSweep from a json object. */\n public static fromJSON(json?: AngleSweepProps): AngleSweep {\n const result = AngleSweep.create360();\n result.setFromJSON(json);\n return result;\n }\n /**\n * Convert an AngleSweep to a JSON object.\n * @return {*} [startAngleInDegrees, endAngleInDegrees]\n */\n public toJSON(): any {\n return [this.startDegrees, this.endDegrees];\n }\n /**\n * Test if two angle sweeps match within the given tolerance.\n * * Period shifts are allowed, but orientations must be the same.\n * @param other sweep to compare to this instance\n * @param radianTol optional radian tolerance, default value `Geometry.smallAngleRadians`\n */\n public isAlmostEqualAllowPeriodShift(other: AngleSweep, radianTol: number = Geometry.smallAngleRadians): boolean {\n return this.isCCW === other.isCCW // this rules out equating opposite sweeps like [0,-100] and [0,260]\n && Angle.isAlmostEqualRadiansAllowPeriodShift(this._radians0, other._radians0, radianTol)\n && Angle.isAlmostEqualRadiansAllowPeriodShift(this.sweepRadians, other.sweepRadians, radianTol);\n }\n /**\n * Test if two angle sweeps match within the given tolerance.\n * * Period shifts are not allowed.\n * @param other sweep to compare to this instance\n * @param radianTol optional radian tolerance, default value `Geometry.smallAngleRadians`\n */\n public isAlmostEqualNoPeriodShift(other: AngleSweep, radianTol: number = Geometry.smallAngleRadians): boolean {\n return Angle.isAlmostEqualRadiansNoPeriodShift(this._radians0, other._radians0, radianTol)\n && Angle.isAlmostEqualRadiansNoPeriodShift(this.sweepRadians, other.sweepRadians, radianTol);\n }\n /**\n * Test if start and end angles match with radians tolerance.\n * * Period shifts are not allowed.\n * * This function is equivalent to isAlmostEqualNoPeriodShift. It is present for consistency with other classes.\n * However, it is recommended to use isAlmostEqualNoPeriodShift which has a clearer name.\n */\n public isAlmostEqual(other: AngleSweep): boolean {\n return this.isAlmostEqualNoPeriodShift(other);\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"AngleSweep.js","sourceRoot":"","sources":["../../../src/geometry3d/AngleSweep.ts"],"names":[],"mappings":";AAAA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AAE,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC;;YAE1C,IAAI,CAAC,kBAAkB,EAAE,CAAC,CAAC,sBAAsB;IACrD,CAAC;IACD,+CAA+C;IACxC,MAAM,CAAC,QAAQ,CAAC,IAAsB;QAC3C,MAAM,MAAM,GAAG,UAAU,CAAC,SAAS,EAAE,CAAC;QACtC,MAAM,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC;QACzB,OAAO,MAAM,CAAC;IAChB,CAAC;IACD;;;OAGG;IACI,MAAM;QACX,OAAO,CAAC,IAAI,CAAC,YAAY,EAAE,IAAI,CAAC,UAAU,CAAC,CAAC;IAC9C,CAAC;IACD;;;;;OAKG;IACI,6BAA6B,CAAC,KAAiB,EAAE,YAAoB,mBAAQ,CAAC,iBAAiB;QACpG,OAAO,IAAI,CAAC,KAAK,KAAK,KAAK,CAAC,KAAK,CAAC,oEAAoE;eACjG,aAAK,CAAC,oCAAoC,CAAC,IAAI,CAAC,SAAS,EAAE,KAAK,CAAC,SAAS,EAAE,SAAS,CAAC;eACtF,aAAK,CAAC,oCAAoC,CAAC,IAAI,CAAC,YAAY,EAAE,KAAK,CAAC,YAAY,EAAE,SAAS,CAAC,CAAC;IACpG,CAAC;IACD;;;;;OAKG;IACI,0BAA0B,CAAC,KAAiB,EAAE,YAAoB,mBAAQ,CAAC,iBAAiB;QACjG,OAAO,aAAK,CAAC,iCAAiC,CAAC,IAAI,CAAC,SAAS,EAAE,KAAK,CAAC,SAAS,EAAE,SAAS,CAAC;eACrF,aAAK,CAAC,iCAAiC,CAAC,IAAI,CAAC,YAAY,EAAE,KAAK,CAAC,YAAY,EAAE,SAAS,CAAC,CAAC;IACjG,CAAC;IACD;;;;;OAKG;IACI,aAAa,CAAC,KAAiB;QACpC,OAAO,IAAI,CAAC,0BAA0B,CAAC,KAAK,CAAC,CAAC;IAChD,CAAC;CACF;AAljBD,gCAkjBC","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 CartesianGeometry\n */\n\nimport { AngleSweepProps, BeJSONFunctions, Geometry } from \"../Geometry\";\nimport { Angle } from \"./Angle\";\nimport { GrowableFloat64Array } from \"./GrowableFloat64Array\";\n\n/**\n * An `AngleSweep` is a pair of angles at start and end of an interval.\n *\n * * For stroking purposes, the \"included interval\" is all angles numerically reached\n * by `theta = start + f * (end - start)`, where `0 <= f <= 1`.\n * * This stroking formula is simple numbers -- 2PI shifts are not involved.\n * * 2PI shifts do become important in the reverse mapping of an angle to a fraction.\n * * Angles greater than 360 and less than 0 are fine as endpoints.\n * * An AngleSweep determines orientation only _in concert with a reference vector_, e.g., a plane normal like (0,0,1).\n * * Be careful reading orientation from an AngleSweep without a reference vector!\n * * If \"start < end\" the angles in the sweep proceed counterclockwise around the reference vector.\n * * If \"start > end\" the angles in the sweep proceed clockwise around the reference vector.\n * * (350,370) covers the same angles as (-10,10), and both sweeps are counterclockwise around the reference vector.\n * * (370,350) covers the same angles as (10,-10), and both sweeps are clockwise around the reference vector.\n * * (370,350) covers the same angles as (-10,10), but the sweeps have opposite orientation.\n * * Math details can be found at docs/learning/geometry/Angle.md .\n * * Visualization can be found at https://www.itwinjs.org/sandbox/SaeedTorabi/AngleSweep .\n * @public\n */\nexport class AngleSweep implements BeJSONFunctions {\n private _radians0: number;\n private _radians1: number;\n /** Read-property for degrees at the start of this AngleSweep. */\n public get startDegrees() {\n return Angle.radiansToDegrees(this._radians0);\n }\n /** Read-property for degrees at the end of this AngleSweep. */\n public get endDegrees() {\n return Angle.radiansToDegrees(this._radians1);\n }\n /** Read-property for signed start-to-end sweep in degrees. */\n public get sweepDegrees() {\n return Angle.radiansToDegrees(this.sweepRadians);\n }\n /** Read-property for degrees at the start of this AngleSweep. */\n public get startRadians() {\n return this._radians0;\n }\n /** Read-property for degrees at the end of this AngleSweep. */\n public get endRadians() {\n return this._radians1;\n }\n /** Read-property for signed start-to-end sweep in radians. */\n public get sweepRadians() {\n return this._radians1 - this._radians0;\n }\n /** Whether the sweep angles are within smallAngle tolerance, without period shift. */\n public get isEmpty() {\n return Angle.isAlmostEqualRadiansNoPeriodShift(0, this.sweepRadians);\n }\n /** Return the (strongly typed) start angle */\n public get startAngle() {\n return Angle.createRadians(this._radians0);\n }\n /** Return the (strongly typed) end angle */\n public get endAngle() {\n return Angle.createRadians(this._radians1);\n }\n /**\n * Create a sweep as one of\n * * A clone of a given sweep\n * * 0 to given angle\n * * full circle if no arg given (sweep 0 to 360 degrees)\n */\n public static create(data?: AngleSweep | Angle): AngleSweep {\n if (data instanceof AngleSweep)\n return data.clone();\n if (data instanceof Angle)\n return new AngleSweep(0, data.radians);\n return AngleSweep.create360();\n }\n /**\n * (private) constructor with start and end angles in radians.\n * * Use explicitly named static methods to clarify intent and units of inputs:\n *\n * * createStartEndRadians (startRadians:number, endRadians:number)\n * * createStartEndDegrees (startDegrees:number, endDegrees:number)\n * * createStartEnd (startAngle:Angle, endAngle:Angle)\n * * createStartSweepRadians (startRadians:number, sweepRadians:number)\n * * createStartSweepDegrees (startDegrees:number, sweepDegrees:number)\n * * createStartSweep (startAngle:Angle, sweepAngle:Angle)\n */\n private constructor(startRadians: number = 0, endRadians: number = 0) {\n this._radians0 = startRadians;\n this._radians1 = endRadians;\n }\n /**\n * Directly set the start and end angles in radians\n * * If the difference between startRadians and endRadians is greater than 360, the function limits the angle sweep to 360.\n */\n public setStartEndRadians(startRadians: number = 0, endRadians: number = 2.0 * Math.PI) {\n const delta = endRadians - startRadians;\n if (Angle.isFullCircleRadians(delta)) {\n endRadians = startRadians + (delta > 0 ? 2.0 : -2.0) * Math.PI;\n }\n this._radians0 = startRadians;\n this._radians1 = endRadians;\n }\n /** Directly set the start and end angles in degrees */\n public setStartEndDegrees(startDegrees: number = 0, endDegrees: number = 360.0) {\n this.setStartEndRadians(Angle.degreesToRadians(startDegrees), Angle.degreesToRadians(endDegrees));\n }\n /**\n * Create an AngleSweep from start and end angles given in radians.\n * * If the difference between startRadians and endRadians is greater than 360, the function limits the angle sweep to 360.\n */\n public static createStartEndRadians(startRadians: number = 0, endRadians: number = 2.0 * Math.PI, result?: AngleSweep): AngleSweep {\n result = result ? result : new AngleSweep();\n result.setStartEndRadians(startRadians, endRadians);\n return result;\n }\n /** Return the AngleSweep obtained by subtracting radians from the start and end angles of this sweep. */\n public cloneMinusRadians(radians: number): AngleSweep {\n return new AngleSweep(this._radians0 - radians, this._radians1 - radians);\n }\n /** Create an AngleSweep from start and end angles given in degrees. */\n public static createStartEndDegrees(startDegrees: number = 0, endDegrees: number = 360, result?: AngleSweep): AngleSweep {\n return AngleSweep.createStartEndRadians(Angle.degreesToRadians(startDegrees), Angle.degreesToRadians(endDegrees), result);\n }\n /** Create an angle sweep from strongly typed start and end angles */\n public static createStartEnd(startAngle: Angle, endAngle: Angle, result?: AngleSweep): AngleSweep {\n result = result ? result : new AngleSweep();\n result.setStartEndRadians(startAngle.radians, endAngle.radians);\n return result;\n }\n /** Create an AngleSweep from start and end angles given in radians. */\n public static createStartSweepRadians(startRadians: number = 0, sweepRadians: number = Math.PI, result?: AngleSweep): AngleSweep {\n result = result ? result : new AngleSweep();\n result.setStartEndRadians(startRadians, startRadians + sweepRadians);\n return result;\n }\n /** Create an AngleSweep from start and sweep given in degrees. */\n public static createStartSweepDegrees(startDegrees: number = 0, sweepDegrees: number = 360, result?: AngleSweep): AngleSweep {\n return AngleSweep.createStartEndRadians(Angle.degreesToRadians(startDegrees), Angle.degreesToRadians(startDegrees + sweepDegrees), result);\n }\n /** Create an angle sweep with limits given as (strongly typed) angles for start and sweep */\n public static createStartSweep(startAngle: Angle, sweepAngle: Angle, result?: AngleSweep): AngleSweep {\n return AngleSweep.createStartSweepRadians(startAngle.radians, sweepAngle.radians, result);\n }\n /** Return a sweep with limits interpolated between this and other. */\n public interpolate(fraction: number, other: AngleSweep): AngleSweep {\n return new AngleSweep(\n Geometry.interpolate(this._radians0, fraction, other._radians0),\n Geometry.interpolate(this._radians1, fraction, other._radians1),\n );\n }\n /** Copy from other AngleSweep. */\n public setFrom(other: AngleSweep) {\n this._radians0 = other._radians0;\n this._radians1 = other._radians1;\n }\n /**\n * Create a full circle sweep (CCW).\n * @param startRadians start angle in radians. Defaults to 0.\n * @param result optional preallocated object to populate and return.\n */\n public static create360(startRadians?: number, result?: AngleSweep): AngleSweep {\n startRadians = startRadians ? startRadians : 0.0;\n const endRadians = startRadians + 2.0 * Math.PI;\n if (result) {\n result.setStartEndRadians(startRadians, endRadians);\n return result;\n }\n return new AngleSweep(startRadians, endRadians);\n }\n /** Create a sweep from the south pole to the north pole (-90 to +90). */\n public static createFullLatitude() {\n return AngleSweep.createStartEndRadians(-0.5 * Math.PI, 0.5 * Math.PI);\n }\n /** Reverse the start and end angle in place. */\n public reverseInPlace() {\n const tmp = this._radians0;\n this._radians0 = this._radians1;\n this._radians1 = tmp;\n }\n /**\n * Return a sweep for the \"other\" part of the circle.\n * @param reverseDirection true to move backwards (CW) from start to end, false to more forwards (CCW) from start to end.\n */\n public cloneComplement(reverseDirection: boolean = false, result?: AngleSweep): AngleSweep {\n const s = this.sweepRadians >= 0 ? 2.0 : -2.0;\n if (reverseDirection)\n return AngleSweep.createStartEndRadians(this.startRadians, this.endRadians - s * Math.PI, result);\n else\n return AngleSweep.createStartEndRadians(this.endRadians, this.startRadians + s * Math.PI, result);\n }\n /** Restrict start and end angles to the degree range [-90,+90]. */\n public capLatitudeInPlace(): void {\n const limit = 0.5 * Math.PI;\n this._radians0 = Geometry.clampToStartEnd(this._radians0, -limit, limit);\n this._radians1 = Geometry.clampToStartEnd(this._radians1, -limit, limit);\n }\n /**\n * Restrict [[sweepDegrees]] to the range [-360, 360].\n * The start angle and sign of the sweep angle are unchanged.\n */\n public clampToFullCircle(result?: AngleSweep): AngleSweep {\n result = result ?? new AngleSweep();\n const sweepRadians = Geometry.clampToStartEnd(this.sweepRadians, -Angle.pi2Radians, Angle.pi2Radians);\n result.setStartEndRadians(this._radians0, this._radians0 + sweepRadians);\n return result;\n }\n /** Ask if the sweep is counterclockwise, i.e. positive sweep. */\n public get isCCW(): boolean {\n return this._radians1 >= this._radians0;\n }\n /** Ask if the sweep is a full circle. */\n public get isFullCircle(): boolean {\n return Angle.isFullCircleRadians(this.sweepRadians);\n }\n /** Ask if the sweep is a full sweep from south pole to north pole. */\n public get isFullLatitudeSweep(): boolean {\n const a = Math.PI * 0.5;\n return Angle.isAlmostEqualRadiansNoPeriodShift(this._radians0, -a)\n && Angle.isAlmostEqualRadiansNoPeriodShift(this._radians1, a);\n }\n /** Return a clone of this sweep. */\n public clone(): AngleSweep {\n return new AngleSweep(this._radians0, this._radians1);\n }\n /** Convert fractional position in the sweep to radians. */\n public fractionToRadians(fraction: number): number {\n return fraction < 0.5 ?\n this._radians0 + fraction * this.sweepRadians :\n this._radians1 + (fraction - 1.0) * this.sweepRadians;\n }\n /** Convert fractional position in the sweep to strongly typed Angle object. */\n public fractionToAngle(fraction: number) {\n return Angle.createRadians(this.fractionToRadians(fraction));\n }\n /**\n * Return 2PI divided by the sweep radians.\n * * This is the number of fractional intervals required to cover a whole circle.\n * @returns period of the sweep, or 1 if sweep is empty.\n */\n public fractionPeriod(): number {\n return this.isEmpty ? 1.0 : Angle.pi2Radians / Math.abs(this.sweepRadians);\n }\n /**\n * Return the fractionalized position of the given angle (as Angle) computed without consideration of\n * 2PI period and without consideration of angle sweep direction (CW or CCW).\n * * the start angle is at fraction 0\n * * the end angle is at fraction 1\n * * interior angles are between 0 and 1\n * * negative fraction for angles \"before\" the start angle if start < end\n * * fraction larger than one for angles \"after\" the end angle if start < end\n * * fraction larger than one for angles \"before\" the start angle if start > end\n * * negative fraction for angles \"after\" the end angle if start > end\n * * does not allow period shift\n * @returns unbounded fraction, or 1 if sweep is empty.\n */\n public angleToUnboundedFraction(theta: Angle): number {\n return this.isEmpty ? 1.0 : (theta.radians - this._radians0) / this.sweepRadians;\n }\n\n /**\n * Convert a sweep fraction to the equivalent period-shifted fraction inside the sweep, or within one period of zero\n * on the desired side.\n * @param fraction fraction of the sweep.\n * @param radians0 start angle of sweep (in radians).\n * @param radians1 end angle of sweep (in radians).\n * @param toNegativeFraction exterior fraction handling:\n * * if true, return `fraction` period-shifted to within one period of the start\n * * if false, return `fraction` period-shifted to within one period of the end\n * * if undefined, return the period-shift of `fraction` closest to [0,1].\n * @returns period-shifted fraction. If `fraction` is already in [0,1], or the sweep is empty, then `fraction` is\n * returned unchanged.\n */\n public static fractionToSignedPeriodicFractionStartEnd(fraction: number, radians0: number, radians1: number, toNegativeFraction?: boolean): number {\n const sweep = radians1 - radians0;\n if (Angle.isAlmostEqualRadiansNoPeriodShift(0, sweep))\n return fraction; // empty sweep\n if (Geometry.isIn01(fraction))\n return fraction;\n const period = Angle.pi2Radians / Math.abs(sweep);\n fraction = fraction % period; // period-shifted equivalent fraction closest to 0 with same sign as fraction\n if (fraction + period < 1)\n fraction += period; // it's really an interior fraction\n if (Geometry.isIn01(fraction))\n return fraction;\n if (toNegativeFraction === true)\n return fraction < 0 ? fraction : fraction - period;\n if (toNegativeFraction === false)\n return fraction > 1 ? fraction : fraction + period;\n const fractionDistFrom01 = fraction < 0 ? -fraction : fraction - 1;\n const fraction2 = fraction < 0 ? fraction + period : fraction - period; // period-shift with opposite sign\n const fraction2DistFrom01 = fraction2 < 0 ? -fraction2 : fraction2 - 1;\n return fractionDistFrom01 < fraction2DistFrom01 ? fraction : fraction2; // choose the period-shift closer to [0,1]\n }\n /**\n * Convert a sweep fraction to the equivalent period-shifted fraction inside this sweep, or within one period of\n * zero on the desired side.\n * @param fraction fraction of the sweep.\n * @param toNegativeFraction exterior fraction handling:\n * * if true, return `fraction` period-shifted to within one period of the start\n * * if false, return `fraction` period-shifted to within one period of the end\n * * if undefined, return the period-shift of `fraction` closest to [0,1].\n * @returns period-shifted fraction. If `fraction` is already in [0,1], or the sweep is empty, then `fraction` is\n * returned unchanged.\n */\n public fractionToSignedPeriodicFraction(fraction: number, toNegativeFraction?: boolean): number {\n return AngleSweep.fractionToSignedPeriodicFractionStartEnd(fraction, this._radians0, this._radians1, toNegativeFraction);\n }\n\n /**\n * Return the fractionalized position of the given angle (as radians), computed with consideration of 2PI period.\n * * consider radians0 as `start` angle of the sweep and radians1 as `end` angle of the sweep\n * * the start angle is at fraction 0\n * * the end angle is at fraction 1\n * * interior angles are between 0 and 1\n * * all exterior angles are at fractions greater than 1\n * * allows period shift\n * @param radians input angle (in radians)\n * @param radians0 start angle of sweep (in radians)\n * @param radians1 end angle of sweep (in radians)\n * @param zeroSweepDefault return value when the sweep is empty (default 0)\n * @returns nonnegative fraction, or `zeroSweepDefault` if the sweep is empty.\n */\n public static radiansToPositivePeriodicFractionStartEnd(radians: number, radians0: number, radians1: number, zeroSweepDefault: number = 0.0): number {\n const zeroSweepMarker = Geometry.largeCoordinateResult;\n let fraction = this.radiansToSignedPeriodicFractionStartEnd(radians, radians0, radians1, zeroSweepMarker);\n if (fraction === zeroSweepMarker)\n return zeroSweepDefault;\n if (fraction < 0) {\n const period = Angle.pi2Radians / Math.abs(radians1 - radians0);\n fraction += period;\n }\n return fraction;\n }\n /**\n * Return the fractionalized position of the given angle (as radians), computed with consideration of 2PI period.\n * * the start angle is at fraction 0\n * * the end angle is at fraction 1\n * * interior angles are between 0 and 1\n * * all exterior angles are at fractions greater than 1\n * * allows period shift\n * @param radians input angle (in radians)\n * @param zeroSweepDefault return value when this sweep is empty (default 0)\n * @returns nonnegative fraction, or `zeroSweepDefault` if the sweep is empty.\n */\n public radiansToPositivePeriodicFraction(radians: number, zeroSweepDefault: number = 0.0): number {\n return AngleSweep.radiansToPositivePeriodicFractionStartEnd(radians, this._radians0, this._radians1, zeroSweepDefault);\n }\n /**\n * Return the fractionalized position of the given angle (as Angle), computed with consideration of 2PI period.\n * * the start angle is at fraction 0\n * * the end angle is at fraction 1\n * * interior angles are between 0 and 1\n * * all exterior angles are at fractions greater than 1\n * * allows period shift\n * @param theta input angle\n * @param zeroSweepDefault return value when this sweep is empty (default 0)\n * @returns nonnegative fraction, or `zeroSweepDefault` if the sweep is empty.\n */\n public angleToPositivePeriodicFraction(theta: Angle, zeroSweepDefault: number = 0.0): number {\n return this.radiansToPositivePeriodicFraction(theta.radians, zeroSweepDefault);\n }\n /**\n * Return the fractionalized position of the given array of angles (as radian), computed with consideration of 2PI period.\n * * fraction is always positive\n * * the start angle is at fraction 0\n * * the end angle is at fraction 1\n * * interior angles are between 0 and 1\n * * all exterior angles are at fractions greater than 1\n * * allows period shift\n */\n public radiansArrayToPositivePeriodicFractions(data: GrowableFloat64Array) {\n const n = data.length;\n for (let i = 0; i < n; i++) {\n data.reassign(i, this.radiansToPositivePeriodicFraction(data.atUncheckedIndex(i)));\n }\n }\n /**\n * Return the fractionalized position of the given angle (as radians) computed with consideration of\n * 2PI period and with consideration of angle sweep direction (CW or CCW).\n * * the start angle is at fraction 0\n * * the end angle is at fraction 1\n * * interior angles are between 0 and 1\n * * negative fraction for angles \"before\" the start angle\n * * fraction larger than one for angles \"after\" the end angle\n * * allows period shift\n * @param radians input angle (in radians)\n * @param radians0 start angle of sweep (in radians)\n * @param radians1 end angle of sweep (in radians)\n * @param zeroSweepDefault return value when the sweep is empty (default 0)\n * @returns fraction, or `zeroSweepDefault` if the sweep is empty.\n */\n public static radiansToSignedPeriodicFractionStartEnd(radians: number, radians0: number, radians1: number, zeroSweepDefault: number = 0.0): number {\n const sweep = radians1 - radians0;\n if (Angle.isAlmostEqualRadiansNoPeriodShift(0, sweep))\n return zeroSweepDefault;\n if (Angle.isAlmostEqualRadiansAllowPeriodShift(radians0, radians1)) {\n // for sweep = 2nPi !== 0, allow matching without period shift, else we never return 1.0\n if (Angle.isAlmostEqualRadiansNoPeriodShift(radians, radians0))\n return 0.0;\n if (Angle.isAlmostEqualRadiansNoPeriodShift(radians, radians1))\n return 1.0;\n } else {\n if (Angle.isAlmostEqualRadiansAllowPeriodShift(radians, radians0))\n return 0.0;\n if (Angle.isAlmostEqualRadiansAllowPeriodShift(radians, radians1))\n return 1.0;\n }\n const fraction = (radians - radians0) / sweep;\n return this.fractionToSignedPeriodicFractionStartEnd(fraction, radians0, radians1, fraction < 0);\n }\n /**\n * Return the fractionalized position of the given angle (as radians) computed with consideration of\n * 2PI period and with consideration of angle sweep direction (CW or CCW).\n * * the start angle is at fraction 0\n * * the end angle is at fraction 1\n * * interior angles are between 0 and 1\n * * negative fraction for angles \"before\" the start angle\n * * fraction larger than one for angles \"after\" the end angle\n * * allows period shift\n * @param radians input angle (in radians)\n * @param zeroSweepDefault return value when this sweep is empty (default 0)\n * @returns fraction, or `zeroSweepDefault` if this sweep is empty.\n */\n public radiansToSignedPeriodicFraction(radians: number, zeroSweepDefault: number = 0.0): number {\n return AngleSweep.radiansToSignedPeriodicFractionStartEnd(radians, this._radians0, this._radians1, zeroSweepDefault);\n }\n /**\n * Return the fractionalized position of the given angle (as Angle) computed with consideration of\n * 2PI period and with consideration of angle sweep direction (CW or CCW).\n * * the start angle is at fraction 0\n * * the end angle is at fraction 1\n * * interior angles are between 0 and 1\n * * negative fraction for angles \"before\" the start angle\n * * fraction larger than one for angles \"after\" the end angle\n * * allows period shift\n * @param theta input angle\n * @param zeroSweepDefault return value when this sweep is empty (default 0)\n * @returns fraction, or `zeroSweepDefault` if this sweep is empty.\n */\n public angleToSignedPeriodicFraction(theta: Angle, zeroSweepDefault: number = 0.0): number {\n return this.radiansToSignedPeriodicFraction(theta.radians, zeroSweepDefault);\n }\n\n /**\n * Return the fractionalized position of the given radian angle with respect to the sweep.\n * * The start angle returns fraction 0\n * * The end angle returns fraction 1\n * * Interior angles (and their multiples of 2PI) return fractions in [0,1].\n * * Exterior angles return fractions outside [0,1] according to `toNegativeFraction`.\n * @param radians input angle (in radians)\n * @param radians0 start angle of sweep (in radians)\n * @param radians1 end angle of sweep (in radians)\n * @param toNegativeFraction convert an exterior angle to a negative number (true), or to\n * a number greater than one (false, default). If false, this is just [[radiansToPositivePeriodicFractionStartEnd]].\n * @param zeroSweepDefault return value when the sweep is empty (default 0).\n * @returns fraction, or `zeroSweepDefault` if the sweep is empty\n */\n public static radiansToSignedFractionStartEnd(radians: number, radians0: number, radians1: number, toNegativeFraction: boolean = false, zeroSweepDefault: number = 0.0): number {\n const zeroSweepMarker = Geometry.largeCoordinateResult;\n let fraction = this.radiansToSignedPeriodicFractionStartEnd(radians, radians0, radians1, zeroSweepMarker);\n if (fraction === zeroSweepMarker)\n return zeroSweepDefault;\n if ((toNegativeFraction && fraction > 1) || (!toNegativeFraction && fraction < 0)) {\n let period = Angle.pi2Radians / Math.abs(radians1 - radians0);\n if (toNegativeFraction)\n period = -period;\n fraction += period;\n }\n return fraction;\n }\n /**\n * Return the fractionalized position of the given radian angle with respect to this sweep.\n * * The start angle returns fraction 0\n * * The end angle returns fraction 1\n * * Interior angles (and their multiples of 2PI) return fractions in [0,1].\n * * Exterior angles return fractions outside [0,1] according to `toNegativeFraction`.\n * @param radians input angle (in radians)\n * @param toNegativeFraction convert an exterior angle to a negative number (true), or to\n * a number greater than one (false, default). If false, this is just [[radiansToPositivePeriodicFraction]].\n * @param zeroSweepDefault return value when this sweep is empty (default 0).\n * @returns fraction, or `zeroSweepDefault` if this sweep is empty\n */\n public radiansToSignedFraction(radians: number, toNegativeFraction: boolean = false, zeroSweepDefault: number = 0.0): number {\n return AngleSweep.radiansToSignedFractionStartEnd(radians, this._radians0, this._radians1, toNegativeFraction, zeroSweepDefault);\n }\n /**\n * Return the fractionalized position of the given angle with respect to this sweep.\n * * The start angle returns fraction 0\n * * The end angle returns fraction 1\n * * Interior angles (and their multiples of 2PI) return fractions in [0,1].\n * * Exterior angles return fractions outside [0,1] according to `toNegativeFraction`.\n * @param theta input angle\n * @param toNegativeFraction convert an exterior angle to a negative number (true), or to\n * a number greater than one (false, default). If false, this is just [[angleToPositivePeriodicFraction]].\n * @param zeroSweepDefault return value when this sweep is empty (default 0).\n * @returns fraction, or `zeroSweepDefault` if this sweep is empty\n */\n public angleToSignedFraction(theta: Angle, toNegativeFraction: boolean = false, zeroSweepDefault: number = 0.0): number {\n return this.radiansToSignedFraction(theta.radians, toNegativeFraction, zeroSweepDefault);\n }\n\n /** Test if the given angle (as radians) is within sweep (between radians0 and radians1) */\n public static isRadiansInStartEnd(radians: number, radians0: number, radians1: number, allowPeriodShift: boolean = true): boolean {\n const delta0 = radians - radians0;\n const delta1 = radians - radians1;\n if (delta0 * delta1 <= 0.0)\n return true;\n if (radians0 === radians1)\n return allowPeriodShift ? Angle.isAlmostEqualRadiansAllowPeriodShift(radians, radians0) : Angle.isAlmostEqualRadiansNoPeriodShift(radians, radians0);\n return allowPeriodShift ? this.radiansToPositivePeriodicFractionStartEnd(radians, radians0, radians1, 1000.0) <= 1.0 : false;\n }\n /** Test if the given angle (as radians) is within sweep */\n public isRadiansInSweep(radians: number, allowPeriodShift: boolean = true): boolean {\n return AngleSweep.isRadiansInStartEnd(radians, this.startRadians, this.endRadians, allowPeriodShift);\n }\n /** Test if the given angle (as Angle) is within the sweep */\n public isAngleInSweep(angle: Angle): boolean {\n return this.isRadiansInSweep(angle.radians);\n }\n /**\n * Set this AngleSweep from various sources:\n * * if json is undefined, a full-circle sweep is returned.\n * * If json is an AngleSweep object, it is cloned\n * * If json is an array of 2 numbers, those numbers are start and end angles in degrees.\n * * If `json.degrees` is an array of 2 numbers, those numbers are start and end angles in degrees.\n * * If `json.radians` is an array of 2 numbers, those numbers are start and end angles in radians.\n * * Otherwise, a full-circle sweep is returned.\n */\n public setFromJSON(json?: any) {\n if (!json)\n this.setStartEndRadians(); // default full circle\n else if (json instanceof AngleSweep)\n this.setFrom(json);\n else if (Geometry.isNumberArray(json.degrees, 2))\n this.setStartEndDegrees(json.degrees[0], json.degrees[1]);\n else if (Geometry.isNumberArray(json.radians, 2))\n this.setStartEndRadians(json.radians[0], json.radians[1]);\n else if (Geometry.isNumberArray(json, 2))\n this.setStartEndDegrees(json[0], json[1]);\n else\n this.setStartEndRadians(); // default full circle\n }\n /** Create an AngleSweep from a json object. */\n public static fromJSON(json?: AngleSweepProps): AngleSweep {\n const result = AngleSweep.create360();\n result.setFromJSON(json);\n return result;\n }\n /**\n * Convert an AngleSweep to a JSON object.\n * @return {*} [startAngleInDegrees, endAngleInDegrees]\n */\n public toJSON(): any {\n return [this.startDegrees, this.endDegrees];\n }\n /**\n * Test if two angle sweeps match within the given tolerance.\n * * Period shifts are allowed, but orientations must be the same.\n * @param other sweep to compare to this instance\n * @param radianTol optional radian tolerance, default value `Geometry.smallAngleRadians`\n */\n public isAlmostEqualAllowPeriodShift(other: AngleSweep, radianTol: number = Geometry.smallAngleRadians): boolean {\n return this.isCCW === other.isCCW // this rules out equating opposite sweeps like [0,-100] and [0,260]\n && Angle.isAlmostEqualRadiansAllowPeriodShift(this._radians0, other._radians0, radianTol)\n && Angle.isAlmostEqualRadiansAllowPeriodShift(this.sweepRadians, other.sweepRadians, radianTol);\n }\n /**\n * Test if two angle sweeps match within the given tolerance.\n * * Period shifts are not allowed.\n * @param other sweep to compare to this instance\n * @param radianTol optional radian tolerance, default value `Geometry.smallAngleRadians`\n */\n public isAlmostEqualNoPeriodShift(other: AngleSweep, radianTol: number = Geometry.smallAngleRadians): boolean {\n return Angle.isAlmostEqualRadiansNoPeriodShift(this._radians0, other._radians0, radianTol)\n && Angle.isAlmostEqualRadiansNoPeriodShift(this.sweepRadians, other.sweepRadians, radianTol);\n }\n /**\n * Test if start and end angles match with radians tolerance.\n * * Period shifts are not allowed.\n * * This function is equivalent to isAlmostEqualNoPeriodShift. It is present for consistency with other classes.\n * However, it is recommended to use isAlmostEqualNoPeriodShift which has a clearer name.\n */\n public isAlmostEqual(other: AngleSweep): boolean {\n return this.isAlmostEqualNoPeriodShift(other);\n }\n}\n"]}
|