@itwin/core-geometry 4.1.0-dev.7 → 4.1.0-dev.70
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 +82 -1
- package/lib/cjs/Geometry.js.map +1 -1
- package/lib/cjs/bspline/BSplineCurve.d.ts +1 -1
- package/lib/cjs/bspline/BSplineCurve.d.ts.map +1 -1
- package/lib/cjs/bspline/BSplineCurve.js +2 -2
- package/lib/cjs/bspline/BSplineCurve.js.map +1 -1
- package/lib/cjs/bspline/BSplineSurface.d.ts.map +1 -1
- package/lib/cjs/bspline/BSplineSurface.js +1 -1
- package/lib/cjs/bspline/BSplineSurface.js.map +1 -1
- package/lib/cjs/bspline/BezierCurveBase.d.ts +1 -1
- package/lib/cjs/bspline/BezierCurveBase.d.ts.map +1 -1
- package/lib/cjs/bspline/BezierCurveBase.js +2 -2
- package/lib/cjs/bspline/BezierCurveBase.js.map +1 -1
- package/lib/cjs/bspline/InterpolationCurve3d.js.map +1 -1
- package/lib/cjs/clipping/ClipPrimitive.d.ts.map +1 -1
- package/lib/cjs/clipping/ClipPrimitive.js +2 -0
- package/lib/cjs/clipping/ClipPrimitive.js.map +1 -1
- package/lib/cjs/clipping/ClipUtils.js.map +1 -1
- package/lib/cjs/core-geometry.d.ts +3 -1
- package/lib/cjs/core-geometry.d.ts.map +1 -1
- package/lib/cjs/core-geometry.js +3 -1
- package/lib/cjs/core-geometry.js.map +1 -1
- package/lib/cjs/curve/Arc3d.d.ts +2 -1
- package/lib/cjs/curve/Arc3d.d.ts.map +1 -1
- package/lib/cjs/curve/Arc3d.js +3 -2
- package/lib/cjs/curve/Arc3d.js.map +1 -1
- package/lib/cjs/curve/CurveChainWithDistanceIndex.d.ts +62 -42
- package/lib/cjs/curve/CurveChainWithDistanceIndex.d.ts.map +1 -1
- package/lib/cjs/curve/CurveChainWithDistanceIndex.js +71 -48
- package/lib/cjs/curve/CurveChainWithDistanceIndex.js.map +1 -1
- package/lib/cjs/curve/CurveCollection.d.ts +36 -26
- package/lib/cjs/curve/CurveCollection.d.ts.map +1 -1
- package/lib/cjs/curve/CurveCollection.js +46 -39
- package/lib/cjs/curve/CurveCollection.js.map +1 -1
- package/lib/cjs/curve/CurveCurve.d.ts.map +1 -1
- package/lib/cjs/curve/CurveCurve.js.map +1 -1
- package/lib/cjs/curve/CurveFactory.d.ts +67 -3
- package/lib/cjs/curve/CurveFactory.d.ts.map +1 -1
- package/lib/cjs/curve/CurveFactory.js +75 -7
- package/lib/cjs/curve/CurveFactory.js.map +1 -1
- package/lib/cjs/curve/CurveLocationDetail.d.ts +6 -6
- package/lib/cjs/curve/CurveLocationDetail.d.ts.map +1 -1
- package/lib/cjs/curve/CurveLocationDetail.js +9 -7
- package/lib/cjs/curve/CurveLocationDetail.js.map +1 -1
- package/lib/cjs/curve/CurveOps.d.ts +77 -0
- package/lib/cjs/curve/CurveOps.d.ts.map +1 -0
- package/lib/cjs/curve/CurveOps.js +160 -0
- package/lib/cjs/curve/CurveOps.js.map +1 -0
- package/lib/cjs/curve/CurvePrimitive.d.ts +17 -16
- package/lib/cjs/curve/CurvePrimitive.d.ts.map +1 -1
- package/lib/cjs/curve/CurvePrimitive.js +4 -3
- package/lib/cjs/curve/CurvePrimitive.js.map +1 -1
- package/lib/cjs/curve/GeometryQuery.d.ts +2 -2
- package/lib/cjs/curve/GeometryQuery.d.ts.map +1 -1
- package/lib/cjs/curve/GeometryQuery.js +2 -2
- package/lib/cjs/curve/GeometryQuery.js.map +1 -1
- package/lib/cjs/curve/LineSegment3d.d.ts +7 -5
- package/lib/cjs/curve/LineSegment3d.d.ts.map +1 -1
- package/lib/cjs/curve/LineSegment3d.js +6 -6
- package/lib/cjs/curve/LineSegment3d.js.map +1 -1
- package/lib/cjs/curve/LineString3d.d.ts +2 -2
- package/lib/cjs/curve/LineString3d.d.ts.map +1 -1
- package/lib/cjs/curve/LineString3d.js +3 -3
- package/lib/cjs/curve/LineString3d.js.map +1 -1
- package/lib/cjs/curve/Loop.d.ts +7 -5
- package/lib/cjs/curve/Loop.d.ts.map +1 -1
- package/lib/cjs/curve/Loop.js +18 -6
- package/lib/cjs/curve/Loop.js.map +1 -1
- package/lib/cjs/curve/OffsetOptions.d.ts +97 -0
- package/lib/cjs/curve/OffsetOptions.d.ts.map +1 -0
- package/lib/cjs/curve/OffsetOptions.js +166 -0
- package/lib/cjs/curve/OffsetOptions.js.map +1 -0
- package/lib/cjs/curve/ParityRegion.d.ts +7 -7
- package/lib/cjs/curve/ParityRegion.d.ts.map +1 -1
- package/lib/cjs/curve/ParityRegion.js +19 -11
- package/lib/cjs/curve/ParityRegion.js.map +1 -1
- package/lib/cjs/curve/Path.d.ts +6 -6
- package/lib/cjs/curve/Path.d.ts.map +1 -1
- package/lib/cjs/curve/Path.js +15 -9
- package/lib/cjs/curve/Path.js.map +1 -1
- package/lib/cjs/curve/ProxyCurve.d.ts +5 -7
- package/lib/cjs/curve/ProxyCurve.d.ts.map +1 -1
- package/lib/cjs/curve/ProxyCurve.js +7 -7
- package/lib/cjs/curve/ProxyCurve.js.map +1 -1
- package/lib/cjs/curve/Query/StrokeCountMap.js.map +1 -1
- package/lib/cjs/curve/RegionOps.d.ts +76 -56
- package/lib/cjs/curve/RegionOps.d.ts.map +1 -1
- package/lib/cjs/curve/RegionOps.js +83 -60
- package/lib/cjs/curve/RegionOps.js.map +1 -1
- package/lib/cjs/curve/RegionOpsClassificationSweeps.js +2 -2
- package/lib/cjs/curve/RegionOpsClassificationSweeps.js.map +1 -1
- package/lib/cjs/curve/StrokeOptions.d.ts.map +1 -1
- package/lib/cjs/curve/StrokeOptions.js +6 -2
- package/lib/cjs/curve/StrokeOptions.js.map +1 -1
- package/lib/cjs/curve/UnionRegion.d.ts +6 -5
- package/lib/cjs/curve/UnionRegion.d.ts.map +1 -1
- package/lib/cjs/curve/UnionRegion.js +17 -8
- package/lib/cjs/curve/UnionRegion.js.map +1 -1
- package/lib/cjs/curve/{ChainCollectorContext.d.ts → internalContexts/ChainCollectorContext.d.ts} +4 -4
- package/lib/cjs/curve/internalContexts/ChainCollectorContext.d.ts.map +1 -0
- package/lib/cjs/curve/{ChainCollectorContext.js → internalContexts/ChainCollectorContext.js} +4 -4
- package/lib/cjs/curve/internalContexts/ChainCollectorContext.js.map +1 -0
- package/lib/cjs/curve/internalContexts/GapSearchContext.d.ts +2 -1
- package/lib/cjs/curve/internalContexts/GapSearchContext.d.ts.map +1 -1
- package/lib/cjs/curve/internalContexts/GapSearchContext.js +6 -2
- package/lib/cjs/curve/internalContexts/GapSearchContext.js.map +1 -1
- package/lib/cjs/curve/internalContexts/MultiChainCollector.d.ts +59 -70
- package/lib/cjs/curve/internalContexts/MultiChainCollector.d.ts.map +1 -1
- package/lib/cjs/curve/internalContexts/MultiChainCollector.js +130 -220
- package/lib/cjs/curve/internalContexts/MultiChainCollector.js.map +1 -1
- package/lib/cjs/curve/internalContexts/PlaneAltitudeRangeContext.d.ts +14 -8
- package/lib/cjs/curve/internalContexts/PlaneAltitudeRangeContext.d.ts.map +1 -1
- package/lib/cjs/curve/internalContexts/PlaneAltitudeRangeContext.js +14 -8
- package/lib/cjs/curve/internalContexts/PlaneAltitudeRangeContext.js.map +1 -1
- package/lib/cjs/curve/internalContexts/PolygonOffsetContext.d.ts +23 -95
- package/lib/cjs/curve/internalContexts/PolygonOffsetContext.d.ts.map +1 -1
- package/lib/cjs/curve/internalContexts/PolygonOffsetContext.js +89 -178
- package/lib/cjs/curve/internalContexts/PolygonOffsetContext.js.map +1 -1
- package/lib/cjs/curve/internalContexts/SumLengthsContext.d.ts.map +1 -1
- package/lib/cjs/curve/internalContexts/SumLengthsContext.js +4 -1
- package/lib/cjs/curve/internalContexts/SumLengthsContext.js.map +1 -1
- package/lib/cjs/curve/spiral/IntegratedSpiral3d.js +1 -1
- package/lib/cjs/curve/spiral/IntegratedSpiral3d.js.map +1 -1
- package/lib/cjs/curve/spiral/TransitionSpiral3d.d.ts +1 -1
- package/lib/cjs/curve/spiral/TransitionSpiral3d.d.ts.map +1 -1
- package/lib/cjs/curve/spiral/TransitionSpiral3d.js +2 -2
- package/lib/cjs/curve/spiral/TransitionSpiral3d.js.map +1 -1
- package/lib/cjs/curve/spiral/XYCurveEvaluator.js +1 -1
- package/lib/cjs/curve/spiral/XYCurveEvaluator.js.map +1 -1
- package/lib/cjs/geometry3d/Angle.d.ts +9 -0
- package/lib/cjs/geometry3d/Angle.d.ts.map +1 -1
- package/lib/cjs/geometry3d/Angle.js +13 -0
- package/lib/cjs/geometry3d/Angle.js.map +1 -1
- package/lib/cjs/geometry3d/AngleSweep.js.map +1 -1
- package/lib/cjs/geometry3d/BarycentricTriangle.js.map +1 -1
- package/lib/cjs/geometry3d/BilinearPatch.d.ts +43 -48
- package/lib/cjs/geometry3d/BilinearPatch.d.ts.map +1 -1
- package/lib/cjs/geometry3d/BilinearPatch.js +51 -55
- package/lib/cjs/geometry3d/BilinearPatch.js.map +1 -1
- package/lib/cjs/geometry3d/Ellipsoid.d.ts +1 -1
- package/lib/cjs/geometry3d/Ellipsoid.js +1 -1
- package/lib/cjs/geometry3d/Ellipsoid.js.map +1 -1
- package/lib/cjs/geometry3d/FrameBuilder.d.ts.map +1 -1
- package/lib/cjs/geometry3d/FrameBuilder.js +13 -11
- package/lib/cjs/geometry3d/FrameBuilder.js.map +1 -1
- package/lib/cjs/geometry3d/GeometryHandler.d.ts +5 -5
- package/lib/cjs/geometry3d/GeometryHandler.js.map +1 -1
- package/lib/cjs/geometry3d/GrowableBlockedArray.d.ts.map +1 -1
- package/lib/cjs/geometry3d/GrowableBlockedArray.js +1 -1
- package/lib/cjs/geometry3d/GrowableBlockedArray.js.map +1 -1
- package/lib/cjs/geometry3d/GrowableFloat64Array.d.ts.map +1 -1
- package/lib/cjs/geometry3d/GrowableFloat64Array.js +1 -1
- package/lib/cjs/geometry3d/GrowableFloat64Array.js.map +1 -1
- package/lib/cjs/geometry3d/Matrix3d.d.ts +18 -0
- package/lib/cjs/geometry3d/Matrix3d.d.ts.map +1 -1
- package/lib/cjs/geometry3d/Matrix3d.js +32 -5
- package/lib/cjs/geometry3d/Matrix3d.js.map +1 -1
- package/lib/cjs/geometry3d/OrderedRotationAngles.js.map +1 -1
- package/lib/cjs/geometry3d/Plane3d.d.ts +41 -32
- package/lib/cjs/geometry3d/Plane3d.d.ts.map +1 -1
- package/lib/cjs/geometry3d/Plane3d.js +11 -8
- package/lib/cjs/geometry3d/Plane3d.js.map +1 -1
- package/lib/cjs/geometry3d/Plane3dByOriginAndUnitNormal.d.ts +37 -34
- package/lib/cjs/geometry3d/Plane3dByOriginAndUnitNormal.d.ts.map +1 -1
- package/lib/cjs/geometry3d/Plane3dByOriginAndUnitNormal.js +65 -43
- package/lib/cjs/geometry3d/Plane3dByOriginAndUnitNormal.js.map +1 -1
- package/lib/cjs/geometry3d/Plane3dByOriginAndVectors.d.ts +36 -32
- package/lib/cjs/geometry3d/Plane3dByOriginAndVectors.d.ts.map +1 -1
- package/lib/cjs/geometry3d/Plane3dByOriginAndVectors.js +37 -32
- package/lib/cjs/geometry3d/Plane3dByOriginAndVectors.js.map +1 -1
- package/lib/cjs/geometry3d/Point2dVector2d.d.ts +8 -9
- package/lib/cjs/geometry3d/Point2dVector2d.d.ts.map +1 -1
- package/lib/cjs/geometry3d/Point2dVector2d.js +9 -10
- package/lib/cjs/geometry3d/Point2dVector2d.js.map +1 -1
- package/lib/cjs/geometry3d/Point3dArrayCarrier.js.map +1 -1
- package/lib/cjs/geometry3d/Point3dVector3d.d.ts +12 -4
- package/lib/cjs/geometry3d/Point3dVector3d.d.ts.map +1 -1
- package/lib/cjs/geometry3d/Point3dVector3d.js +18 -5
- package/lib/cjs/geometry3d/Point3dVector3d.js.map +1 -1
- package/lib/cjs/geometry3d/PointHelpers.d.ts.map +1 -1
- package/lib/cjs/geometry3d/PointHelpers.js +5 -5
- package/lib/cjs/geometry3d/PointHelpers.js.map +1 -1
- package/lib/cjs/geometry3d/PolygonOps.d.ts +1 -2
- package/lib/cjs/geometry3d/PolygonOps.d.ts.map +1 -1
- package/lib/cjs/geometry3d/PolygonOps.js +2 -3
- package/lib/cjs/geometry3d/PolygonOps.js.map +1 -1
- package/lib/cjs/geometry3d/PolylineOps.d.ts +16 -1
- package/lib/cjs/geometry3d/PolylineOps.d.ts.map +1 -1
- package/lib/cjs/geometry3d/PolylineOps.js +55 -0
- package/lib/cjs/geometry3d/PolylineOps.js.map +1 -1
- package/lib/cjs/geometry3d/Range.d.ts +134 -94
- package/lib/cjs/geometry3d/Range.d.ts.map +1 -1
- package/lib/cjs/geometry3d/Range.js +297 -145
- package/lib/cjs/geometry3d/Range.js.map +1 -1
- package/lib/cjs/geometry3d/Ray2d.d.ts +69 -0
- package/lib/cjs/geometry3d/Ray2d.d.ts.map +1 -0
- package/lib/cjs/geometry3d/Ray2d.js +146 -0
- package/lib/cjs/geometry3d/Ray2d.js.map +1 -0
- package/lib/cjs/geometry3d/Ray3d.d.ts.map +1 -1
- package/lib/cjs/geometry3d/Ray3d.js.map +1 -1
- package/lib/cjs/geometry3d/Transform.d.ts +10 -3
- package/lib/cjs/geometry3d/Transform.d.ts.map +1 -1
- package/lib/cjs/geometry3d/Transform.js +18 -6
- package/lib/cjs/geometry3d/Transform.js.map +1 -1
- package/lib/cjs/geometry3d/YawPitchRollAngles.js.map +1 -1
- package/lib/cjs/numerics/ConvexPolygon2d.d.ts +7 -49
- package/lib/cjs/numerics/ConvexPolygon2d.d.ts.map +1 -1
- package/lib/cjs/numerics/ConvexPolygon2d.js +16 -107
- package/lib/cjs/numerics/ConvexPolygon2d.js.map +1 -1
- package/lib/cjs/numerics/Newton.js.map +1 -1
- package/lib/cjs/numerics/Polynomials.d.ts.map +1 -1
- package/lib/cjs/numerics/Polynomials.js +0 -2
- package/lib/cjs/numerics/Polynomials.js.map +1 -1
- package/lib/cjs/numerics/Quadrature.js +5 -5
- package/lib/cjs/numerics/Quadrature.js.map +1 -1
- package/lib/cjs/polyface/IndexedEdgeMatcher.js +1 -1
- package/lib/cjs/polyface/IndexedEdgeMatcher.js.map +1 -1
- package/lib/cjs/polyface/PolyfaceBuilder.d.ts.map +1 -1
- package/lib/cjs/polyface/PolyfaceBuilder.js +2 -2
- package/lib/cjs/polyface/PolyfaceBuilder.js.map +1 -1
- package/lib/cjs/polyface/PolyfaceQuery.d.ts +73 -12
- package/lib/cjs/polyface/PolyfaceQuery.d.ts.map +1 -1
- package/lib/cjs/polyface/PolyfaceQuery.js +117 -31
- package/lib/cjs/polyface/PolyfaceQuery.js.map +1 -1
- package/lib/cjs/polyface/TaggedNumericData.js +1 -1
- package/lib/cjs/polyface/TaggedNumericData.js.map +1 -1
- package/lib/cjs/polyface/multiclip/BuildAverageNormalsContext.js +2 -2
- package/lib/cjs/polyface/multiclip/BuildAverageNormalsContext.js.map +1 -1
- package/lib/cjs/polyface/multiclip/OffsetMeshContext.js.map +1 -1
- package/lib/cjs/polyface/multiclip/SweepLineStringToFacetContext.d.ts +11 -0
- package/lib/cjs/polyface/multiclip/SweepLineStringToFacetContext.d.ts.map +1 -1
- package/lib/cjs/polyface/multiclip/SweepLineStringToFacetContext.js +79 -1
- package/lib/cjs/polyface/multiclip/SweepLineStringToFacetContext.js.map +1 -1
- package/lib/cjs/serialization/BGFBWriter.js.map +1 -1
- package/lib/cjs/serialization/GeometrySamples.d.ts +11 -0
- package/lib/cjs/serialization/GeometrySamples.d.ts.map +1 -1
- package/lib/cjs/serialization/GeometrySamples.js +30 -0
- package/lib/cjs/serialization/GeometrySamples.js.map +1 -1
- package/lib/cjs/serialization/IModelJsonSchema.d.ts +2 -7
- package/lib/cjs/serialization/IModelJsonSchema.d.ts.map +1 -1
- package/lib/cjs/serialization/IModelJsonSchema.js +2 -7
- package/lib/cjs/serialization/IModelJsonSchema.js.map +1 -1
- package/lib/cjs/solid/LinearSweep.d.ts +2 -1
- package/lib/cjs/solid/LinearSweep.d.ts.map +1 -1
- package/lib/cjs/solid/LinearSweep.js.map +1 -1
- package/lib/cjs/solid/RotationalSweep.d.ts +2 -1
- package/lib/cjs/solid/RotationalSweep.d.ts.map +1 -1
- package/lib/cjs/solid/RotationalSweep.js.map +1 -1
- package/lib/cjs/solid/RuledSweep.d.ts +2 -1
- package/lib/cjs/solid/RuledSweep.d.ts.map +1 -1
- package/lib/cjs/solid/RuledSweep.js.map +1 -1
- package/lib/cjs/solid/SweepContour.d.ts +2 -2
- package/lib/cjs/solid/SweepContour.d.ts.map +1 -1
- package/lib/cjs/solid/SweepContour.js +9 -0
- package/lib/cjs/solid/SweepContour.js.map +1 -1
- package/lib/cjs/topology/ChainMerge.js +1 -1
- package/lib/cjs/topology/ChainMerge.js.map +1 -1
- package/lib/cjs/topology/HalfEdgeGraphSearch.d.ts.map +1 -1
- package/lib/cjs/topology/HalfEdgeGraphSearch.js +1 -1
- package/lib/cjs/topology/HalfEdgeGraphSearch.js.map +1 -1
- package/lib/cjs/topology/HalfEdgeGraphSpineContext.js +1 -1
- package/lib/cjs/topology/HalfEdgeGraphSpineContext.js.map +1 -1
- package/lib/cjs/topology/HalfEdgePriorityQueue.d.ts.map +1 -1
- package/lib/cjs/topology/HalfEdgePriorityQueue.js +1 -1
- package/lib/cjs/topology/HalfEdgePriorityQueue.js.map +1 -1
- package/lib/cjs/topology/RegularizeFace.js +3 -3
- package/lib/cjs/topology/RegularizeFace.js.map +1 -1
- package/lib/cjs/topology/Triangulation.js +1 -1
- package/lib/cjs/topology/Triangulation.js.map +1 -1
- package/lib/esm/Geometry.js.map +1 -1
- package/lib/esm/bspline/BSplineCurve.d.ts +1 -1
- package/lib/esm/bspline/BSplineCurve.d.ts.map +1 -1
- package/lib/esm/bspline/BSplineCurve.js +1 -1
- package/lib/esm/bspline/BSplineCurve.js.map +1 -1
- package/lib/esm/bspline/BSplineSurface.d.ts.map +1 -1
- package/lib/esm/bspline/BSplineSurface.js +1 -1
- package/lib/esm/bspline/BSplineSurface.js.map +1 -1
- package/lib/esm/bspline/BezierCurveBase.d.ts +1 -1
- package/lib/esm/bspline/BezierCurveBase.d.ts.map +1 -1
- package/lib/esm/bspline/BezierCurveBase.js +1 -1
- package/lib/esm/bspline/BezierCurveBase.js.map +1 -1
- package/lib/esm/bspline/InterpolationCurve3d.js.map +1 -1
- package/lib/esm/clipping/ClipPrimitive.d.ts.map +1 -1
- package/lib/esm/clipping/ClipPrimitive.js +2 -0
- package/lib/esm/clipping/ClipPrimitive.js.map +1 -1
- package/lib/esm/clipping/ClipUtils.js.map +1 -1
- package/lib/esm/core-geometry.d.ts +3 -1
- package/lib/esm/core-geometry.d.ts.map +1 -1
- package/lib/esm/core-geometry.js +3 -1
- package/lib/esm/core-geometry.js.map +1 -1
- package/lib/esm/curve/Arc3d.d.ts +2 -1
- package/lib/esm/curve/Arc3d.d.ts.map +1 -1
- package/lib/esm/curve/Arc3d.js +2 -1
- package/lib/esm/curve/Arc3d.js.map +1 -1
- package/lib/esm/curve/CurveChainWithDistanceIndex.d.ts +62 -42
- package/lib/esm/curve/CurveChainWithDistanceIndex.d.ts.map +1 -1
- package/lib/esm/curve/CurveChainWithDistanceIndex.js +70 -47
- package/lib/esm/curve/CurveChainWithDistanceIndex.js.map +1 -1
- package/lib/esm/curve/CurveCollection.d.ts +36 -26
- package/lib/esm/curve/CurveCollection.d.ts.map +1 -1
- package/lib/esm/curve/CurveCollection.js +46 -39
- package/lib/esm/curve/CurveCollection.js.map +1 -1
- package/lib/esm/curve/CurveCurve.d.ts.map +1 -1
- package/lib/esm/curve/CurveCurve.js.map +1 -1
- package/lib/esm/curve/CurveFactory.d.ts +67 -3
- package/lib/esm/curve/CurveFactory.d.ts.map +1 -1
- package/lib/esm/curve/CurveFactory.js +74 -6
- package/lib/esm/curve/CurveFactory.js.map +1 -1
- package/lib/esm/curve/CurveLocationDetail.d.ts +6 -6
- package/lib/esm/curve/CurveLocationDetail.d.ts.map +1 -1
- package/lib/esm/curve/CurveLocationDetail.js +9 -7
- package/lib/esm/curve/CurveLocationDetail.js.map +1 -1
- package/lib/esm/curve/CurveOps.d.ts +77 -0
- package/lib/esm/curve/CurveOps.d.ts.map +1 -0
- package/lib/esm/curve/CurveOps.js +156 -0
- package/lib/esm/curve/CurveOps.js.map +1 -0
- package/lib/esm/curve/CurvePrimitive.d.ts +17 -16
- package/lib/esm/curve/CurvePrimitive.d.ts.map +1 -1
- package/lib/esm/curve/CurvePrimitive.js +4 -3
- package/lib/esm/curve/CurvePrimitive.js.map +1 -1
- package/lib/esm/curve/GeometryQuery.d.ts +2 -2
- package/lib/esm/curve/GeometryQuery.d.ts.map +1 -1
- package/lib/esm/curve/GeometryQuery.js +2 -2
- package/lib/esm/curve/GeometryQuery.js.map +1 -1
- package/lib/esm/curve/LineSegment3d.d.ts +7 -5
- package/lib/esm/curve/LineSegment3d.d.ts.map +1 -1
- package/lib/esm/curve/LineSegment3d.js +5 -5
- package/lib/esm/curve/LineSegment3d.js.map +1 -1
- package/lib/esm/curve/LineString3d.d.ts +2 -2
- package/lib/esm/curve/LineString3d.d.ts.map +1 -1
- package/lib/esm/curve/LineString3d.js +2 -2
- package/lib/esm/curve/LineString3d.js.map +1 -1
- package/lib/esm/curve/Loop.d.ts +7 -5
- package/lib/esm/curve/Loop.d.ts.map +1 -1
- package/lib/esm/curve/Loop.js +18 -6
- package/lib/esm/curve/Loop.js.map +1 -1
- package/lib/esm/curve/OffsetOptions.d.ts +97 -0
- package/lib/esm/curve/OffsetOptions.d.ts.map +1 -0
- package/lib/esm/curve/OffsetOptions.js +161 -0
- package/lib/esm/curve/OffsetOptions.js.map +1 -0
- package/lib/esm/curve/ParityRegion.d.ts +7 -7
- package/lib/esm/curve/ParityRegion.d.ts.map +1 -1
- package/lib/esm/curve/ParityRegion.js +19 -11
- package/lib/esm/curve/ParityRegion.js.map +1 -1
- package/lib/esm/curve/Path.d.ts +6 -6
- package/lib/esm/curve/Path.d.ts.map +1 -1
- package/lib/esm/curve/Path.js +15 -9
- package/lib/esm/curve/Path.js.map +1 -1
- package/lib/esm/curve/ProxyCurve.d.ts +5 -7
- package/lib/esm/curve/ProxyCurve.d.ts.map +1 -1
- package/lib/esm/curve/ProxyCurve.js +7 -7
- package/lib/esm/curve/ProxyCurve.js.map +1 -1
- package/lib/esm/curve/Query/StrokeCountMap.js.map +1 -1
- package/lib/esm/curve/RegionOps.d.ts +76 -56
- package/lib/esm/curve/RegionOps.d.ts.map +1 -1
- package/lib/esm/curve/RegionOps.js +84 -61
- package/lib/esm/curve/RegionOps.js.map +1 -1
- package/lib/esm/curve/RegionOpsClassificationSweeps.js +2 -2
- package/lib/esm/curve/RegionOpsClassificationSweeps.js.map +1 -1
- package/lib/esm/curve/StrokeOptions.d.ts.map +1 -1
- package/lib/esm/curve/StrokeOptions.js +6 -2
- package/lib/esm/curve/StrokeOptions.js.map +1 -1
- package/lib/esm/curve/UnionRegion.d.ts +6 -5
- package/lib/esm/curve/UnionRegion.d.ts.map +1 -1
- package/lib/esm/curve/UnionRegion.js +17 -8
- package/lib/esm/curve/UnionRegion.js.map +1 -1
- package/lib/esm/curve/{ChainCollectorContext.d.ts → internalContexts/ChainCollectorContext.d.ts} +4 -4
- package/lib/esm/curve/internalContexts/ChainCollectorContext.d.ts.map +1 -0
- package/lib/esm/curve/{ChainCollectorContext.js → internalContexts/ChainCollectorContext.js} +4 -4
- package/lib/esm/curve/internalContexts/ChainCollectorContext.js.map +1 -0
- package/lib/esm/curve/internalContexts/GapSearchContext.d.ts +2 -1
- package/lib/esm/curve/internalContexts/GapSearchContext.d.ts.map +1 -1
- package/lib/esm/curve/internalContexts/GapSearchContext.js +6 -2
- package/lib/esm/curve/internalContexts/GapSearchContext.js.map +1 -1
- package/lib/esm/curve/internalContexts/MultiChainCollector.d.ts +59 -70
- package/lib/esm/curve/internalContexts/MultiChainCollector.d.ts.map +1 -1
- package/lib/esm/curve/internalContexts/MultiChainCollector.js +129 -218
- package/lib/esm/curve/internalContexts/MultiChainCollector.js.map +1 -1
- package/lib/esm/curve/internalContexts/PlaneAltitudeRangeContext.d.ts +14 -8
- package/lib/esm/curve/internalContexts/PlaneAltitudeRangeContext.d.ts.map +1 -1
- package/lib/esm/curve/internalContexts/PlaneAltitudeRangeContext.js +14 -8
- package/lib/esm/curve/internalContexts/PlaneAltitudeRangeContext.js.map +1 -1
- package/lib/esm/curve/internalContexts/PolygonOffsetContext.d.ts +23 -95
- package/lib/esm/curve/internalContexts/PolygonOffsetContext.d.ts.map +1 -1
- package/lib/esm/curve/internalContexts/PolygonOffsetContext.js +86 -173
- package/lib/esm/curve/internalContexts/PolygonOffsetContext.js.map +1 -1
- package/lib/esm/curve/internalContexts/SumLengthsContext.d.ts.map +1 -1
- package/lib/esm/curve/internalContexts/SumLengthsContext.js +4 -1
- package/lib/esm/curve/internalContexts/SumLengthsContext.js.map +1 -1
- package/lib/esm/curve/spiral/IntegratedSpiral3d.js +1 -1
- package/lib/esm/curve/spiral/IntegratedSpiral3d.js.map +1 -1
- package/lib/esm/curve/spiral/TransitionSpiral3d.d.ts +1 -1
- package/lib/esm/curve/spiral/TransitionSpiral3d.d.ts.map +1 -1
- package/lib/esm/curve/spiral/TransitionSpiral3d.js +1 -1
- package/lib/esm/curve/spiral/TransitionSpiral3d.js.map +1 -1
- package/lib/esm/curve/spiral/XYCurveEvaluator.js +1 -1
- package/lib/esm/curve/spiral/XYCurveEvaluator.js.map +1 -1
- package/lib/esm/geometry3d/Angle.d.ts +9 -0
- package/lib/esm/geometry3d/Angle.d.ts.map +1 -1
- package/lib/esm/geometry3d/Angle.js +13 -0
- package/lib/esm/geometry3d/Angle.js.map +1 -1
- package/lib/esm/geometry3d/AngleSweep.js.map +1 -1
- package/lib/esm/geometry3d/BarycentricTriangle.js.map +1 -1
- package/lib/esm/geometry3d/BilinearPatch.d.ts +43 -48
- package/lib/esm/geometry3d/BilinearPatch.d.ts.map +1 -1
- package/lib/esm/geometry3d/BilinearPatch.js +51 -55
- package/lib/esm/geometry3d/BilinearPatch.js.map +1 -1
- package/lib/esm/geometry3d/Ellipsoid.d.ts +1 -1
- package/lib/esm/geometry3d/Ellipsoid.js +1 -1
- package/lib/esm/geometry3d/Ellipsoid.js.map +1 -1
- package/lib/esm/geometry3d/FrameBuilder.d.ts.map +1 -1
- package/lib/esm/geometry3d/FrameBuilder.js +13 -11
- package/lib/esm/geometry3d/FrameBuilder.js.map +1 -1
- package/lib/esm/geometry3d/GeometryHandler.d.ts +5 -5
- package/lib/esm/geometry3d/GeometryHandler.js.map +1 -1
- package/lib/esm/geometry3d/GrowableBlockedArray.d.ts.map +1 -1
- package/lib/esm/geometry3d/GrowableBlockedArray.js +1 -1
- package/lib/esm/geometry3d/GrowableBlockedArray.js.map +1 -1
- package/lib/esm/geometry3d/GrowableFloat64Array.d.ts.map +1 -1
- package/lib/esm/geometry3d/GrowableFloat64Array.js +1 -1
- package/lib/esm/geometry3d/GrowableFloat64Array.js.map +1 -1
- package/lib/esm/geometry3d/Matrix3d.d.ts +18 -0
- package/lib/esm/geometry3d/Matrix3d.d.ts.map +1 -1
- package/lib/esm/geometry3d/Matrix3d.js +32 -5
- package/lib/esm/geometry3d/Matrix3d.js.map +1 -1
- package/lib/esm/geometry3d/OrderedRotationAngles.js.map +1 -1
- package/lib/esm/geometry3d/Plane3d.d.ts +41 -32
- package/lib/esm/geometry3d/Plane3d.d.ts.map +1 -1
- package/lib/esm/geometry3d/Plane3d.js +11 -8
- package/lib/esm/geometry3d/Plane3d.js.map +1 -1
- package/lib/esm/geometry3d/Plane3dByOriginAndUnitNormal.d.ts +37 -34
- package/lib/esm/geometry3d/Plane3dByOriginAndUnitNormal.d.ts.map +1 -1
- package/lib/esm/geometry3d/Plane3dByOriginAndUnitNormal.js +65 -43
- package/lib/esm/geometry3d/Plane3dByOriginAndUnitNormal.js.map +1 -1
- package/lib/esm/geometry3d/Plane3dByOriginAndVectors.d.ts +36 -32
- package/lib/esm/geometry3d/Plane3dByOriginAndVectors.d.ts.map +1 -1
- package/lib/esm/geometry3d/Plane3dByOriginAndVectors.js +37 -32
- package/lib/esm/geometry3d/Plane3dByOriginAndVectors.js.map +1 -1
- package/lib/esm/geometry3d/Point2dVector2d.d.ts +8 -9
- package/lib/esm/geometry3d/Point2dVector2d.d.ts.map +1 -1
- package/lib/esm/geometry3d/Point2dVector2d.js +9 -10
- package/lib/esm/geometry3d/Point2dVector2d.js.map +1 -1
- package/lib/esm/geometry3d/Point3dArrayCarrier.js.map +1 -1
- package/lib/esm/geometry3d/Point3dVector3d.d.ts +12 -4
- package/lib/esm/geometry3d/Point3dVector3d.d.ts.map +1 -1
- package/lib/esm/geometry3d/Point3dVector3d.js +18 -5
- package/lib/esm/geometry3d/Point3dVector3d.js.map +1 -1
- package/lib/esm/geometry3d/PointHelpers.d.ts.map +1 -1
- package/lib/esm/geometry3d/PointHelpers.js +5 -5
- package/lib/esm/geometry3d/PointHelpers.js.map +1 -1
- package/lib/esm/geometry3d/PolygonOps.d.ts +1 -2
- package/lib/esm/geometry3d/PolygonOps.d.ts.map +1 -1
- package/lib/esm/geometry3d/PolygonOps.js +2 -3
- package/lib/esm/geometry3d/PolygonOps.js.map +1 -1
- package/lib/esm/geometry3d/PolylineOps.d.ts +16 -1
- package/lib/esm/geometry3d/PolylineOps.d.ts.map +1 -1
- package/lib/esm/geometry3d/PolylineOps.js +56 -1
- package/lib/esm/geometry3d/PolylineOps.js.map +1 -1
- package/lib/esm/geometry3d/Range.d.ts +134 -94
- package/lib/esm/geometry3d/Range.d.ts.map +1 -1
- package/lib/esm/geometry3d/Range.js +297 -145
- package/lib/esm/geometry3d/Range.js.map +1 -1
- package/lib/esm/geometry3d/Ray2d.d.ts +69 -0
- package/lib/esm/geometry3d/Ray2d.d.ts.map +1 -0
- package/lib/esm/geometry3d/Ray2d.js +142 -0
- package/lib/esm/geometry3d/Ray2d.js.map +1 -0
- package/lib/esm/geometry3d/Ray3d.d.ts.map +1 -1
- package/lib/esm/geometry3d/Ray3d.js.map +1 -1
- package/lib/esm/geometry3d/Transform.d.ts +10 -3
- package/lib/esm/geometry3d/Transform.d.ts.map +1 -1
- package/lib/esm/geometry3d/Transform.js +18 -6
- package/lib/esm/geometry3d/Transform.js.map +1 -1
- package/lib/esm/geometry3d/YawPitchRollAngles.js.map +1 -1
- package/lib/esm/numerics/ConvexPolygon2d.d.ts +7 -49
- package/lib/esm/numerics/ConvexPolygon2d.d.ts.map +1 -1
- package/lib/esm/numerics/ConvexPolygon2d.js +14 -104
- package/lib/esm/numerics/ConvexPolygon2d.js.map +1 -1
- package/lib/esm/numerics/Newton.js.map +1 -1
- package/lib/esm/numerics/Polynomials.d.ts.map +1 -1
- package/lib/esm/numerics/Polynomials.js +0 -2
- package/lib/esm/numerics/Polynomials.js.map +1 -1
- package/lib/esm/numerics/Quadrature.js +5 -5
- package/lib/esm/numerics/Quadrature.js.map +1 -1
- package/lib/esm/polyface/IndexedEdgeMatcher.js +1 -1
- package/lib/esm/polyface/IndexedEdgeMatcher.js.map +1 -1
- package/lib/esm/polyface/PolyfaceBuilder.d.ts.map +1 -1
- package/lib/esm/polyface/PolyfaceBuilder.js +2 -2
- package/lib/esm/polyface/PolyfaceBuilder.js.map +1 -1
- package/lib/esm/polyface/PolyfaceQuery.d.ts +73 -12
- package/lib/esm/polyface/PolyfaceQuery.d.ts.map +1 -1
- package/lib/esm/polyface/PolyfaceQuery.js +117 -32
- package/lib/esm/polyface/PolyfaceQuery.js.map +1 -1
- package/lib/esm/polyface/TaggedNumericData.js +1 -1
- package/lib/esm/polyface/TaggedNumericData.js.map +1 -1
- package/lib/esm/polyface/multiclip/BuildAverageNormalsContext.js +2 -2
- package/lib/esm/polyface/multiclip/BuildAverageNormalsContext.js.map +1 -1
- package/lib/esm/polyface/multiclip/OffsetMeshContext.js.map +1 -1
- package/lib/esm/polyface/multiclip/SweepLineStringToFacetContext.d.ts +11 -0
- package/lib/esm/polyface/multiclip/SweepLineStringToFacetContext.d.ts.map +1 -1
- package/lib/esm/polyface/multiclip/SweepLineStringToFacetContext.js +78 -1
- package/lib/esm/polyface/multiclip/SweepLineStringToFacetContext.js.map +1 -1
- package/lib/esm/serialization/BGFBWriter.js.map +1 -1
- package/lib/esm/serialization/GeometrySamples.d.ts +11 -0
- package/lib/esm/serialization/GeometrySamples.d.ts.map +1 -1
- package/lib/esm/serialization/GeometrySamples.js +30 -0
- package/lib/esm/serialization/GeometrySamples.js.map +1 -1
- package/lib/esm/serialization/IModelJsonSchema.d.ts +2 -7
- package/lib/esm/serialization/IModelJsonSchema.d.ts.map +1 -1
- package/lib/esm/serialization/IModelJsonSchema.js +2 -7
- package/lib/esm/serialization/IModelJsonSchema.js.map +1 -1
- package/lib/esm/solid/LinearSweep.d.ts +2 -1
- package/lib/esm/solid/LinearSweep.d.ts.map +1 -1
- package/lib/esm/solid/LinearSweep.js.map +1 -1
- package/lib/esm/solid/RotationalSweep.d.ts +2 -1
- package/lib/esm/solid/RotationalSweep.d.ts.map +1 -1
- package/lib/esm/solid/RotationalSweep.js.map +1 -1
- package/lib/esm/solid/RuledSweep.d.ts +2 -1
- package/lib/esm/solid/RuledSweep.d.ts.map +1 -1
- package/lib/esm/solid/RuledSweep.js.map +1 -1
- package/lib/esm/solid/SweepContour.d.ts +2 -2
- package/lib/esm/solid/SweepContour.d.ts.map +1 -1
- package/lib/esm/solid/SweepContour.js +9 -0
- package/lib/esm/solid/SweepContour.js.map +1 -1
- package/lib/esm/topology/ChainMerge.js +1 -1
- package/lib/esm/topology/ChainMerge.js.map +1 -1
- package/lib/esm/topology/HalfEdgeGraphSearch.d.ts.map +1 -1
- package/lib/esm/topology/HalfEdgeGraphSearch.js +1 -1
- package/lib/esm/topology/HalfEdgeGraphSearch.js.map +1 -1
- package/lib/esm/topology/HalfEdgeGraphSpineContext.js +1 -1
- package/lib/esm/topology/HalfEdgeGraphSpineContext.js.map +1 -1
- package/lib/esm/topology/HalfEdgePriorityQueue.d.ts.map +1 -1
- package/lib/esm/topology/HalfEdgePriorityQueue.js +1 -1
- package/lib/esm/topology/HalfEdgePriorityQueue.js.map +1 -1
- package/lib/esm/topology/RegularizeFace.js +3 -3
- package/lib/esm/topology/RegularizeFace.js.map +1 -1
- package/lib/esm/topology/Triangulation.js +1 -1
- package/lib/esm/topology/Triangulation.js.map +1 -1
- package/package.json +6 -17
- package/lib/cjs/curve/ChainCollectorContext.d.ts.map +0 -1
- package/lib/cjs/curve/ChainCollectorContext.js.map +0 -1
- package/lib/esm/curve/ChainCollectorContext.d.ts.map +0 -1
- package/lib/esm/curve/ChainCollectorContext.js.map +0 -1
|
@@ -19,13 +19,21 @@ import { Transform } from "./Transform";
|
|
|
19
19
|
*/
|
|
20
20
|
class RangeBase {
|
|
21
21
|
/** Return 0 if high<= low, otherwise `1/(high-low)` for use in fractionalizing */
|
|
22
|
-
static npcScaleFactor(low, high) {
|
|
22
|
+
static npcScaleFactor(low, high) {
|
|
23
|
+
return (high <= low) ? 0.0 : 1.0 / (high - low);
|
|
24
|
+
}
|
|
23
25
|
/** Return true if x is outside the range `[_EXTREME_NEGATIVE, _EXTREME_POSITIVE]' */
|
|
24
|
-
static isExtremeValue(x) {
|
|
26
|
+
static isExtremeValue(x) {
|
|
27
|
+
return Math.abs(x) >= RangeBase._EXTREME_POSITIVE;
|
|
28
|
+
}
|
|
25
29
|
/** Return true if any x or y or z is outside the range `[_EXTREME_NEGATIVE, _EXTREME_POSITIVE]' */
|
|
26
|
-
static isExtremePoint3d(xyz) {
|
|
30
|
+
static isExtremePoint3d(xyz) {
|
|
31
|
+
return RangeBase.isExtremeValue(xyz.x) || RangeBase.isExtremeValue(xyz.y) || RangeBase.isExtremeValue(xyz.z);
|
|
32
|
+
}
|
|
27
33
|
/** Return true if either of x,y is outside the range `[_EXTREME_NEGATIVE, _EXTREME_POSITIVE]' */
|
|
28
|
-
static isExtremePoint2d(xy) {
|
|
34
|
+
static isExtremePoint2d(xy) {
|
|
35
|
+
return RangeBase.isExtremeValue(xy.x) || RangeBase.isExtremeValue(xy.y);
|
|
36
|
+
}
|
|
29
37
|
/**
|
|
30
38
|
* Return the min absolute distance from any point of `[lowA,highA]' to any point of `[lowB,highB]'.
|
|
31
39
|
* * Both low,high pairs have order expectations: The condition `high < low` means null interval.
|
|
@@ -48,7 +56,8 @@ class RangeBase {
|
|
|
48
56
|
return 0.0;
|
|
49
57
|
return lowB - highA;
|
|
50
58
|
}
|
|
51
|
-
/**
|
|
59
|
+
/**
|
|
60
|
+
* Given a coordinate and pair of range limits, return the smallest distance to the range.
|
|
52
61
|
* * This is zero for any point inside the range
|
|
53
62
|
* * This is _EXTREME_POSITIVE if the range limits are inverted
|
|
54
63
|
* * Otherwise (i.e. x is outside a finite range) the distance to the near endpoint.
|
|
@@ -63,7 +72,7 @@ class RangeBase {
|
|
|
63
72
|
return 0.0;
|
|
64
73
|
}
|
|
65
74
|
/**
|
|
66
|
-
*
|
|
75
|
+
* If a > 0, return (extrapolationFactor * a); otherwise return defaultValue
|
|
67
76
|
* @param q
|
|
68
77
|
* @param factor multiplier for positive q values.
|
|
69
78
|
*/
|
|
@@ -94,11 +103,19 @@ export class Range3d extends RangeBase {
|
|
|
94
103
|
this.high.z = RangeBase._EXTREME_NEGATIVE;
|
|
95
104
|
}
|
|
96
105
|
/** Freeze this instance (and its members) so it is read-only */
|
|
97
|
-
freeze() {
|
|
106
|
+
freeze() {
|
|
107
|
+
this.low.freeze();
|
|
108
|
+
this.high.freeze();
|
|
109
|
+
return Object.freeze(this);
|
|
110
|
+
}
|
|
98
111
|
/** Flatten the low and high coordinates of any json object with low.x .. high.z into an array of 6 doubles */
|
|
99
|
-
static toFloat64Array(val) {
|
|
112
|
+
static toFloat64Array(val) {
|
|
113
|
+
return Float64Array.of(val.low.x, val.low.y, val.low.z, val.high.x, val.high.y, val.high.z);
|
|
114
|
+
}
|
|
100
115
|
/** Flatten the low and high coordinates of this into an array of 6 doubles */
|
|
101
|
-
toFloat64Array() {
|
|
116
|
+
toFloat64Array() {
|
|
117
|
+
return Range3d.toFloat64Array(this);
|
|
118
|
+
}
|
|
102
119
|
/**
|
|
103
120
|
* Construct a Range3d from an array of double-precision values
|
|
104
121
|
* @param f64 the array, which should contain exactly 6 values in this order: lowX, lowY, lowZ, highX, highY, highZ
|
|
@@ -110,11 +127,14 @@ export class Range3d extends RangeBase {
|
|
|
110
127
|
return new this(f64[0], f64[1], f64[2], f64[3], f64[4], f64[5]);
|
|
111
128
|
}
|
|
112
129
|
/**
|
|
113
|
-
* Construct a Range3d from an un-typed array. This mostly useful when interpreting ECSQL query results of
|
|
130
|
+
* Construct a Range3d from an un-typed array. This mostly useful when interpreting ECSQL query results of
|
|
131
|
+
* the 'blob' type, where you know that that result is a Range3d.
|
|
114
132
|
* @param buffer untyped array
|
|
115
133
|
* @return a new Range3d object
|
|
116
134
|
*/
|
|
117
|
-
static fromArrayBuffer(buffer) {
|
|
135
|
+
static fromArrayBuffer(buffer) {
|
|
136
|
+
return this.fromFloat64Array(new Float64Array(buffer));
|
|
137
|
+
}
|
|
118
138
|
// explicit ctor - no enforcement of value relationships
|
|
119
139
|
constructor(lowX = RangeBase._EXTREME_POSITIVE, lowY = RangeBase._EXTREME_POSITIVE, lowZ = RangeBase._EXTREME_POSITIVE, highX = RangeBase._EXTREME_NEGATIVE, highY = RangeBase._EXTREME_NEGATIVE, highZ = RangeBase._EXTREME_NEGATIVE) {
|
|
120
140
|
super();
|
|
@@ -126,8 +146,11 @@ export class Range3d extends RangeBase {
|
|
|
126
146
|
return (this.low.isAlmostEqual(other.low, tol) && this.high.isAlmostEqual(other.high, tol))
|
|
127
147
|
|| (this.isNull && other.isNull);
|
|
128
148
|
}
|
|
129
|
-
/**
|
|
130
|
-
setFrom(other) {
|
|
149
|
+
/** Copy low and high values from other. */
|
|
150
|
+
setFrom(other) {
|
|
151
|
+
this.low.setFrom(other.low);
|
|
152
|
+
this.high.setFrom(other.high);
|
|
153
|
+
}
|
|
131
154
|
/** Return a new Range3d copied from a range or derived type */
|
|
132
155
|
static createFrom(other, result) {
|
|
133
156
|
if (result) {
|
|
@@ -136,7 +159,8 @@ export class Range3d extends RangeBase {
|
|
|
136
159
|
}
|
|
137
160
|
return this.createXYZXYZOrCorrectToNull(other.low.x, other.low.y, other.low.z, other.high.x, other.high.y, other.high.z, result);
|
|
138
161
|
}
|
|
139
|
-
/**
|
|
162
|
+
/**
|
|
163
|
+
* Set this range (in place) from json such as
|
|
140
164
|
* * key-value pairs: `{low:[1,2,3], high:[4,5,6]}`
|
|
141
165
|
* * array of points: `[[1,2,3],[9,3,4],[-2,1,3] ...]`
|
|
142
166
|
* * Lowest level points can be `[1,2,3]` or `{x:1,y:2,z:3}`
|
|
@@ -160,10 +184,13 @@ export class Range3d extends RangeBase {
|
|
|
160
184
|
this.extendPoint(high);
|
|
161
185
|
}
|
|
162
186
|
}
|
|
163
|
-
/**
|
|
187
|
+
/**
|
|
188
|
+
* Return a JSON object `{low: ... , high: ...}`
|
|
164
189
|
* with points formatted by `Point3d.toJSON()`
|
|
165
190
|
*/
|
|
166
|
-
toJSON() {
|
|
191
|
+
toJSON() {
|
|
192
|
+
return { low: this.low.toJSON(), high: this.high.toJSON() };
|
|
193
|
+
}
|
|
167
194
|
/** Use `setFromJSON` to parse `json` into a new Range3d instance. */
|
|
168
195
|
static fromJSON(json) {
|
|
169
196
|
const result = new this();
|
|
@@ -191,7 +218,8 @@ export class Range3d extends RangeBase {
|
|
|
191
218
|
result.setDirect(this.low.x, this.low.y, this.low.z, this.high.x, this.high.y, this.high.z, false);
|
|
192
219
|
return result;
|
|
193
220
|
}
|
|
194
|
-
/**
|
|
221
|
+
/**
|
|
222
|
+
* Return a copy, translated by adding `shift` components in all directions.
|
|
195
223
|
* * The translate of a null range is also a null range.
|
|
196
224
|
*/
|
|
197
225
|
cloneTranslated(shift, result) {
|
|
@@ -226,7 +254,7 @@ export class Range3d extends RangeBase {
|
|
|
226
254
|
VariantPointDataStream.streamXYZ(data, collector);
|
|
227
255
|
return collector.claimResult();
|
|
228
256
|
}
|
|
229
|
-
/**
|
|
257
|
+
/** Create a Range3d enclosing the transformed points. */
|
|
230
258
|
static createTransformed(transform, ...point) {
|
|
231
259
|
const result = this.createNull();
|
|
232
260
|
let p;
|
|
@@ -234,13 +262,13 @@ export class Range3d extends RangeBase {
|
|
|
234
262
|
result.extendTransformedXYZ(transform, p.x, p.y, p.z);
|
|
235
263
|
return result;
|
|
236
264
|
}
|
|
237
|
-
/**
|
|
265
|
+
/** Create a Range3d enclosing the transformed points. */
|
|
238
266
|
static createTransformedArray(transform, points) {
|
|
239
267
|
const result = this.createNull();
|
|
240
268
|
result.extendArray(points, transform);
|
|
241
269
|
return result;
|
|
242
270
|
}
|
|
243
|
-
/**
|
|
271
|
+
/** Create a Range3d enclosing the points after inverse transform. */
|
|
244
272
|
static createInverseTransformedArray(transform, points) {
|
|
245
273
|
const result = this.createNull();
|
|
246
274
|
result.extendInverseTransformedArray(points, transform);
|
|
@@ -289,7 +317,7 @@ export class Range3d extends RangeBase {
|
|
|
289
317
|
result.extendPoint(point);
|
|
290
318
|
return result;
|
|
291
319
|
}
|
|
292
|
-
/**
|
|
320
|
+
/** Extend a range around an array of points (optionally transformed) */
|
|
293
321
|
extendArray(points, transform) {
|
|
294
322
|
if (Array.isArray(points))
|
|
295
323
|
if (transform)
|
|
@@ -306,7 +334,7 @@ export class Range3d extends RangeBase {
|
|
|
306
334
|
for (let i = 0; i < points.length; i++)
|
|
307
335
|
this.extendXYZ(points.getXAtUncheckedPointIndex(i), points.getYAtUncheckedPointIndex(i), points.getZAtUncheckedPointIndex(i));
|
|
308
336
|
}
|
|
309
|
-
/**
|
|
337
|
+
/** Extend a range around an array of points (optionally transformed) */
|
|
310
338
|
extendInverseTransformedArray(points, transform) {
|
|
311
339
|
if (Array.isArray(points))
|
|
312
340
|
for (const point of points)
|
|
@@ -315,22 +343,19 @@ export class Range3d extends RangeBase {
|
|
|
315
343
|
for (let i = 0; i < points.length; i++)
|
|
316
344
|
this.extendInverseTransformedXYZ(transform, points.getXAtUncheckedPointIndex(i), points.getYAtUncheckedPointIndex(i), points.getZAtUncheckedPointIndex(i));
|
|
317
345
|
}
|
|
318
|
-
/**
|
|
319
|
-
*/
|
|
346
|
+
/** Multiply the point x,y,z by transform and use the coordinate to extend this range. */
|
|
320
347
|
extendTransformedXYZ(transform, x, y, z) {
|
|
321
348
|
const origin = transform.origin;
|
|
322
349
|
const coffs = transform.matrix.coffs;
|
|
323
350
|
this.extendXYZ(origin.x + coffs[0] * x + coffs[1] * y + coffs[2] * z, origin.y + coffs[3] * x + coffs[4] * y + coffs[5] * z, origin.z + coffs[6] * x + coffs[7] * y + coffs[8] * z);
|
|
324
351
|
}
|
|
325
|
-
/**
|
|
326
|
-
*/
|
|
352
|
+
/** Multiply the point x,y,z,w by transform and use the coordinate to extend this range. */
|
|
327
353
|
extendTransformedXYZW(transform, x, y, z, w) {
|
|
328
354
|
const origin = transform.origin;
|
|
329
355
|
const coffs = transform.matrix.coffs;
|
|
330
356
|
this.extendXYZW(origin.x * w + coffs[0] * x + coffs[1] * y + coffs[2] * z, origin.y * w + coffs[3] * x + coffs[4] * y + coffs[5] * z, origin.z * w + coffs[6] * x + coffs[7] * y + coffs[8] * z, w);
|
|
331
357
|
}
|
|
332
|
-
/**
|
|
333
|
-
*/
|
|
358
|
+
/** Multiply the point x,y,z by the inverse of the transform and use the coordinate to extend this range. */
|
|
334
359
|
extendInverseTransformedXYZ(transform, x, y, z) {
|
|
335
360
|
const origin = transform.origin;
|
|
336
361
|
if (!transform.matrix.computeCachedInverse(true))
|
|
@@ -367,36 +392,72 @@ export class Range3d extends RangeBase {
|
|
|
367
392
|
&& this.high.z === this.low.z;
|
|
368
393
|
}
|
|
369
394
|
/** Return the midpoint of the diagonal. No test for null range. */
|
|
370
|
-
get center() {
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
/**
|
|
374
|
-
get
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
/**
|
|
378
|
-
get
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
/**
|
|
382
|
-
get
|
|
395
|
+
get center() {
|
|
396
|
+
return this.low.interpolate(.5, this.high);
|
|
397
|
+
}
|
|
398
|
+
/** Return the low x coordinate */
|
|
399
|
+
get xLow() {
|
|
400
|
+
return this.low.x;
|
|
401
|
+
}
|
|
402
|
+
/** Return the low y coordinate */
|
|
403
|
+
get yLow() {
|
|
404
|
+
return this.low.y;
|
|
405
|
+
}
|
|
406
|
+
/** Return the low z coordinate */
|
|
407
|
+
get zLow() {
|
|
408
|
+
return this.low.z;
|
|
409
|
+
}
|
|
410
|
+
/** Return the high x coordinate */
|
|
411
|
+
get xHigh() {
|
|
412
|
+
return this.high.x;
|
|
413
|
+
}
|
|
414
|
+
/** Return the high y coordinate */
|
|
415
|
+
get yHigh() {
|
|
416
|
+
return this.high.y;
|
|
417
|
+
}
|
|
418
|
+
/** Return the high z coordinate */
|
|
419
|
+
get zHigh() {
|
|
420
|
+
return this.high.z;
|
|
421
|
+
}
|
|
383
422
|
/** Return the length of the box in the x direction */
|
|
384
|
-
xLength() {
|
|
423
|
+
xLength() {
|
|
424
|
+
const a = this.high.x - this.low.x;
|
|
425
|
+
return a > 0.0 ? a : 0.0;
|
|
426
|
+
}
|
|
385
427
|
/** Return the length of the box in the y direction */
|
|
386
|
-
yLength() {
|
|
428
|
+
yLength() {
|
|
429
|
+
const a = this.high.y - this.low.y;
|
|
430
|
+
return a > 0.0 ? a : 0.0;
|
|
431
|
+
}
|
|
387
432
|
/** Return the length of the box in the z direction */
|
|
388
|
-
zLength() {
|
|
433
|
+
zLength() {
|
|
434
|
+
const a = this.high.z - this.low.z;
|
|
435
|
+
return a > 0.0 ? a : 0.0;
|
|
436
|
+
}
|
|
389
437
|
/** Return the largest of the x,y, z lengths of the range. */
|
|
390
|
-
maxLength() {
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
/**
|
|
394
|
-
|
|
395
|
-
|
|
438
|
+
maxLength() {
|
|
439
|
+
return Math.max(this.xLength(), this.yLength(), this.zLength());
|
|
440
|
+
}
|
|
441
|
+
/**
|
|
442
|
+
* Return the diagonal vector. There is no check for isNull -- if the range isNull(), the vector will have very
|
|
443
|
+
* large negative coordinates.
|
|
444
|
+
*/
|
|
445
|
+
diagonal(result) {
|
|
446
|
+
return this.low.vectorTo(this.high, result);
|
|
447
|
+
}
|
|
448
|
+
/**
|
|
449
|
+
* Return the diagonal vector. There is no check for isNull -- if the range isNull(), the vector will have very
|
|
450
|
+
* large negative coordinates.
|
|
451
|
+
*/
|
|
452
|
+
diagonalFractionToPoint(fraction, result) {
|
|
453
|
+
return this.low.interpolate(fraction, this.high, result);
|
|
454
|
+
}
|
|
455
|
+
/** Return a point given by fractional positions on the XYZ axes. This is done with no check for isNull !!! */
|
|
396
456
|
fractionToPoint(fractionX, fractionY, fractionZ = 0, result) {
|
|
397
457
|
return this.low.interpolateXYZ(fractionX, fractionY, fractionZ, this.high, result);
|
|
398
458
|
}
|
|
399
|
-
/**
|
|
459
|
+
/**
|
|
460
|
+
* Return a point given by fractional positions on the XYZ axes.
|
|
400
461
|
* Returns undefined if the range is null.
|
|
401
462
|
*/
|
|
402
463
|
localXYZToWorld(fractionX, fractionY, fractionZ, result) {
|
|
@@ -404,13 +465,15 @@ export class Range3d extends RangeBase {
|
|
|
404
465
|
return undefined;
|
|
405
466
|
return this.low.interpolateXYZ(fractionX, fractionY, fractionZ, this.high, result);
|
|
406
467
|
}
|
|
407
|
-
/**
|
|
468
|
+
/**
|
|
469
|
+
* Return a point given by fractional positions on the XYZ axes.
|
|
408
470
|
* * Returns undefined if the range is null.
|
|
409
471
|
*/
|
|
410
472
|
localToWorld(xyz, result) {
|
|
411
473
|
return this.localXYZToWorld(xyz.x, xyz.y, xyz.z, result);
|
|
412
474
|
}
|
|
413
|
-
/**
|
|
475
|
+
/**
|
|
476
|
+
* Replace fractional coordinates by world coordinates.
|
|
414
477
|
* @returns false if null range.
|
|
415
478
|
*/
|
|
416
479
|
localToWorldArrayInPlace(points) {
|
|
@@ -420,7 +483,8 @@ export class Range3d extends RangeBase {
|
|
|
420
483
|
this.low.interpolateXYZ(p.x, p.y, p.z, this.high, p);
|
|
421
484
|
return false;
|
|
422
485
|
}
|
|
423
|
-
/**
|
|
486
|
+
/**
|
|
487
|
+
* Return fractional coordinates of point within the range.
|
|
424
488
|
* * returns undefined if the range is null.
|
|
425
489
|
* * returns undefined if any direction (x,y,z) has zero length
|
|
426
490
|
*/
|
|
@@ -432,7 +496,8 @@ export class Range3d extends RangeBase {
|
|
|
432
496
|
return undefined;
|
|
433
497
|
return Point3d.create((point.x - this.low.x) * ax, (point.y - this.low.y) * ay, (point.z - this.low.z) * az, result);
|
|
434
498
|
}
|
|
435
|
-
/**
|
|
499
|
+
/**
|
|
500
|
+
* Return fractional coordinates of point within the range.
|
|
436
501
|
* * returns undefined if the range is null.
|
|
437
502
|
* * returns undefined if any direction (x,y,z) has zero length
|
|
438
503
|
*/
|
|
@@ -446,7 +511,8 @@ export class Range3d extends RangeBase {
|
|
|
446
511
|
Point3d.create((p.x - this.low.x) * ax, (p.y - this.low.y) * ay, (p.z - this.low.z) * az, p);
|
|
447
512
|
return true;
|
|
448
513
|
}
|
|
449
|
-
/**
|
|
514
|
+
/**
|
|
515
|
+
* Return an array with the 8 corners on order wth "x varies fastest, then y, then z"
|
|
450
516
|
* * points preallocated in `result` are reused if result.length >= 8.
|
|
451
517
|
* * in reuse case, result.length is trimmed to 8
|
|
452
518
|
*/
|
|
@@ -471,10 +537,11 @@ export class Range3d extends RangeBase {
|
|
|
471
537
|
Point3d.create(this.low.x, this.low.y, this.high.z),
|
|
472
538
|
Point3d.create(this.high.x, this.low.y, this.high.z),
|
|
473
539
|
Point3d.create(this.low.x, this.high.y, this.high.z),
|
|
474
|
-
Point3d.create(this.high.x, this.high.y, this.high.z)
|
|
540
|
+
Point3d.create(this.high.x, this.high.y, this.high.z),
|
|
475
541
|
];
|
|
476
542
|
}
|
|
477
|
-
/**
|
|
543
|
+
/**
|
|
544
|
+
* Return an array with indices of the corners of a face
|
|
478
545
|
* * face 0 has negative x normal
|
|
479
546
|
* * face 1 has positive x normal
|
|
480
547
|
* * face 2 has negative y normal
|
|
@@ -525,12 +592,18 @@ export class Range3d extends RangeBase {
|
|
|
525
592
|
return 0.0;
|
|
526
593
|
return Math.max(this.low.maxAbs(), this.high.maxAbs());
|
|
527
594
|
}
|
|
528
|
-
/**
|
|
529
|
-
get isAlmostZeroX() {
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
/**
|
|
533
|
-
get
|
|
595
|
+
/** Returns true if the x direction size is nearly zero */
|
|
596
|
+
get isAlmostZeroX() {
|
|
597
|
+
return Geometry.isSmallMetricDistance(this.xLength());
|
|
598
|
+
}
|
|
599
|
+
/** Returns true if the y direction size is nearly zero */
|
|
600
|
+
get isAlmostZeroY() {
|
|
601
|
+
return Geometry.isSmallMetricDistance(this.yLength());
|
|
602
|
+
}
|
|
603
|
+
/** Returns true if the z direction size is nearly zero */
|
|
604
|
+
get isAlmostZeroZ() {
|
|
605
|
+
return Geometry.isSmallMetricDistance(this.zLength());
|
|
606
|
+
}
|
|
534
607
|
/** Test if a point given as x,y,z is within the range. */
|
|
535
608
|
containsXYZ(x, y, z) {
|
|
536
609
|
return x >= this.low.x
|
|
@@ -540,7 +613,7 @@ export class Range3d extends RangeBase {
|
|
|
540
613
|
&& y <= this.high.y
|
|
541
614
|
&& z <= this.high.z;
|
|
542
615
|
}
|
|
543
|
-
/** Test if a point given as x,y is within the range
|
|
616
|
+
/** Test if a point given as x,y is within the range (ignoring z of range). */
|
|
544
617
|
containsXY(x, y) {
|
|
545
618
|
return x >= this.low.x
|
|
546
619
|
&& y >= this.low.y
|
|
@@ -548,7 +621,9 @@ export class Range3d extends RangeBase {
|
|
|
548
621
|
&& y <= this.high.y;
|
|
549
622
|
}
|
|
550
623
|
/** Test if a point is within the range. */
|
|
551
|
-
containsPoint(point) {
|
|
624
|
+
containsPoint(point) {
|
|
625
|
+
return this.containsXYZ(point.x, point.y, point.z);
|
|
626
|
+
}
|
|
552
627
|
/** Test if the x,y coordinates of a point are within the range. */
|
|
553
628
|
containsPointXY(point) {
|
|
554
629
|
return point.x >= this.low.x
|
|
@@ -574,7 +649,7 @@ export class Range3d extends RangeBase {
|
|
|
574
649
|
|| other.low.y > this.high.y
|
|
575
650
|
|| other.low.z > this.high.z);
|
|
576
651
|
}
|
|
577
|
-
/** Test if there is any intersection with other range */
|
|
652
|
+
/** Test if there is any intersection with other range, ignoring z. */
|
|
578
653
|
intersectsRangeXY(other) {
|
|
579
654
|
return !(this.low.x > other.high.x
|
|
580
655
|
|| this.low.y > other.high.y
|
|
@@ -587,7 +662,7 @@ export class Range3d extends RangeBase {
|
|
|
587
662
|
return RangeBase._EXTREME_POSITIVE;
|
|
588
663
|
return Math.min(Geometry.hypotenuseXYZ(RangeBase.coordinateToRangeAbsoluteDistance(point.x, this.low.x, this.high.x), RangeBase.coordinateToRangeAbsoluteDistance(point.y, this.low.y, this.high.y), RangeBase.coordinateToRangeAbsoluteDistance(point.z, this.low.z, this.high.z)), RangeBase._EXTREME_POSITIVE);
|
|
589
664
|
}
|
|
590
|
-
/**
|
|
665
|
+
/** Returns 0 if the ranges have any overlap, otherwise the shortest absolute distance from one to the other. */
|
|
591
666
|
distanceToRange(other) {
|
|
592
667
|
return Math.min(Geometry.hypotenuseXYZ(RangeBase.rangeToRangeAbsoluteDistance(this.low.x, this.high.x, other.low.x, other.high.x), RangeBase.rangeToRangeAbsoluteDistance(this.low.y, this.high.y, other.low.y, other.high.y), RangeBase.rangeToRangeAbsoluteDistance(this.low.z, this.high.z, other.low.z, other.high.z)), RangeBase._EXTREME_POSITIVE);
|
|
593
668
|
}
|
|
@@ -672,7 +747,8 @@ export class Range3d extends RangeBase {
|
|
|
672
747
|
this.extendXYZ(other.high.x, other.high.y, other.high.z);
|
|
673
748
|
}
|
|
674
749
|
}
|
|
675
|
-
/**
|
|
750
|
+
/**
|
|
751
|
+
* In each direction look at the difference between this range limit and that of interiorRange.
|
|
676
752
|
* * If this range is larger, expand it by extrapolationFactor.
|
|
677
753
|
*/
|
|
678
754
|
extendWhenLarger(other, extrapolationFactor) {
|
|
@@ -701,7 +777,7 @@ export class Range3d extends RangeBase {
|
|
|
701
777
|
return Range3d.createXYZXYZOrCorrectToNull(Math.min(this.low.x, other.low.x), Math.min(this.low.y, other.low.y), Math.min(this.low.z, other.low.z), Math.max(this.high.x, other.high.x), Math.max(this.high.y, other.high.y), Math.max(this.high.z, other.high.z), result);
|
|
702
778
|
}
|
|
703
779
|
/**
|
|
704
|
-
*
|
|
780
|
+
* Move low and high points by scaleFactor around the center point.
|
|
705
781
|
* @param scaleFactor scale factor applied to low, high distance from center.
|
|
706
782
|
*/
|
|
707
783
|
scaleAboutCenterInPlace(scaleFactor) {
|
|
@@ -720,7 +796,7 @@ export class Range3d extends RangeBase {
|
|
|
720
796
|
}
|
|
721
797
|
}
|
|
722
798
|
/**
|
|
723
|
-
*
|
|
799
|
+
* Move all limits by a fixed amount.
|
|
724
800
|
* * positive delta expands the range size
|
|
725
801
|
* * negative delta reduces the range size
|
|
726
802
|
* * if any dimension reduces below zero size, the whole range becomes null
|
|
@@ -734,7 +810,8 @@ export class Range3d extends RangeBase {
|
|
|
734
810
|
return Transform.createOriginAndMatrix(Point3d.create(this.low.x, this.low.y, this.low.z), Matrix3d.createRowValues(this.high.x - this.low.x, 0, 0, 0, this.high.y - this.low.y, 0, 0, 0, this.high.z - this.low.z), result);
|
|
735
811
|
}
|
|
736
812
|
/**
|
|
737
|
-
* Creates an NPC to world transformation to go from 000...111 to the globally aligned cube with diagonally
|
|
813
|
+
* Creates an NPC to world transformation to go from 000...111 to the globally aligned cube with diagonally
|
|
814
|
+
* opposite corners that are the
|
|
738
815
|
* min and max of this range. The diagonal component for any degenerate direction is 1.
|
|
739
816
|
*/
|
|
740
817
|
getNpcToWorldRangeTransform(result) {
|
|
@@ -748,7 +825,9 @@ export class Range3d extends RangeBase {
|
|
|
748
825
|
matrix.coffs[8] = 1;
|
|
749
826
|
return transform;
|
|
750
827
|
}
|
|
751
|
-
/**
|
|
828
|
+
/**
|
|
829
|
+
* Ensure that the length of each dimension of this AxisAlignedBox3d is at least a minimum size. If not, expand
|
|
830
|
+
* to minimum about the center.
|
|
752
831
|
* @param min The minimum length for each dimension.
|
|
753
832
|
*/
|
|
754
833
|
ensureMinLengths(min = .001) {
|
|
@@ -777,7 +856,7 @@ export class Range3d extends RangeBase {
|
|
|
777
856
|
* @public
|
|
778
857
|
*/
|
|
779
858
|
export class Range1d extends RangeBase {
|
|
780
|
-
/**
|
|
859
|
+
/** Reset the low and high to null range state. */
|
|
781
860
|
setNull() {
|
|
782
861
|
this.low = RangeBase._EXTREME_POSITIVE;
|
|
783
862
|
this.high = RangeBase._EXTREME_NEGATIVE;
|
|
@@ -801,10 +880,13 @@ export class Range1d extends RangeBase {
|
|
|
801
880
|
return (Geometry.isSameCoordinate(this.low, other.low) && Geometry.isSameCoordinate(this.high, other.high))
|
|
802
881
|
|| (this.isNull && other.isNull);
|
|
803
882
|
}
|
|
804
|
-
/**
|
|
805
|
-
setFrom(other) {
|
|
806
|
-
|
|
807
|
-
|
|
883
|
+
/** Copy contents from other Range1d. */
|
|
884
|
+
setFrom(other) {
|
|
885
|
+
this.low = other.low;
|
|
886
|
+
this.high = other.high;
|
|
887
|
+
}
|
|
888
|
+
/**
|
|
889
|
+
* Convert from a JSON object of one of these forms:
|
|
808
890
|
* * Any array of numbers: `[value,value, value]`
|
|
809
891
|
* * An object with low and high as properties: `{low:lowValue, high: highValue}`
|
|
810
892
|
*/
|
|
@@ -829,16 +911,20 @@ export class Range1d extends RangeBase {
|
|
|
829
911
|
result.setFromJSON(json);
|
|
830
912
|
return result;
|
|
831
913
|
}
|
|
832
|
-
/**
|
|
914
|
+
/**
|
|
915
|
+
* Convert to a JSON object of form
|
|
833
916
|
* ```
|
|
834
917
|
* [lowValue,highValue]
|
|
835
918
|
* ```
|
|
836
919
|
*/
|
|
837
|
-
toJSON() {
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
|
|
920
|
+
toJSON() {
|
|
921
|
+
if (this.isNull)
|
|
922
|
+
return new Array();
|
|
923
|
+
else
|
|
924
|
+
return [this.low, this.high];
|
|
925
|
+
}
|
|
926
|
+
/**
|
|
927
|
+
* Return a new Range1d with contents of this.
|
|
842
928
|
* @param result optional result.
|
|
843
929
|
*/
|
|
844
930
|
clone(result) {
|
|
@@ -846,7 +932,8 @@ export class Range1d extends RangeBase {
|
|
|
846
932
|
result.setDirect(this.low, this.high);
|
|
847
933
|
return result;
|
|
848
934
|
}
|
|
849
|
-
/**
|
|
935
|
+
/**
|
|
936
|
+
* Return a new Range1d with contents of this.
|
|
850
937
|
* @param result optional result.
|
|
851
938
|
*/
|
|
852
939
|
static createFrom(other, result) {
|
|
@@ -854,7 +941,8 @@ export class Range1d extends RangeBase {
|
|
|
854
941
|
result.setDirect(other.low, other.high);
|
|
855
942
|
return result;
|
|
856
943
|
}
|
|
857
|
-
/**
|
|
944
|
+
/**
|
|
945
|
+
* Create a range with no content.
|
|
858
946
|
* @param result optional result.
|
|
859
947
|
*/
|
|
860
948
|
static createNull(result) {
|
|
@@ -862,7 +950,8 @@ export class Range1d extends RangeBase {
|
|
|
862
950
|
result.setNull();
|
|
863
951
|
return result;
|
|
864
952
|
}
|
|
865
|
-
/**
|
|
953
|
+
/**
|
|
954
|
+
* Create a range with `delta` added to low and high
|
|
866
955
|
* * If `this` is a null range, return a null range.
|
|
867
956
|
*/
|
|
868
957
|
cloneTranslated(delta, result) {
|
|
@@ -877,7 +966,9 @@ export class Range1d extends RangeBase {
|
|
|
877
966
|
* Set this range to be a single value.
|
|
878
967
|
* @param x value to use as both low and high.
|
|
879
968
|
*/
|
|
880
|
-
setX(x) {
|
|
969
|
+
setX(x) {
|
|
970
|
+
this.low = this.high = x;
|
|
971
|
+
}
|
|
881
972
|
/** Create a single point box */
|
|
882
973
|
static createX(x, result) {
|
|
883
974
|
result = result ? result : new this();
|
|
@@ -899,10 +990,12 @@ export class Range1d extends RangeBase {
|
|
|
899
990
|
this.high = x0;
|
|
900
991
|
}
|
|
901
992
|
}
|
|
993
|
+
/** Check if low is 0 and high is 1 */
|
|
902
994
|
get isExact01() {
|
|
903
995
|
return this.low === 0.0 && this.high === 1.0;
|
|
904
996
|
}
|
|
905
|
-
/**
|
|
997
|
+
/**
|
|
998
|
+
* Create a box from two values. Values are reversed if needed
|
|
906
999
|
* @param xA first value
|
|
907
1000
|
* @param xB second value
|
|
908
1001
|
*/
|
|
@@ -911,7 +1004,8 @@ export class Range1d extends RangeBase {
|
|
|
911
1004
|
result.setDirect(Math.min(xA, xB), Math.max(xA, xB));
|
|
912
1005
|
return result;
|
|
913
1006
|
}
|
|
914
|
-
/**
|
|
1007
|
+
/**
|
|
1008
|
+
* Create a box from two values, but null range if the values are reversed
|
|
915
1009
|
* @param xA first value
|
|
916
1010
|
* @param xB second value
|
|
917
1011
|
*/
|
|
@@ -922,7 +1016,8 @@ export class Range1d extends RangeBase {
|
|
|
922
1016
|
result.setDirect(Math.min(xA, xB), Math.max(xA, xB));
|
|
923
1017
|
return result;
|
|
924
1018
|
}
|
|
925
|
-
/**
|
|
1019
|
+
/**
|
|
1020
|
+
* Create a range containing all the values in an array.
|
|
926
1021
|
* @param values array of points to be contained in the range.
|
|
927
1022
|
* @param result optional result.
|
|
928
1023
|
*/
|
|
@@ -933,13 +1028,14 @@ export class Range1d extends RangeBase {
|
|
|
933
1028
|
result.extendX(x);
|
|
934
1029
|
return result;
|
|
935
1030
|
}
|
|
936
|
-
/**
|
|
1031
|
+
/** Extend to include an array of values */
|
|
937
1032
|
extendArray(values) {
|
|
938
1033
|
let x;
|
|
939
1034
|
for (x of values)
|
|
940
1035
|
this.extendX(x);
|
|
941
1036
|
}
|
|
942
|
-
/**
|
|
1037
|
+
/**
|
|
1038
|
+
* Extend to include `values` at indices `beginIndex <= i < endIndex]`
|
|
943
1039
|
* @param values array of values
|
|
944
1040
|
* @param beginIndex first index to include
|
|
945
1041
|
* @param numValue number of values to access
|
|
@@ -958,8 +1054,11 @@ export class Range1d extends RangeBase {
|
|
|
958
1054
|
return this.high === this.low;
|
|
959
1055
|
}
|
|
960
1056
|
/** Return the length of the range in the x direction */
|
|
961
|
-
length() {
|
|
962
|
-
|
|
1057
|
+
length() {
|
|
1058
|
+
const a = this.high - this.low;
|
|
1059
|
+
return a > 0.0 ? a : 0.0;
|
|
1060
|
+
}
|
|
1061
|
+
/** Return a point given by fractional positions within the range. This is done with no check for isNull !!! */
|
|
963
1062
|
fractionToPoint(fraction) {
|
|
964
1063
|
return Geometry.interpolate(this.low, fraction, this.high);
|
|
965
1064
|
}
|
|
@@ -970,7 +1069,9 @@ export class Range1d extends RangeBase {
|
|
|
970
1069
|
return Math.max(Math.abs(this.low), Math.abs(this.high));
|
|
971
1070
|
}
|
|
972
1071
|
/** Test if the x direction size is nearly zero */
|
|
973
|
-
get isAlmostZeroLength() {
|
|
1072
|
+
get isAlmostZeroLength() {
|
|
1073
|
+
return Geometry.isSmallMetricDistance(this.length());
|
|
1074
|
+
}
|
|
974
1075
|
/** Test if a number is within the range. */
|
|
975
1076
|
containsX(x) {
|
|
976
1077
|
return x >= this.low
|
|
@@ -990,7 +1091,6 @@ export class Range1d extends RangeBase {
|
|
|
990
1091
|
* * For x1 > x0, that range is null, and the intersection is null.
|
|
991
1092
|
* * For x0 <= x1, the input is a non-null range.
|
|
992
1093
|
* * The intersection range replaces the contents of this.
|
|
993
|
-
*
|
|
994
1094
|
*/
|
|
995
1095
|
intersectRangeXXInPlace(x0, x1) {
|
|
996
1096
|
if (x1 < x0 || x1 < this.low || x0 > this.high) {
|
|
@@ -1003,7 +1103,7 @@ export class Range1d extends RangeBase {
|
|
|
1003
1103
|
this.low = x0;
|
|
1004
1104
|
}
|
|
1005
1105
|
}
|
|
1006
|
-
/**
|
|
1106
|
+
/** Returns 0 if the ranges have any overlap, otherwise the shortest absolute distance from one to the other. */
|
|
1007
1107
|
distanceToRange(other) {
|
|
1008
1108
|
return RangeBase.rangeToRangeAbsoluteDistance(this.low, this.high, other.low, other.high);
|
|
1009
1109
|
}
|
|
@@ -1055,7 +1155,7 @@ export class Range1d extends RangeBase {
|
|
|
1055
1155
|
return Range1d.createXX(Math.min(this.low, other.low), Math.max(this.high, other.high), result);
|
|
1056
1156
|
}
|
|
1057
1157
|
/**
|
|
1058
|
-
*
|
|
1158
|
+
* Move low and high points by scaleFactor around the center point.
|
|
1059
1159
|
* @param scaleFactor scale factor applied to low, high distance from center.
|
|
1060
1160
|
*/
|
|
1061
1161
|
scaleAboutCenterInPlace(scaleFactor) {
|
|
@@ -1068,7 +1168,7 @@ export class Range1d extends RangeBase {
|
|
|
1068
1168
|
}
|
|
1069
1169
|
}
|
|
1070
1170
|
/**
|
|
1071
|
-
*
|
|
1171
|
+
* Move all limits by a fixed amount.
|
|
1072
1172
|
* * positive delta expands the range size
|
|
1073
1173
|
* * negative delta reduces the range size
|
|
1074
1174
|
* * if any dimension reduces below zero size, the whole range becomes null
|
|
@@ -1078,13 +1178,14 @@ export class Range1d extends RangeBase {
|
|
|
1078
1178
|
this.setDirect(this.low - delta, this.high + delta, true);
|
|
1079
1179
|
}
|
|
1080
1180
|
/**
|
|
1081
|
-
*
|
|
1181
|
+
* Clip this range to a linear half space condition
|
|
1082
1182
|
* * if `limitA > limitB` the limit space is empty
|
|
1083
1183
|
* * make this range null
|
|
1084
1184
|
* * return false;
|
|
1085
1185
|
* * otherwise (i.e `limitA <= limitB`)
|
|
1086
1186
|
* * solve `a + u * f = limitA' and `a + u * f = limitA`
|
|
1087
|
-
* * if unable to solve (i.e. u near zero), `a` alone determines whether to (a) leave this interval unchanged or
|
|
1187
|
+
* * if unable to solve (i.e. u near zero), `a` alone determines whether to (a) leave this interval unchanged or
|
|
1188
|
+
* (b) reduce to nothing.
|
|
1088
1189
|
* * the `f` values are an interval in the space of this `Range1d`
|
|
1089
1190
|
* * restrict the range to that interval (i.e intersect existing (low,high) with the fraction interval.
|
|
1090
1191
|
* * return true if the range is non-null after the clip.
|
|
@@ -1093,7 +1194,6 @@ export class Range1d extends RangeBase {
|
|
|
1093
1194
|
* @param limitA crossing value, assumed in range relation with limitB
|
|
1094
1195
|
* @param limitB crossing value, assumed in range relation with limitB
|
|
1095
1196
|
* @param limitIsHigh true if the limit is an upper limit on mapped values.
|
|
1096
|
-
*
|
|
1097
1197
|
*/
|
|
1098
1198
|
clipLinearMapToInterval(a, u, limitA, limitB) {
|
|
1099
1199
|
// f = (limit - a) / u
|
|
@@ -1132,7 +1232,7 @@ export class Range1d extends RangeBase {
|
|
|
1132
1232
|
* @public
|
|
1133
1233
|
*/
|
|
1134
1234
|
export class Range2d extends RangeBase {
|
|
1135
|
-
/**
|
|
1235
|
+
/** Reset the low and high to null range state. */
|
|
1136
1236
|
setNull() {
|
|
1137
1237
|
this.low.x = RangeBase._EXTREME_POSITIVE;
|
|
1138
1238
|
this.low.y = RangeBase._EXTREME_POSITIVE;
|
|
@@ -1140,9 +1240,13 @@ export class Range2d extends RangeBase {
|
|
|
1140
1240
|
this.high.y = RangeBase._EXTREME_NEGATIVE;
|
|
1141
1241
|
}
|
|
1142
1242
|
/** Flatten the low and high coordinates of any json object with low.x .. high.y into an array of 4 doubles */
|
|
1143
|
-
static toFloat64Array(val) {
|
|
1243
|
+
static toFloat64Array(val) {
|
|
1244
|
+
return Float64Array.of(val.low.x, val.low.y, val.high.x, val.high.y);
|
|
1245
|
+
}
|
|
1144
1246
|
/** Flatten the low and high coordinates of this instance into an array of 4 doubles */
|
|
1145
|
-
toFloat64Array() {
|
|
1247
|
+
toFloat64Array() {
|
|
1248
|
+
return Range2d.toFloat64Array(this);
|
|
1249
|
+
}
|
|
1146
1250
|
/**
|
|
1147
1251
|
* Construct a Range2d from an array of double-precision values
|
|
1148
1252
|
* @param f64 the array, which should contain exactly 4 values in this order: lowX, lowY, highX, highY
|
|
@@ -1154,12 +1258,15 @@ export class Range2d extends RangeBase {
|
|
|
1154
1258
|
return new this(f64[0], f64[1], f64[2], f64[3]);
|
|
1155
1259
|
}
|
|
1156
1260
|
/**
|
|
1157
|
-
* Construct a Range2d from an un-typed array. This mostly useful when interpreting ECSQL query results of
|
|
1261
|
+
* Construct a Range2d from an un-typed array. This mostly useful when interpreting ECSQL query results of
|
|
1262
|
+
* the 'blob' type, where you know that that result is a Range3d.
|
|
1158
1263
|
* @param buffer untyped array
|
|
1159
1264
|
* @return a new Range2d object
|
|
1160
1265
|
*/
|
|
1161
|
-
static fromArrayBuffer(buffer) {
|
|
1162
|
-
|
|
1266
|
+
static fromArrayBuffer(buffer) {
|
|
1267
|
+
return this.fromFloat64Array(new Float64Array(buffer));
|
|
1268
|
+
}
|
|
1269
|
+
// explicit constructor - no enforcement of value relationships
|
|
1163
1270
|
constructor(lowX = Range2d._EXTREME_POSITIVE, lowY = Range2d._EXTREME_POSITIVE, highX = Range2d._EXTREME_NEGATIVE, highY = Range2d._EXTREME_NEGATIVE) {
|
|
1164
1271
|
super();
|
|
1165
1272
|
this.low = Point2d.create(lowX, lowY);
|
|
@@ -1170,12 +1277,12 @@ export class Range2d extends RangeBase {
|
|
|
1170
1277
|
return (this.low.isAlmostEqual(other.low) && this.high.isAlmostEqual(other.high))
|
|
1171
1278
|
|| (this.isNull && other.isNull);
|
|
1172
1279
|
}
|
|
1173
|
-
/**
|
|
1280
|
+
/** Copy all content from any `other` that has low and high xy data. */
|
|
1174
1281
|
setFrom(other) {
|
|
1175
1282
|
this.low.set(other.low.x, other.low.y);
|
|
1176
1283
|
this.high.set(other.high.x, other.high.y);
|
|
1177
1284
|
}
|
|
1178
|
-
/**
|
|
1285
|
+
/** Create a new Range2d from any `other` that has low and high xy data. */
|
|
1179
1286
|
static createFrom(other, result) {
|
|
1180
1287
|
if (result) {
|
|
1181
1288
|
result.setFrom(other);
|
|
@@ -1183,7 +1290,7 @@ export class Range2d extends RangeBase {
|
|
|
1183
1290
|
}
|
|
1184
1291
|
return this.createXYXYOrCorrectToNull(other.low.x, other.low.y, other.high.x, other.high.y, result);
|
|
1185
1292
|
}
|
|
1186
|
-
/**
|
|
1293
|
+
/** Treat any array of numbers as numbers to be inserted !!! */
|
|
1187
1294
|
setFromJSON(json) {
|
|
1188
1295
|
this.setNull();
|
|
1189
1296
|
if (Array.isArray(json)) {
|
|
@@ -1202,9 +1309,15 @@ export class Range2d extends RangeBase {
|
|
|
1202
1309
|
}
|
|
1203
1310
|
}
|
|
1204
1311
|
/** Freeze this instance (and its members) so it is read-only */
|
|
1205
|
-
freeze() {
|
|
1206
|
-
|
|
1207
|
-
|
|
1312
|
+
freeze() {
|
|
1313
|
+
this.low.freeze();
|
|
1314
|
+
this.high.freeze();
|
|
1315
|
+
return Object.freeze(this);
|
|
1316
|
+
}
|
|
1317
|
+
/** Return json array with two points as produced by `Point2d.toJSON` */
|
|
1318
|
+
toJSON() {
|
|
1319
|
+
return this.isNull ? [] : [this.low.toJSON(), this.high.toJSON()];
|
|
1320
|
+
}
|
|
1208
1321
|
/** Use `setFromJSON` to parse `json` into a new Range2d instance. */
|
|
1209
1322
|
static fromJSON(json) {
|
|
1210
1323
|
const result = new this();
|
|
@@ -1223,13 +1336,13 @@ export class Range2d extends RangeBase {
|
|
|
1223
1336
|
this.setNull();
|
|
1224
1337
|
}
|
|
1225
1338
|
}
|
|
1226
|
-
/**
|
|
1339
|
+
/** Return a clone of this range (or copy to optional result) */
|
|
1227
1340
|
clone(result) {
|
|
1228
1341
|
result = result ? result : new this.constructor();
|
|
1229
1342
|
result.setDirect(this.low.x, this.low.y, this.high.x, this.high.y, false);
|
|
1230
1343
|
return result;
|
|
1231
1344
|
}
|
|
1232
|
-
/**
|
|
1345
|
+
/** Create a range with no content. */
|
|
1233
1346
|
static createNull(result) {
|
|
1234
1347
|
result = result ? result : new this();
|
|
1235
1348
|
result.setNull();
|
|
@@ -1279,7 +1392,10 @@ export class Range2d extends RangeBase {
|
|
|
1279
1392
|
return this.high.x < this.low.x
|
|
1280
1393
|
|| this.high.y < this.low.y;
|
|
1281
1394
|
}
|
|
1282
|
-
/**
|
|
1395
|
+
/**
|
|
1396
|
+
* Test if the box has high strictly less than low for any of x,y, condition. Note that a range around a
|
|
1397
|
+
* single point is NOT null.
|
|
1398
|
+
*/
|
|
1283
1399
|
static isNull(range) {
|
|
1284
1400
|
return range.high.x < range.low.x
|
|
1285
1401
|
|| range.high.y < range.low.y;
|
|
@@ -1290,28 +1406,55 @@ export class Range2d extends RangeBase {
|
|
|
1290
1406
|
&& this.high.y === this.low.y;
|
|
1291
1407
|
}
|
|
1292
1408
|
/** Return the midpoint of the diagonal. No test for null range. */
|
|
1293
|
-
get center() {
|
|
1294
|
-
|
|
1295
|
-
|
|
1296
|
-
/**
|
|
1297
|
-
get
|
|
1298
|
-
|
|
1299
|
-
|
|
1300
|
-
/**
|
|
1301
|
-
get
|
|
1409
|
+
get center() {
|
|
1410
|
+
return this.low.interpolate(.5, this.high);
|
|
1411
|
+
}
|
|
1412
|
+
/** Return the low x coordinate */
|
|
1413
|
+
get xLow() {
|
|
1414
|
+
return this.low.x;
|
|
1415
|
+
}
|
|
1416
|
+
/** Return the low y coordinate */
|
|
1417
|
+
get yLow() {
|
|
1418
|
+
return this.low.y;
|
|
1419
|
+
}
|
|
1420
|
+
/** Return the high x coordinate */
|
|
1421
|
+
get xHigh() {
|
|
1422
|
+
return this.high.x;
|
|
1423
|
+
}
|
|
1424
|
+
/** Return the high y coordinate */
|
|
1425
|
+
get yHigh() {
|
|
1426
|
+
return this.high.y;
|
|
1427
|
+
}
|
|
1302
1428
|
/** Length of the box in the x direction */
|
|
1303
|
-
xLength() {
|
|
1429
|
+
xLength() {
|
|
1430
|
+
const a = this.high.x - this.low.x;
|
|
1431
|
+
return a > 0.0 ? a : 0.0;
|
|
1432
|
+
}
|
|
1304
1433
|
/** Length of the box in the y direction */
|
|
1305
|
-
yLength() {
|
|
1306
|
-
|
|
1307
|
-
|
|
1308
|
-
|
|
1309
|
-
|
|
1310
|
-
|
|
1434
|
+
yLength() {
|
|
1435
|
+
const a = this.high.y - this.low.y;
|
|
1436
|
+
return a > 0.0 ? a : 0.0;
|
|
1437
|
+
}
|
|
1438
|
+
/**
|
|
1439
|
+
* Return the diagonal vector. There is no check for isNull -- if the range isNull(), the vector will have very
|
|
1440
|
+
* large negative coordinates.
|
|
1441
|
+
*/
|
|
1442
|
+
diagonal(result) {
|
|
1443
|
+
return this.low.vectorTo(this.high, result);
|
|
1444
|
+
}
|
|
1445
|
+
/**
|
|
1446
|
+
* Return the point at the specified fraction along the diagonal vector. There is no check for isNull -- if the
|
|
1447
|
+
* range isNull(), the vector will have very large negative coordinates.
|
|
1448
|
+
*/
|
|
1449
|
+
diagonalFractionToPoint(fraction, result) {
|
|
1450
|
+
return this.low.interpolate(fraction, this.high, result);
|
|
1451
|
+
}
|
|
1452
|
+
/** Return a point given by fractional positions on the XY axes. This is done with no check for isNull !!! */
|
|
1311
1453
|
fractionToPoint(fractionX, fractionY, result) {
|
|
1312
1454
|
return this.low.interpolateXY(fractionX, fractionY, this.high, result);
|
|
1313
1455
|
}
|
|
1314
|
-
/**
|
|
1456
|
+
/**
|
|
1457
|
+
* Return an array with the 4 corners.
|
|
1315
1458
|
* * if asLoop is false, 4 corners are "x varies fastest, then y"
|
|
1316
1459
|
* * if asLoop is true, 5 corners are in CCW order WITH CLOSURE
|
|
1317
1460
|
*/
|
|
@@ -1322,13 +1465,13 @@ export class Range2d extends RangeBase {
|
|
|
1322
1465
|
Point3d.create(this.high.x, this.low.y, z),
|
|
1323
1466
|
Point3d.create(this.high.x, this.high.y, z),
|
|
1324
1467
|
Point3d.create(this.low.x, this.high.y, z),
|
|
1325
|
-
Point3d.create(this.low.x, this.low.y, z)
|
|
1468
|
+
Point3d.create(this.low.x, this.low.y, z),
|
|
1326
1469
|
];
|
|
1327
1470
|
return [
|
|
1328
1471
|
Point3d.create(this.low.x, this.low.y, z),
|
|
1329
1472
|
Point3d.create(this.high.x, this.low.y, z),
|
|
1330
1473
|
Point3d.create(this.low.x, this.high.y, z),
|
|
1331
|
-
Point3d.create(this.high.x, this.high.y, z)
|
|
1474
|
+
Point3d.create(this.high.x, this.high.y, z),
|
|
1332
1475
|
];
|
|
1333
1476
|
}
|
|
1334
1477
|
/** Largest absolute value among any coordinates in the box corners. */
|
|
@@ -1338,10 +1481,14 @@ export class Range2d extends RangeBase {
|
|
|
1338
1481
|
return Math.max(this.low.maxAbs(), this.high.maxAbs());
|
|
1339
1482
|
}
|
|
1340
1483
|
/** Test if the x direction size is nearly zero */
|
|
1341
|
-
get isAlmostZeroX() {
|
|
1484
|
+
get isAlmostZeroX() {
|
|
1485
|
+
return Geometry.isSmallMetricDistance(this.xLength());
|
|
1486
|
+
}
|
|
1342
1487
|
/** Test if the y direction size is nearly zero */
|
|
1343
|
-
get isAlmostZeroY() {
|
|
1344
|
-
|
|
1488
|
+
get isAlmostZeroY() {
|
|
1489
|
+
return Geometry.isSmallMetricDistance(this.yLength());
|
|
1490
|
+
}
|
|
1491
|
+
/** Test if a point given as x,y is within the range */
|
|
1345
1492
|
containsXY(x, y) {
|
|
1346
1493
|
return x >= this.low.x
|
|
1347
1494
|
&& y >= this.low.y
|
|
@@ -1349,7 +1496,9 @@ export class Range2d extends RangeBase {
|
|
|
1349
1496
|
&& y <= this.high.y;
|
|
1350
1497
|
}
|
|
1351
1498
|
/** Test if a point is within the range. */
|
|
1352
|
-
containsPoint(point) {
|
|
1499
|
+
containsPoint(point) {
|
|
1500
|
+
return this.containsXY(point.x, point.y);
|
|
1501
|
+
}
|
|
1353
1502
|
/** Test of other range is within this range */
|
|
1354
1503
|
containsRange(other) {
|
|
1355
1504
|
return other.low.x >= this.low.x
|
|
@@ -1392,7 +1541,9 @@ export class Range2d extends RangeBase {
|
|
|
1392
1541
|
this.extendXY(x1, y1);
|
|
1393
1542
|
}
|
|
1394
1543
|
/** Expand this range to include a point. */
|
|
1395
|
-
extendPoint(point) {
|
|
1544
|
+
extendPoint(point) {
|
|
1545
|
+
this.extendXY(point.x, point.y);
|
|
1546
|
+
}
|
|
1396
1547
|
/** Expand this range to include a range. */
|
|
1397
1548
|
extendRange(other) {
|
|
1398
1549
|
if (!Range2d.isNull(other)) {
|
|
@@ -1416,7 +1567,7 @@ export class Range2d extends RangeBase {
|
|
|
1416
1567
|
return Range2d.createXYXY(Math.min(this.low.x, other.low.x), Math.min(this.low.y, other.low.y), Math.max(this.high.x, other.high.x), Math.max(this.high.y, other.high.y), result);
|
|
1417
1568
|
}
|
|
1418
1569
|
/**
|
|
1419
|
-
*
|
|
1570
|
+
* Move low and high points by scaleFactor around the center point.
|
|
1420
1571
|
* @param scaleFactor scale factor applied to low, high distance from center.
|
|
1421
1572
|
*/
|
|
1422
1573
|
scaleAboutCenterInPlace(scaleFactor) {
|
|
@@ -1432,7 +1583,7 @@ export class Range2d extends RangeBase {
|
|
|
1432
1583
|
}
|
|
1433
1584
|
}
|
|
1434
1585
|
/**
|
|
1435
|
-
*
|
|
1586
|
+
* Move all limits by a fixed amount.
|
|
1436
1587
|
* * positive delta expands the range size
|
|
1437
1588
|
* * negative delta reduces the range size
|
|
1438
1589
|
* * if any dimension reduces below zero size, the whole range becomes null
|
|
@@ -1441,7 +1592,8 @@ export class Range2d extends RangeBase {
|
|
|
1441
1592
|
expandInPlace(delta) {
|
|
1442
1593
|
this.setDirect(this.low.x - delta, this.low.y - delta, this.high.x + delta, this.high.y + delta, true);
|
|
1443
1594
|
}
|
|
1444
|
-
/**
|
|
1595
|
+
/**
|
|
1596
|
+
* Return fractional coordinates of point within the range.
|
|
1445
1597
|
* * returns undefined if the range is null.
|
|
1446
1598
|
* * returns undefined if any direction (x,y) has zero length
|
|
1447
1599
|
*/
|