@itwin/core-geometry 5.4.0-dev.6 → 5.4.0-dev.7
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 +13 -1
- package/lib/cjs/Constant.js.map +1 -1
- package/lib/cjs/Geometry.js.map +1 -1
- package/lib/cjs/bspline/AkimaCurve3d.js.map +1 -1
- package/lib/cjs/bspline/BSpline1dNd.js.map +1 -1
- package/lib/cjs/bspline/BSplineCurve.js.map +1 -1
- package/lib/cjs/bspline/BSplineCurve3dH.js.map +1 -1
- package/lib/cjs/bspline/BSplineCurveOps.js.map +1 -1
- package/lib/cjs/bspline/BSplineSurface.js.map +1 -1
- package/lib/cjs/bspline/Bezier1dNd.js.map +1 -1
- package/lib/cjs/bspline/BezierCurve3d.js.map +1 -1
- package/lib/cjs/bspline/BezierCurve3dH.js.map +1 -1
- package/lib/cjs/bspline/BezierCurveBase.js.map +1 -1
- package/lib/cjs/bspline/InterpolationCurve3d.js.map +1 -1
- package/lib/cjs/bspline/KnotVector.js.map +1 -1
- package/lib/cjs/bspline/SurfaceLocationDetail.js.map +1 -1
- package/lib/cjs/clipping/AlternatingConvexClipTree.js.map +1 -1
- package/lib/cjs/clipping/BooleanClipFactory.js.map +1 -1
- package/lib/cjs/clipping/BooleanClipNode.js.map +1 -1
- package/lib/cjs/clipping/ClipPlane.js.map +1 -1
- package/lib/cjs/clipping/ClipPrimitive.js.map +1 -1
- package/lib/cjs/clipping/ClipUtils.js.map +1 -1
- package/lib/cjs/clipping/ClipVector.js.map +1 -1
- package/lib/cjs/clipping/ConvexClipPlaneSet.js.map +1 -1
- package/lib/cjs/clipping/UnionOfConvexClipPlaneSets.js.map +1 -1
- package/lib/cjs/clipping/internalContexts/LineStringOffsetClipperContext.js.map +1 -1
- package/lib/cjs/core-geometry.js.map +1 -1
- package/lib/cjs/curve/Arc3d.js.map +1 -1
- package/lib/cjs/curve/ConstructCurveBetweenCurves.js.map +1 -1
- package/lib/cjs/curve/CoordinateXYZ.js.map +1 -1
- package/lib/cjs/curve/CurveChainWithDistanceIndex.js.map +1 -1
- package/lib/cjs/curve/CurveCollection.js.map +1 -1
- package/lib/cjs/curve/CurveCurve.js.map +1 -1
- package/lib/cjs/curve/CurveExtendMode.js.map +1 -1
- package/lib/cjs/curve/CurveFactory.js.map +1 -1
- package/lib/cjs/curve/CurveLocationDetail.js.map +1 -1
- package/lib/cjs/curve/CurveOps.js.map +1 -1
- package/lib/cjs/curve/CurvePrimitive.js.map +1 -1
- package/lib/cjs/curve/CurveProcessor.js.map +1 -1
- package/lib/cjs/curve/CurveTypes.js.map +1 -1
- package/lib/cjs/curve/CurveWireMomentsXYZ.js.map +1 -1
- package/lib/cjs/curve/GeometryQuery.js.map +1 -1
- package/lib/cjs/curve/LineSegment3d.js.map +1 -1
- package/lib/cjs/curve/LineString3d.js.map +1 -1
- package/lib/cjs/curve/Loop.js.map +1 -1
- package/lib/cjs/curve/OffsetOptions.js.map +1 -1
- package/lib/cjs/curve/ParityRegion.js.map +1 -1
- package/lib/cjs/curve/Path.js.map +1 -1
- package/lib/cjs/curve/PointString3d.js.map +1 -1
- package/lib/cjs/curve/ProxyCurve.js.map +1 -1
- package/lib/cjs/curve/Query/ConsolidateAdjacentPrimitivesContext.js.map +1 -1
- package/lib/cjs/curve/Query/CurveSplitContext.js.map +1 -1
- package/lib/cjs/curve/Query/CylindricalRange.js.map +1 -1
- package/lib/cjs/curve/Query/InOutTests.js.map +1 -1
- package/lib/cjs/curve/Query/PlanarSubdivision.js.map +1 -1
- package/lib/cjs/curve/Query/StrokeCountChain.js.map +1 -1
- package/lib/cjs/curve/Query/StrokeCountMap.js.map +1 -1
- package/lib/cjs/curve/RegionMomentsXY.js.map +1 -1
- package/lib/cjs/curve/RegionOps.js.map +1 -1
- package/lib/cjs/curve/RegionOpsClassificationSweeps.js.map +1 -1
- package/lib/cjs/curve/StrokeOptions.js.map +1 -1
- package/lib/cjs/curve/UnionRegion.js.map +1 -1
- package/lib/cjs/curve/internalContexts/AnnounceTangentStrokeHandler.js.map +1 -1
- package/lib/cjs/curve/internalContexts/AppendPlaneIntersectionStrokeHandler.js.map +1 -1
- package/lib/cjs/curve/internalContexts/ChainCollectorContext.js.map +1 -1
- package/lib/cjs/curve/internalContexts/CloneCurvesContext.js.map +1 -1
- package/lib/cjs/curve/internalContexts/CloneWithExpandedLineStrings.js.map +1 -1
- package/lib/cjs/curve/internalContexts/ClosestPointStrokeHandler.js.map +1 -1
- package/lib/cjs/curve/internalContexts/CountLinearPartsSearchContext.js.map +1 -1
- package/lib/cjs/curve/internalContexts/CurveCurveCloseApproachXY.js.map +1 -1
- package/lib/cjs/curve/internalContexts/CurveCurveIntersectXY.js.map +1 -1
- package/lib/cjs/curve/internalContexts/CurveCurveIntersectXYZ.js.map +1 -1
- package/lib/cjs/curve/internalContexts/CurveLengthContext.js.map +1 -1
- package/lib/cjs/curve/internalContexts/CurveOffsetXYHandler.js.map +1 -1
- package/lib/cjs/curve/internalContexts/EllipticalArcApproximationContext.js.map +1 -1
- package/lib/cjs/curve/internalContexts/GapSearchContext.js.map +1 -1
- package/lib/cjs/curve/internalContexts/MultiChainCollector.js.map +1 -1
- package/lib/cjs/curve/internalContexts/NewtonRtoRStrokeHandler.js.map +1 -1
- package/lib/cjs/curve/internalContexts/PlaneAltitudeRangeContext.js.map +1 -1
- package/lib/cjs/curve/internalContexts/PolygonOffsetContext.js.map +1 -1
- package/lib/cjs/curve/internalContexts/SumLengthsContext.js.map +1 -1
- package/lib/cjs/curve/internalContexts/TransferWithSplitArcs.js.map +1 -1
- package/lib/cjs/curve/internalContexts/TransformInPlaceContext.js.map +1 -1
- package/lib/cjs/curve/spiral/AustralianRailCorpXYEvaluator.js.map +1 -1
- package/lib/cjs/curve/spiral/ClothoidSeries.js.map +1 -1
- package/lib/cjs/curve/spiral/CubicEvaluator.js.map +1 -1
- package/lib/cjs/curve/spiral/CzechSpiralEvaluator.js.map +1 -1
- package/lib/cjs/curve/spiral/DirectHalfCosineSpiralEvaluator.js.map +1 -1
- package/lib/cjs/curve/spiral/DirectSpiral3d.js.map +1 -1
- package/lib/cjs/curve/spiral/IntegratedSpiral3d.js.map +1 -1
- package/lib/cjs/curve/spiral/MXCubicAlongArcSpiralEvaluator.js.map +1 -1
- package/lib/cjs/curve/spiral/NormalizedTransition.js.map +1 -1
- package/lib/cjs/curve/spiral/PolishCubicSpiralEvaluator.js.map +1 -1
- package/lib/cjs/curve/spiral/TransitionConditionalProperties.js.map +1 -1
- package/lib/cjs/curve/spiral/TransitionSpiral3d.js.map +1 -1
- package/lib/cjs/curve/spiral/XYCurveEvaluator.js.map +1 -1
- package/lib/cjs/geometry3d/Angle.js.map +1 -1
- package/lib/cjs/geometry3d/AngleSweep.js.map +1 -1
- package/lib/cjs/geometry3d/BarycentricTriangle.js.map +1 -1
- package/lib/cjs/geometry3d/BilinearPatch.js.map +1 -1
- package/lib/cjs/geometry3d/CoincidentGeometryOps.js.map +1 -1
- package/lib/cjs/geometry3d/Ellipsoid.js.map +1 -1
- package/lib/cjs/geometry3d/FrameBuilder.js.map +1 -1
- package/lib/cjs/geometry3d/FrustumAnimation.js.map +1 -1
- package/lib/cjs/geometry3d/GeometryHandler.js.map +1 -1
- package/lib/cjs/geometry3d/GrowableBlockedArray.js.map +1 -1
- package/lib/cjs/geometry3d/GrowableFloat64Array.js.map +1 -1
- package/lib/cjs/geometry3d/GrowableXYArray.js.map +1 -1
- package/lib/cjs/geometry3d/GrowableXYZArray.js.map +1 -1
- package/lib/cjs/geometry3d/IndexedCollectionInterval.js.map +1 -1
- package/lib/cjs/geometry3d/IndexedXYCollection.js.map +1 -1
- package/lib/cjs/geometry3d/IndexedXYZCollection.js.map +1 -1
- package/lib/cjs/geometry3d/LongitudeLatitudeAltitude.js.map +1 -1
- package/lib/cjs/geometry3d/Matrix3d.js.map +1 -1
- package/lib/cjs/geometry3d/OrderedRotationAngles.js.map +1 -1
- package/lib/cjs/geometry3d/Plane3d.js.map +1 -1
- package/lib/cjs/geometry3d/Plane3dByOriginAndUnitNormal.js.map +1 -1
- package/lib/cjs/geometry3d/Plane3dByOriginAndVectors.js.map +1 -1
- package/lib/cjs/geometry3d/Point2dArrayCarrier.js.map +1 -1
- package/lib/cjs/geometry3d/Point2dVector2d.js.map +1 -1
- package/lib/cjs/geometry3d/Point3dArrayCarrier.js.map +1 -1
- package/lib/cjs/geometry3d/Point3dVector3d.js.map +1 -1
- package/lib/cjs/geometry3d/PointHelpers.js.map +1 -1
- package/lib/cjs/geometry3d/PointStreaming.js.map +1 -1
- package/lib/cjs/geometry3d/PolygonOps.js.map +1 -1
- package/lib/cjs/geometry3d/PolylineCompressionByEdgeOffset.js.map +1 -1
- package/lib/cjs/geometry3d/PolylineOps.js.map +1 -1
- package/lib/cjs/geometry3d/Range.js.map +1 -1
- package/lib/cjs/geometry3d/Ray2d.js.map +1 -1
- package/lib/cjs/geometry3d/Ray3d.js.map +1 -1
- package/lib/cjs/geometry3d/ReusableObjectCache.js.map +1 -1
- package/lib/cjs/geometry3d/Segment1d.js.map +1 -1
- package/lib/cjs/geometry3d/SortablePolygon.js.map +1 -1
- package/lib/cjs/geometry3d/Transform.js.map +1 -1
- package/lib/cjs/geometry3d/UVSurfaceOps.js.map +1 -1
- package/lib/cjs/geometry3d/XYZProps.js.map +1 -1
- package/lib/cjs/geometry3d/YawPitchRollAngles.js.map +1 -1
- package/lib/cjs/geometry4d/Map4d.js.map +1 -1
- package/lib/cjs/geometry4d/Matrix4d.js.map +1 -1
- package/lib/cjs/geometry4d/MomentData.js.map +1 -1
- package/lib/cjs/geometry4d/PlaneByOriginAndVectors4d.js.map +1 -1
- package/lib/cjs/geometry4d/Point4d.js.map +1 -1
- package/lib/cjs/numerics/BandedSystem.js.map +1 -1
- package/lib/cjs/numerics/BezierPolynomials.js.map +1 -1
- package/lib/cjs/numerics/ClusterableArray.js.map +1 -1
- package/lib/cjs/numerics/Complex.js.map +1 -1
- package/lib/cjs/numerics/ConvexPolygon2d.js.map +1 -1
- package/lib/cjs/numerics/Newton.js.map +1 -1
- package/lib/cjs/numerics/PascalCoefficients.js.map +1 -1
- package/lib/cjs/numerics/PolarData.js.map +1 -1
- package/lib/cjs/numerics/Polynomials.js.map +1 -1
- package/lib/cjs/numerics/Quadrature.js.map +1 -1
- package/lib/cjs/numerics/Range1dArray.js.map +1 -1
- package/lib/cjs/numerics/SmallSystem.js.map +1 -1
- package/lib/cjs/numerics/TriDiagonalSystem.js.map +1 -1
- package/lib/cjs/numerics/UnionFind.js.map +1 -1
- package/lib/cjs/numerics/UsageSums.js.map +1 -1
- package/lib/cjs/polyface/AuxData.js.map +1 -1
- package/lib/cjs/polyface/BoxTopology.js.map +1 -1
- package/lib/cjs/polyface/FacetFaceData.js.map +1 -1
- package/lib/cjs/polyface/FacetLocationDetail.js.map +1 -1
- package/lib/cjs/polyface/FacetOrientation.js.map +1 -1
- package/lib/cjs/polyface/GreedyTriangulationBetweenLineStrings.js.map +1 -1
- package/lib/cjs/polyface/IndexedEdgeMatcher.js.map +1 -1
- package/lib/cjs/polyface/IndexedPolyfaceVisitor.js.map +1 -1
- package/lib/cjs/polyface/IndexedPolyfaceWalker.js.map +1 -1
- package/lib/cjs/polyface/Polyface.js.map +1 -1
- package/lib/cjs/polyface/PolyfaceBuilder.js.map +1 -1
- package/lib/cjs/polyface/PolyfaceClip.js.map +1 -1
- package/lib/cjs/polyface/PolyfaceData.js.map +1 -1
- package/lib/cjs/polyface/PolyfaceQuery.js.map +1 -1
- package/lib/cjs/polyface/RangeLengthData.js.map +1 -1
- package/lib/cjs/polyface/RangeTree/LineString3dRangeTreeContext.js.map +1 -1
- package/lib/cjs/polyface/RangeTree/MinimumValueTester.js.map +1 -1
- package/lib/cjs/polyface/RangeTree/Point3dArrayRangeTreeContext.js.map +1 -1
- package/lib/cjs/polyface/RangeTree/PolyfaceRangeTreeContext.js.map +1 -1
- package/lib/cjs/polyface/RangeTree/RangeTreeNode.js.map +1 -1
- package/lib/cjs/polyface/RangeTree/RangeTreeSearchHandlers.js.map +1 -1
- package/lib/cjs/polyface/TaggedNumericData.js.map +1 -1
- package/lib/cjs/polyface/TriangleCandidate.js.map +1 -1
- package/lib/cjs/polyface/multiclip/BuildAverageNormalsContext.js.map +1 -1
- package/lib/cjs/polyface/multiclip/GriddedRaggedRange2dSet.js.map +1 -1
- package/lib/cjs/polyface/multiclip/GriddedRaggedRange2dSetWithOverflow.js.map +1 -1
- package/lib/cjs/polyface/multiclip/LinearSearchRange2dArray.js.map +1 -1
- package/lib/cjs/polyface/multiclip/OffsetMeshContext.js.map +1 -1
- package/lib/cjs/polyface/multiclip/Range2dSearchInterface.js.map +1 -1
- package/lib/cjs/polyface/multiclip/RangeSearch.js.map +1 -1
- package/lib/cjs/polyface/multiclip/SweepLineStringToFacetContext.js.map +1 -1
- package/lib/cjs/polyface/multiclip/XYPointBuckets.js.map +1 -1
- package/lib/cjs/serialization/BGFBAccessors.js.map +1 -1
- package/lib/cjs/serialization/BGFBReader.js.map +1 -1
- package/lib/cjs/serialization/BGFBWriter.js.map +1 -1
- package/lib/cjs/serialization/BentleyGeometryFlatBuffer.js.map +1 -1
- package/lib/cjs/serialization/DeepCompare.js.map +1 -1
- package/lib/cjs/serialization/GeometrySamples.js.map +1 -1
- package/lib/cjs/serialization/IModelJsonSchema.js.map +1 -1
- package/lib/cjs/serialization/SerializationHelpers.js.map +1 -1
- package/lib/cjs/solid/Box.js.map +1 -1
- package/lib/cjs/solid/Cone.js.map +1 -1
- package/lib/cjs/solid/LinearSweep.js.map +1 -1
- package/lib/cjs/solid/RotationalSweep.js.map +1 -1
- package/lib/cjs/solid/RuledSweep.js.map +1 -1
- package/lib/cjs/solid/SolidPrimitive.js.map +1 -1
- package/lib/cjs/solid/Sphere.js.map +1 -1
- package/lib/cjs/solid/SweepContour.js.map +1 -1
- package/lib/cjs/solid/TorusPipe.js.map +1 -1
- package/lib/cjs/topology/ChainMerge.js.map +1 -1
- package/lib/cjs/topology/Graph.js.map +1 -1
- package/lib/cjs/topology/HalfEdgeGraphFromIndexedLoopsContext.js.map +1 -1
- package/lib/cjs/topology/HalfEdgeGraphSearch.js.map +1 -1
- package/lib/cjs/topology/HalfEdgeGraphSpineContext.js.map +1 -1
- package/lib/cjs/topology/HalfEdgeGraphValidation.js.map +1 -1
- package/lib/cjs/topology/HalfEdgeMarkSet.js.map +1 -1
- package/lib/cjs/topology/HalfEdgeNodeXYZUV.js.map +1 -1
- package/lib/cjs/topology/HalfEdgePointInGraphSearch.js.map +1 -1
- package/lib/cjs/topology/HalfEdgePositionDetail.js.map +1 -1
- package/lib/cjs/topology/HalfEdgePriorityQueue.js.map +1 -1
- package/lib/cjs/topology/InsertAndRetriangulateContext.js.map +1 -1
- package/lib/cjs/topology/MaskManager.js.map +1 -1
- package/lib/cjs/topology/Merging.js.map +1 -1
- package/lib/cjs/topology/RegularizeFace.js.map +1 -1
- package/lib/cjs/topology/SignedDataSummary.js.map +1 -1
- package/lib/cjs/topology/SpaceTriangulation.js.map +1 -1
- package/lib/cjs/topology/Triangulation.js.map +1 -1
- package/lib/cjs/topology/Voronoi.js.map +1 -1
- package/lib/cjs/topology/XYParitySearchContext.js.map +1 -1
- package/lib/esm/Constant.js.map +1 -1
- package/lib/esm/Geometry.js.map +1 -1
- package/lib/esm/bspline/AkimaCurve3d.js.map +1 -1
- package/lib/esm/bspline/BSpline1dNd.js.map +1 -1
- package/lib/esm/bspline/BSplineCurve.js.map +1 -1
- package/lib/esm/bspline/BSplineCurve3dH.js.map +1 -1
- package/lib/esm/bspline/BSplineCurveOps.js.map +1 -1
- package/lib/esm/bspline/BSplineSurface.js.map +1 -1
- package/lib/esm/bspline/Bezier1dNd.js.map +1 -1
- package/lib/esm/bspline/BezierCurve3d.js.map +1 -1
- package/lib/esm/bspline/BezierCurve3dH.js.map +1 -1
- package/lib/esm/bspline/BezierCurveBase.js.map +1 -1
- package/lib/esm/bspline/InterpolationCurve3d.js.map +1 -1
- package/lib/esm/bspline/KnotVector.js.map +1 -1
- package/lib/esm/bspline/SurfaceLocationDetail.js.map +1 -1
- package/lib/esm/clipping/AlternatingConvexClipTree.js.map +1 -1
- package/lib/esm/clipping/BooleanClipFactory.js.map +1 -1
- package/lib/esm/clipping/BooleanClipNode.js.map +1 -1
- package/lib/esm/clipping/ClipPlane.js.map +1 -1
- package/lib/esm/clipping/ClipPrimitive.js.map +1 -1
- package/lib/esm/clipping/ClipUtils.js.map +1 -1
- package/lib/esm/clipping/ClipVector.js.map +1 -1
- package/lib/esm/clipping/ConvexClipPlaneSet.js.map +1 -1
- package/lib/esm/clipping/UnionOfConvexClipPlaneSets.js.map +1 -1
- package/lib/esm/clipping/internalContexts/LineStringOffsetClipperContext.js.map +1 -1
- package/lib/esm/core-geometry.js.map +1 -1
- package/lib/esm/curve/Arc3d.js.map +1 -1
- package/lib/esm/curve/ConstructCurveBetweenCurves.js.map +1 -1
- package/lib/esm/curve/CoordinateXYZ.js.map +1 -1
- package/lib/esm/curve/CurveChainWithDistanceIndex.js.map +1 -1
- package/lib/esm/curve/CurveCollection.js.map +1 -1
- package/lib/esm/curve/CurveCurve.js.map +1 -1
- package/lib/esm/curve/CurveExtendMode.js.map +1 -1
- package/lib/esm/curve/CurveFactory.js.map +1 -1
- package/lib/esm/curve/CurveLocationDetail.js.map +1 -1
- package/lib/esm/curve/CurveOps.js.map +1 -1
- package/lib/esm/curve/CurvePrimitive.js.map +1 -1
- package/lib/esm/curve/CurveProcessor.js.map +1 -1
- package/lib/esm/curve/CurveTypes.js.map +1 -1
- package/lib/esm/curve/CurveWireMomentsXYZ.js.map +1 -1
- package/lib/esm/curve/GeometryQuery.js.map +1 -1
- package/lib/esm/curve/LineSegment3d.js.map +1 -1
- package/lib/esm/curve/LineString3d.js.map +1 -1
- package/lib/esm/curve/Loop.js.map +1 -1
- package/lib/esm/curve/OffsetOptions.js.map +1 -1
- package/lib/esm/curve/ParityRegion.js.map +1 -1
- package/lib/esm/curve/Path.js.map +1 -1
- package/lib/esm/curve/PointString3d.js.map +1 -1
- package/lib/esm/curve/ProxyCurve.js.map +1 -1
- package/lib/esm/curve/Query/ConsolidateAdjacentPrimitivesContext.js.map +1 -1
- package/lib/esm/curve/Query/CurveSplitContext.js.map +1 -1
- package/lib/esm/curve/Query/CylindricalRange.js.map +1 -1
- package/lib/esm/curve/Query/InOutTests.js.map +1 -1
- package/lib/esm/curve/Query/PlanarSubdivision.js.map +1 -1
- package/lib/esm/curve/Query/StrokeCountChain.js.map +1 -1
- package/lib/esm/curve/Query/StrokeCountMap.js.map +1 -1
- package/lib/esm/curve/RegionMomentsXY.js.map +1 -1
- package/lib/esm/curve/RegionOps.js.map +1 -1
- package/lib/esm/curve/RegionOpsClassificationSweeps.js.map +1 -1
- package/lib/esm/curve/StrokeOptions.js.map +1 -1
- package/lib/esm/curve/UnionRegion.js.map +1 -1
- package/lib/esm/curve/internalContexts/AnnounceTangentStrokeHandler.js.map +1 -1
- package/lib/esm/curve/internalContexts/AppendPlaneIntersectionStrokeHandler.js.map +1 -1
- package/lib/esm/curve/internalContexts/ChainCollectorContext.js.map +1 -1
- package/lib/esm/curve/internalContexts/CloneCurvesContext.js.map +1 -1
- package/lib/esm/curve/internalContexts/CloneWithExpandedLineStrings.js.map +1 -1
- package/lib/esm/curve/internalContexts/ClosestPointStrokeHandler.js.map +1 -1
- package/lib/esm/curve/internalContexts/CountLinearPartsSearchContext.js.map +1 -1
- package/lib/esm/curve/internalContexts/CurveCurveCloseApproachXY.js.map +1 -1
- package/lib/esm/curve/internalContexts/CurveCurveIntersectXY.js.map +1 -1
- package/lib/esm/curve/internalContexts/CurveCurveIntersectXYZ.js.map +1 -1
- package/lib/esm/curve/internalContexts/CurveLengthContext.js.map +1 -1
- package/lib/esm/curve/internalContexts/CurveOffsetXYHandler.js.map +1 -1
- package/lib/esm/curve/internalContexts/EllipticalArcApproximationContext.js.map +1 -1
- package/lib/esm/curve/internalContexts/GapSearchContext.js.map +1 -1
- package/lib/esm/curve/internalContexts/MultiChainCollector.js.map +1 -1
- package/lib/esm/curve/internalContexts/NewtonRtoRStrokeHandler.js.map +1 -1
- package/lib/esm/curve/internalContexts/PlaneAltitudeRangeContext.js.map +1 -1
- package/lib/esm/curve/internalContexts/PolygonOffsetContext.js.map +1 -1
- package/lib/esm/curve/internalContexts/SumLengthsContext.js.map +1 -1
- package/lib/esm/curve/internalContexts/TransferWithSplitArcs.js.map +1 -1
- package/lib/esm/curve/internalContexts/TransformInPlaceContext.js.map +1 -1
- package/lib/esm/curve/spiral/AustralianRailCorpXYEvaluator.js.map +1 -1
- package/lib/esm/curve/spiral/ClothoidSeries.js.map +1 -1
- package/lib/esm/curve/spiral/CubicEvaluator.js.map +1 -1
- package/lib/esm/curve/spiral/CzechSpiralEvaluator.js.map +1 -1
- package/lib/esm/curve/spiral/DirectHalfCosineSpiralEvaluator.js.map +1 -1
- package/lib/esm/curve/spiral/DirectSpiral3d.js.map +1 -1
- package/lib/esm/curve/spiral/IntegratedSpiral3d.js.map +1 -1
- package/lib/esm/curve/spiral/MXCubicAlongArcSpiralEvaluator.js.map +1 -1
- package/lib/esm/curve/spiral/NormalizedTransition.js.map +1 -1
- package/lib/esm/curve/spiral/PolishCubicSpiralEvaluator.js.map +1 -1
- package/lib/esm/curve/spiral/TransitionConditionalProperties.js.map +1 -1
- package/lib/esm/curve/spiral/TransitionSpiral3d.js.map +1 -1
- package/lib/esm/curve/spiral/XYCurveEvaluator.js.map +1 -1
- package/lib/esm/geometry3d/Angle.js.map +1 -1
- package/lib/esm/geometry3d/AngleSweep.js.map +1 -1
- package/lib/esm/geometry3d/BarycentricTriangle.js.map +1 -1
- package/lib/esm/geometry3d/BilinearPatch.js.map +1 -1
- package/lib/esm/geometry3d/CoincidentGeometryOps.js.map +1 -1
- package/lib/esm/geometry3d/Ellipsoid.js.map +1 -1
- package/lib/esm/geometry3d/FrameBuilder.js.map +1 -1
- package/lib/esm/geometry3d/FrustumAnimation.js.map +1 -1
- package/lib/esm/geometry3d/GeometryHandler.js.map +1 -1
- package/lib/esm/geometry3d/GrowableBlockedArray.js.map +1 -1
- package/lib/esm/geometry3d/GrowableFloat64Array.js.map +1 -1
- package/lib/esm/geometry3d/GrowableXYArray.js.map +1 -1
- package/lib/esm/geometry3d/GrowableXYZArray.js.map +1 -1
- package/lib/esm/geometry3d/IndexedCollectionInterval.js.map +1 -1
- package/lib/esm/geometry3d/IndexedXYCollection.js.map +1 -1
- package/lib/esm/geometry3d/IndexedXYZCollection.js.map +1 -1
- package/lib/esm/geometry3d/LongitudeLatitudeAltitude.js.map +1 -1
- package/lib/esm/geometry3d/Matrix3d.js.map +1 -1
- package/lib/esm/geometry3d/OrderedRotationAngles.js.map +1 -1
- package/lib/esm/geometry3d/Plane3d.js.map +1 -1
- package/lib/esm/geometry3d/Plane3dByOriginAndUnitNormal.js.map +1 -1
- package/lib/esm/geometry3d/Plane3dByOriginAndVectors.js.map +1 -1
- package/lib/esm/geometry3d/Point2dArrayCarrier.js.map +1 -1
- package/lib/esm/geometry3d/Point2dVector2d.js.map +1 -1
- package/lib/esm/geometry3d/Point3dArrayCarrier.js.map +1 -1
- package/lib/esm/geometry3d/Point3dVector3d.js.map +1 -1
- package/lib/esm/geometry3d/PointHelpers.js.map +1 -1
- package/lib/esm/geometry3d/PointStreaming.js.map +1 -1
- package/lib/esm/geometry3d/PolygonOps.js.map +1 -1
- package/lib/esm/geometry3d/PolylineCompressionByEdgeOffset.js.map +1 -1
- package/lib/esm/geometry3d/PolylineOps.js.map +1 -1
- package/lib/esm/geometry3d/Range.js.map +1 -1
- package/lib/esm/geometry3d/Ray2d.js.map +1 -1
- package/lib/esm/geometry3d/Ray3d.js.map +1 -1
- package/lib/esm/geometry3d/ReusableObjectCache.js.map +1 -1
- package/lib/esm/geometry3d/Segment1d.js.map +1 -1
- package/lib/esm/geometry3d/SortablePolygon.js.map +1 -1
- package/lib/esm/geometry3d/Transform.js.map +1 -1
- package/lib/esm/geometry3d/UVSurfaceOps.js.map +1 -1
- package/lib/esm/geometry3d/XYZProps.js.map +1 -1
- package/lib/esm/geometry3d/YawPitchRollAngles.js.map +1 -1
- package/lib/esm/geometry4d/Map4d.js.map +1 -1
- package/lib/esm/geometry4d/Matrix4d.js.map +1 -1
- package/lib/esm/geometry4d/MomentData.js.map +1 -1
- package/lib/esm/geometry4d/PlaneByOriginAndVectors4d.js.map +1 -1
- package/lib/esm/geometry4d/Point4d.js.map +1 -1
- package/lib/esm/numerics/BandedSystem.js.map +1 -1
- package/lib/esm/numerics/BezierPolynomials.js.map +1 -1
- package/lib/esm/numerics/ClusterableArray.js.map +1 -1
- package/lib/esm/numerics/Complex.js.map +1 -1
- package/lib/esm/numerics/ConvexPolygon2d.js.map +1 -1
- package/lib/esm/numerics/Newton.js.map +1 -1
- package/lib/esm/numerics/PascalCoefficients.js.map +1 -1
- package/lib/esm/numerics/PolarData.js.map +1 -1
- package/lib/esm/numerics/Polynomials.js.map +1 -1
- package/lib/esm/numerics/Quadrature.js.map +1 -1
- package/lib/esm/numerics/Range1dArray.js.map +1 -1
- package/lib/esm/numerics/SmallSystem.js.map +1 -1
- package/lib/esm/numerics/TriDiagonalSystem.js.map +1 -1
- package/lib/esm/numerics/UnionFind.js.map +1 -1
- package/lib/esm/numerics/UsageSums.js.map +1 -1
- package/lib/esm/polyface/AuxData.js.map +1 -1
- package/lib/esm/polyface/BoxTopology.js.map +1 -1
- package/lib/esm/polyface/FacetFaceData.js.map +1 -1
- package/lib/esm/polyface/FacetLocationDetail.js.map +1 -1
- package/lib/esm/polyface/FacetOrientation.js.map +1 -1
- package/lib/esm/polyface/GreedyTriangulationBetweenLineStrings.js.map +1 -1
- package/lib/esm/polyface/IndexedEdgeMatcher.js.map +1 -1
- package/lib/esm/polyface/IndexedPolyfaceVisitor.js.map +1 -1
- package/lib/esm/polyface/IndexedPolyfaceWalker.js.map +1 -1
- package/lib/esm/polyface/Polyface.js.map +1 -1
- package/lib/esm/polyface/PolyfaceBuilder.js.map +1 -1
- package/lib/esm/polyface/PolyfaceClip.js.map +1 -1
- package/lib/esm/polyface/PolyfaceData.js.map +1 -1
- package/lib/esm/polyface/PolyfaceQuery.js.map +1 -1
- package/lib/esm/polyface/RangeLengthData.js.map +1 -1
- package/lib/esm/polyface/RangeTree/LineString3dRangeTreeContext.js.map +1 -1
- package/lib/esm/polyface/RangeTree/MinimumValueTester.js.map +1 -1
- package/lib/esm/polyface/RangeTree/Point3dArrayRangeTreeContext.js.map +1 -1
- package/lib/esm/polyface/RangeTree/PolyfaceRangeTreeContext.js.map +1 -1
- package/lib/esm/polyface/RangeTree/RangeTreeNode.js.map +1 -1
- package/lib/esm/polyface/RangeTree/RangeTreeSearchHandlers.js.map +1 -1
- package/lib/esm/polyface/TaggedNumericData.js.map +1 -1
- package/lib/esm/polyface/TriangleCandidate.js.map +1 -1
- package/lib/esm/polyface/multiclip/BuildAverageNormalsContext.js.map +1 -1
- package/lib/esm/polyface/multiclip/GriddedRaggedRange2dSet.js.map +1 -1
- package/lib/esm/polyface/multiclip/GriddedRaggedRange2dSetWithOverflow.js.map +1 -1
- package/lib/esm/polyface/multiclip/LinearSearchRange2dArray.js.map +1 -1
- package/lib/esm/polyface/multiclip/OffsetMeshContext.js.map +1 -1
- package/lib/esm/polyface/multiclip/Range2dSearchInterface.js.map +1 -1
- package/lib/esm/polyface/multiclip/RangeSearch.js.map +1 -1
- package/lib/esm/polyface/multiclip/SweepLineStringToFacetContext.js.map +1 -1
- package/lib/esm/polyface/multiclip/XYPointBuckets.js.map +1 -1
- package/lib/esm/serialization/BGFBAccessors.js.map +1 -1
- package/lib/esm/serialization/BGFBReader.js.map +1 -1
- package/lib/esm/serialization/BGFBWriter.js.map +1 -1
- package/lib/esm/serialization/BentleyGeometryFlatBuffer.js.map +1 -1
- package/lib/esm/serialization/DeepCompare.js.map +1 -1
- package/lib/esm/serialization/GeometrySamples.js.map +1 -1
- package/lib/esm/serialization/IModelJsonSchema.js.map +1 -1
- package/lib/esm/serialization/SerializationHelpers.js.map +1 -1
- package/lib/esm/solid/Box.js.map +1 -1
- package/lib/esm/solid/Cone.js.map +1 -1
- package/lib/esm/solid/LinearSweep.js.map +1 -1
- package/lib/esm/solid/RotationalSweep.js.map +1 -1
- package/lib/esm/solid/RuledSweep.js.map +1 -1
- package/lib/esm/solid/SolidPrimitive.js.map +1 -1
- package/lib/esm/solid/Sphere.js.map +1 -1
- package/lib/esm/solid/SweepContour.js.map +1 -1
- package/lib/esm/solid/TorusPipe.js.map +1 -1
- package/lib/esm/topology/ChainMerge.js.map +1 -1
- package/lib/esm/topology/Graph.js.map +1 -1
- package/lib/esm/topology/HalfEdgeGraphFromIndexedLoopsContext.js.map +1 -1
- package/lib/esm/topology/HalfEdgeGraphSearch.js.map +1 -1
- package/lib/esm/topology/HalfEdgeGraphSpineContext.js.map +1 -1
- package/lib/esm/topology/HalfEdgeGraphValidation.js.map +1 -1
- package/lib/esm/topology/HalfEdgeMarkSet.js.map +1 -1
- package/lib/esm/topology/HalfEdgeNodeXYZUV.js.map +1 -1
- package/lib/esm/topology/HalfEdgePointInGraphSearch.js.map +1 -1
- package/lib/esm/topology/HalfEdgePositionDetail.js.map +1 -1
- package/lib/esm/topology/HalfEdgePriorityQueue.js.map +1 -1
- package/lib/esm/topology/InsertAndRetriangulateContext.js.map +1 -1
- package/lib/esm/topology/MaskManager.js.map +1 -1
- package/lib/esm/topology/Merging.js.map +1 -1
- package/lib/esm/topology/RegularizeFace.js.map +1 -1
- package/lib/esm/topology/SignedDataSummary.js.map +1 -1
- package/lib/esm/topology/SpaceTriangulation.js.map +1 -1
- package/lib/esm/topology/Triangulation.js.map +1 -1
- package/lib/esm/topology/Voronoi.js.map +1 -1
- package/lib/esm/topology/XYParitySearchContext.js.map +1 -1
- package/package.json +3 -3
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Range.js","sourceRoot":"","sources":["../../../src/geometry3d/Range.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAE/F;;GAEG;AAEH,OAAO,EAAE,SAAS,EAAm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C,CAAC,CAAC,CAAC;YACjE,IAAI,CAAC,GAAG,CAAC,CAAC,GAAG,QAAQ,CAAC,WAAW,CAAC,IAAI,EAAE,WAAW,EAAE,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;QACnE,CAAC;IACH,CAAC;IACD;;;;;;OAMG;IACI,aAAa,CAAC,KAAa;QAChC,IAAI,CAAC,SAAS,CACZ,IAAI,CAAC,GAAG,CAAC,CAAC,GAAG,KAAK,EAAE,IAAI,CAAC,GAAG,CAAC,CAAC,GAAG,KAAK,EACtC,IAAI,CAAC,IAAI,CAAC,CAAC,GAAG,KAAK,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC,GAAG,KAAK,EACxC,IAAI,CACL,CAAC;IACJ,CAAC;IACD;;;;OAIG;IACI,YAAY,CAAC,KAAY,EAAE,MAAgB;QAChD,MAAM,EAAE,GAAG,SAAS,CAAC,cAAc,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;QAC7D,MAAM,EAAE,GAAG,SAAS,CAAC,cAAc,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;QAC7D,IAAI,EAAE,KAAK,GAAG,IAAI,EAAE,KAAK,GAAG;YAC1B,OAAO,SAAS,CAAC;QACnB,OAAO,OAAO,CAAC,MAAM,CAAC,CAAC,KAAK,CAAC,CAAC,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,KAAK,CAAC,CAAC,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,EAAE,EAAE,MAAM,CAAC,CAAC;IAC1F,CAAC;CACF","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n\r\n/** @packageDocumentation\r\n * @module CartesianGeometry\r\n */\r\n\r\nimport { AxisIndex, BeJSONFunctions, Geometry } from \"../Geometry\";\r\nimport { MultiLineStringDataVariant } from \"../geometry3d/IndexedXYZCollection\";\r\nimport { GrowableXYZArray } from \"./GrowableXYZArray\";\r\nimport { Matrix3d } from \"./Matrix3d\";\r\nimport { Point2d, Vector2d } from \"./Point2dVector2d\";\r\nimport { Point3d, Vector3d } from \"./Point3dVector3d\";\r\nimport { PointStreamRangeCollector, VariantPointDataStream } from \"./PointStreaming\";\r\nimport { Transform } from \"./Transform\";\r\nimport { LowAndHighXY, LowAndHighXYZ, Range1dProps, Range2dProps, Range3dProps, XAndY, XYAndZ } from \"./XYZProps\";\r\n\r\n// allow _EXTREME_POSITIVE and _EXTREME_NEGATIVE\r\n/* eslint-disable @typescript-eslint/naming-convention */\r\n/**\r\n * Base class for Range1d, Range2d, Range3d.\r\n * @public\r\n */\r\nexport abstract class RangeBase {\r\n /** Number considered impossibly large possibly for a coordinate in a range. */\r\n protected static readonly _EXTREME_POSITIVE: number = 1.0e200;\r\n /** Number considered to be impossibly negative for a coordinate in a range. */\r\n protected static readonly _EXTREME_NEGATIVE: number = -1.0e200;\r\n /** Return 0 if high<= low, otherwise `1/(high-low)` for use in fractionalizing */\r\n protected static npcScaleFactor(low: number, high: number): number {\r\n return (high <= low) ? 0.0 : 1.0 / (high - low);\r\n }\r\n /** Return true if x is outside the range `[_EXTREME_NEGATIVE, _EXTREME_POSITIVE]' */\r\n public static isExtremeValue(x: number): boolean {\r\n return Math.abs(x) >= RangeBase._EXTREME_POSITIVE;\r\n }\r\n /** Return true if any x or y or z is outside the range `[_EXTREME_NEGATIVE, _EXTREME_POSITIVE]' */\r\n public static isExtremePoint3d(xyz: XYAndZ) {\r\n return RangeBase.isExtremeValue(xyz.x) || RangeBase.isExtremeValue(xyz.y) || RangeBase.isExtremeValue(xyz.z);\r\n }\r\n /** Return true if either of x,y is outside the range `[_EXTREME_NEGATIVE, _EXTREME_POSITIVE]' */\r\n public static isExtremePoint2d(xy: XAndY) {\r\n return RangeBase.isExtremeValue(xy.x) || RangeBase.isExtremeValue(xy.y);\r\n }\r\n /**\r\n * Return the min absolute distance from any point of `[lowA,highA]' to any point of `[lowB,highB]'.\r\n * * Both low,high pairs have order expectations: The condition `high < low` means null interval.\r\n * * If there is interval overlap, the distance is zero.\r\n * @param lowA low of interval A\r\n * @param highA high of interval A\r\n * @param lowB low of interval B\r\n * @param highB high of interval B\r\n */\r\n public static rangeToRangeAbsoluteDistance(lowA: number, highA: number, lowB: number, highB: number): number {\r\n if (highA < lowA)\r\n return RangeBase._EXTREME_POSITIVE;\r\n if (highB < lowB)\r\n return RangeBase._EXTREME_POSITIVE;\r\n if (highB < lowA)\r\n return lowA - highB;\r\n if (highB <= highA)\r\n return 0.0;\r\n if (lowB <= highA)\r\n return 0.0;\r\n return lowB - highA;\r\n }\r\n /**\r\n * Given a coordinate and pair of range limits, return the smallest distance to the range.\r\n * * This is zero for any point inside the range\r\n * * This is _EXTREME_POSITIVE if the range limits are inverted\r\n * * Otherwise (i.e. x is outside a finite range) the distance to the near endpoint.\r\n */\r\n public static coordinateToRangeAbsoluteDistance(x: number, low: number, high: number): number {\r\n if (high < low)\r\n return RangeBase._EXTREME_POSITIVE;\r\n if (x < low)\r\n return low - x;\r\n if (x > high)\r\n return x - high;\r\n return 0.0;\r\n }\r\n /**\r\n * If a > 0, return (extrapolationFactor * a); otherwise return defaultValue\r\n * @param q\r\n * @param factor multiplier for positive q values.\r\n */\r\n public static multiplyIfPositive(q: number, factor: number, defaultValue: number = 0.0): number {\r\n return q > 0 ? factor * q : defaultValue;\r\n }\r\n}\r\n\r\n/**\r\n * Axis aligned range in 3D.\r\n * * member `low` contains minimum coordinate of range box\r\n * * member `high` contains maximum coordinate of range box\r\n * * The range is considered null (empty) if any low member is larger than its high counterpart.\r\n * @public\r\n */\r\nexport class Range3d extends RangeBase implements LowAndHighXYZ, BeJSONFunctions {\r\n // low and high are always non-null objects\r\n // any direction of low.q > high.q is considered a null range.\r\n // private ctor and setXYZXYZ_direct set the low and high explicitly (without further tests of low.q.<= high.q)\r\n /** Low point coordinates */\r\n public low: Point3d;\r\n /** High point coordinates */\r\n public high: Point3d;\r\n /** Set this transform to values that indicate it has no geometric contents. */\r\n public setNull() {\r\n this.low.x = RangeBase._EXTREME_POSITIVE;\r\n this.low.y = RangeBase._EXTREME_POSITIVE;\r\n this.low.z = RangeBase._EXTREME_POSITIVE;\r\n this.high.x = RangeBase._EXTREME_NEGATIVE;\r\n this.high.y = RangeBase._EXTREME_NEGATIVE;\r\n this.high.z = RangeBase._EXTREME_NEGATIVE;\r\n }\r\n\r\n /** Freeze this instance (and its members) so it is read-only */\r\n public freeze(): Readonly<this> {\r\n this.low.freeze();\r\n this.high.freeze();\r\n return Object.freeze(this);\r\n }\r\n /** Flatten the low and high coordinates of any json object with low.x .. high.z into an array of 6 doubles */\r\n public static toFloat64Array(val: LowAndHighXYZ): Float64Array {\r\n return Float64Array.of(val.low.x, val.low.y, val.low.z, val.high.x, val.high.y, val.high.z);\r\n }\r\n /** Flatten the low and high coordinates of this into an array of 6 doubles */\r\n public toFloat64Array(): Float64Array {\r\n return Range3d.toFloat64Array(this);\r\n }\r\n /**\r\n * Construct a Range3d from an array of double-precision values\r\n * @param f64 the array, which should contain exactly 6 values in this order: lowX, lowY, lowZ, highX, highY, highZ\r\n * @return a new Range3d object\r\n */\r\n public static fromFloat64Array<T extends Range3d>(f64: Float64Array): T {\r\n if (f64.length !== 6)\r\n throw new Error(\"invalid array\");\r\n return new this(f64[0], f64[1], f64[2], f64[3], f64[4], f64[5]) as T;\r\n }\r\n /**\r\n * Construct a Range3d from an un-typed array. This mostly useful when interpreting ECSQL query results of\r\n * the 'blob' type, where you know that that result is a Range3d.\r\n * @param buffer untyped array\r\n * @return a new Range3d object\r\n */\r\n public static fromArrayBuffer<T extends Range3d>(buffer: ArrayBuffer): T {\r\n return this.fromFloat64Array(new Float64Array(buffer));\r\n }\r\n // explicit ctor - no enforcement of value relationships\r\n public constructor(\r\n lowX: number = RangeBase._EXTREME_POSITIVE, lowY: number = RangeBase._EXTREME_POSITIVE, lowZ: number = RangeBase._EXTREME_POSITIVE,\r\n highX: number = RangeBase._EXTREME_NEGATIVE, highY: number = RangeBase._EXTREME_NEGATIVE, highZ: number = RangeBase._EXTREME_NEGATIVE,\r\n ) {\r\n super();\r\n this.low = Point3d.create(lowX, lowY, lowZ);\r\n this.high = Point3d.create(highX, highY, highZ);\r\n }\r\n /** Returns true if this and other have equal low and high parts, or both are null ranges. */\r\n public isAlmostEqual(other: Readonly<Range3d>, tol?: number): boolean {\r\n return (this.low.isAlmostEqual(other.low, tol) && this.high.isAlmostEqual(other.high, tol))\r\n || (this.isNull && other.isNull);\r\n }\r\n /** Copy low and high values from other. */\r\n public setFrom(other: Range3d) {\r\n this.low.setFrom(other.low);\r\n this.high.setFrom(other.high);\r\n }\r\n /** Return a new Range3d copied from a range or derived type */\r\n public static createFrom<T extends Range3d>(other: Range3d, result?: T): T {\r\n if (result) {\r\n result.setFrom(other);\r\n return result;\r\n }\r\n return this.createXYZXYZOrCorrectToNull<T>(\r\n other.low.x, other.low.y, other.low.z,\r\n other.high.x, other.high.y, other.high.z,\r\n result,\r\n );\r\n }\r\n /**\r\n * Set this range (in place) from json such as\r\n * * key-value pairs: `{low:[1,2,3], high:[4,5,6]}`\r\n * * array of points: `[[1,2,3],[9,3,4],[-2,1,3] ...]`\r\n * * Lowest level points can be `[1,2,3]` or `{x:1,y:2,z:3}`\r\n */\r\n public setFromJSON(json?: Range3dProps) {\r\n if (!json)\r\n return;\r\n this.setNull();\r\n if (Array.isArray(json)) {\r\n const point = Point3d.create();\r\n for (const value of json) {\r\n point.setFromJSON(value);\r\n this.extendPoint(point);\r\n }\r\n return;\r\n }\r\n const low = Point3d.fromJSON(json.low);\r\n const high = Point3d.fromJSON(json.high);\r\n if (!RangeBase.isExtremePoint3d(low) && !RangeBase.isExtremePoint3d(high)) {\r\n this.extendPoint(low);\r\n this.extendPoint(high);\r\n }\r\n }\r\n /**\r\n * Return a JSON object `{low: ... , high: ...}`\r\n * with points formatted by `Point3d.toJSON()`\r\n */\r\n public toJSON(): Range3dProps {\r\n return { low: this.low.toJSON(), high: this.high.toJSON() };\r\n }\r\n /** Use `setFromJSON` to parse `json` into a new Range3d instance. */\r\n public static fromJSON<T extends Range3d>(json?: Range3dProps): T {\r\n const result = new this() as T;\r\n result.setFromJSON(json);\r\n return result;\r\n }\r\n // internal use only -- directly set all coordinates, test only if directed.\r\n private setDirect(xA: number, yA: number, zA: number, xB: number, yB: number, zB: number, correctToNull: boolean) {\r\n this.low.x = xA;\r\n this.low.y = yA;\r\n this.low.z = zA;\r\n\r\n this.high.x = xB;\r\n this.high.y = yB;\r\n this.high.z = zB;\r\n if (correctToNull) {\r\n if (\r\n this.low.x > this.high.x\r\n || this.low.y > this.high.y\r\n || this.low.z > this.high.z\r\n )\r\n this.setNull();\r\n }\r\n }\r\n /** Return a copy */\r\n public clone(result?: this): this {\r\n result = result ? result : new (this.constructor as any)() as this;\r\n result.setDirect(this.low.x, this.low.y, this.low.z, this.high.x, this.high.y, this.high.z, false);\r\n return result;\r\n }\r\n /**\r\n * Return a copy, translated by adding `shift` components in all directions.\r\n * * The translate of a null range is also a null range.\r\n */\r\n public cloneTranslated(shift: XYAndZ, result?: this): this {\r\n result = result ? result : new (this.constructor as any)() as this;\r\n if (!this.isNull)\r\n result.setDirect(\r\n this.low.x + shift.x, this.low.y + shift.y, this.low.z + shift.z,\r\n this.high.x + shift.x, this.high.y + shift.y, this.high.z + shift.z,\r\n false,\r\n );\r\n return result;\r\n }\r\n\r\n /** Return a range initialized to have no content. */\r\n public static createNull<T extends Range3d>(result?: T): T {\r\n result = result ? result : new this() as T;\r\n result.setNull();\r\n return result;\r\n }\r\n /** Extend (modify in place) so that the range is large enough to include the supplied points. */\r\n public extend(...point: XYAndZ[]) {\r\n for (const p of point)\r\n this.extendPoint(p);\r\n }\r\n /** Return a range large enough to include the supplied points. If no points are given, the range is a null range */\r\n public static create(...point: XYAndZ[]) {\r\n const result = Range3d.createNull();\r\n for (const p of point)\r\n result.extendPoint(p);\r\n return result;\r\n }\r\n /** Create a range from freely structured MultiLineStringDataVariant. */\r\n public static createFromVariantData(data: MultiLineStringDataVariant, transform?: Transform, result?: Range3d): Range3d {\r\n if (result)\r\n result.setNull();\r\n const collector = new PointStreamRangeCollector(transform, result);\r\n VariantPointDataStream.streamXYZ(data, collector);\r\n return collector.claimResult();\r\n }\r\n /** Create a Range3d enclosing the transformed points. */\r\n public static createTransformed<T extends Range3d>(transform: Transform, ...point: XYAndZ[]): T {\r\n const result = this.createNull<T>();\r\n for (const p of point)\r\n result.extendTransformedXYZ(transform, p.x, p.y, p.z);\r\n return result;\r\n }\r\n /** Create a Range3d enclosing the transformed points. */\r\n public static createTransformedArray<T extends Range3d>(\r\n transform: Transform, points: XYAndZ[] | GrowableXYZArray,\r\n ): T {\r\n const result = this.createNull<T>();\r\n result.extendArray(points, transform);\r\n return result;\r\n }\r\n /** Create a Range3d enclosing the points after inverse transform. */\r\n public static createInverseTransformedArray<T extends Range3d>(\r\n transform: Transform, points: XYAndZ[] | GrowableXYZArray,\r\n ): T {\r\n const result = this.createNull<T>();\r\n result.extendInverseTransformedArray(points, transform);\r\n return result;\r\n }\r\n /** Set the range to be a single point supplied as x,y,z values */\r\n public setXYZ(x: number, y: number, z: number) {\r\n this.low.x = this.high.x = x;\r\n this.low.y = this.high.y = y;\r\n this.low.z = this.high.z = z;\r\n }\r\n /** Create a single point range */\r\n public static createXYZ<T extends Range3d>(x: number, y: number, z: number, result?: T): T {\r\n result = result ? result : new this() as T;\r\n result.setDirect(x, y, z, x, y, z, false);\r\n return result;\r\n }\r\n /** Create a box with 2 pairs of xyz candidates. Theses are compared and shuffled as needed for the box. */\r\n public static createXYZXYZ<T extends Range3d>(\r\n xA: number, yA: number, zA: number, xB: number, yB: number, zB: number, result?: T,\r\n ): T {\r\n result = result ? result : new this() as T;\r\n result.setDirect(\r\n Math.min(xA, xB), Math.min(yA, yB), Math.min(zA, zB),\r\n Math.max(xA, xB), Math.max(yA, yB), Math.max(zA, zB),\r\n false,\r\n );\r\n return result;\r\n }\r\n\r\n /** Create a box with 2 pairs of xyz candidates. If any direction has order flip, create null. */\r\n public static createXYZXYZOrCorrectToNull<T extends Range3d>(\r\n xA: number, yA: number, zA: number, xB: number, yB: number, zB: number, result?: T,\r\n ): T {\r\n result = result ? result : new this() as T;\r\n if (xA > xB || yA > yB || zA > zB)\r\n return this.createNull(result);\r\n result.setDirect(\r\n Math.min(xA, xB), Math.min(yA, yB), Math.min(zA, zB),\r\n Math.max(xA, xB), Math.max(yA, yB), Math.max(zA, zB),\r\n true,\r\n );\r\n return result;\r\n }\r\n /** Creates a 3d range from a 2d range's low and high members, setting the corresponding z values to the value given. */\r\n public static createRange2d<T extends Range3d>(range: Range2d, z: number = 0, result?: T): T {\r\n const retVal = result ? result : new this() as T;\r\n retVal.setNull();\r\n retVal.extendXYZ(range.low.x, range.low.y, z);\r\n retVal.extendXYZ(range.high.x, range.high.y, z);\r\n return retVal;\r\n }\r\n /** Create a range around an array of points. */\r\n public static createArray<T extends Range3d>(points: XYAndZ[], result?: T): T {\r\n result = result ? result : new this() as T;\r\n result.setNull();\r\n let point;\r\n for (point of points)\r\n result.extendPoint(point);\r\n return result;\r\n }\r\n /** Extend a range around an array of points (optionally transformed) */\r\n public extendArray(points: XYAndZ[] | GrowableXYZArray, transform?: Transform) {\r\n if (Array.isArray(points))\r\n if (transform)\r\n for (const point of points)\r\n this.extendTransformedXYZ(transform, point.x, point.y, point.z);\r\n else\r\n for (const point of points)\r\n this.extendXYZ(point.x, point.y, point.z);\r\n else // growable array -- this should be implemented without point extraction !!!\r\n if (transform)\r\n for (let i = 0; i < points.length; i++)\r\n this.extendTransformedXYZ(\r\n transform,\r\n points.getXAtUncheckedPointIndex(i),\r\n points.getYAtUncheckedPointIndex(i),\r\n points.getZAtUncheckedPointIndex(i),\r\n );\r\n else\r\n for (let i = 0; i < points.length; i++)\r\n this.extendXYZ(\r\n points.getXAtUncheckedPointIndex(i),\r\n points.getYAtUncheckedPointIndex(i),\r\n points.getZAtUncheckedPointIndex(i),\r\n );\r\n }\r\n /** Extend a range around an array of points (optionally transformed) */\r\n public extendInverseTransformedArray(points: XYAndZ[] | GrowableXYZArray, transform: Transform) {\r\n if (Array.isArray(points))\r\n for (const point of points)\r\n this.extendInverseTransformedXYZ(transform, point.x, point.y, point.z);\r\n else // growable array -- this should be implemented without point extraction !!!\r\n for (let i = 0; i < points.length; i++)\r\n this.extendInverseTransformedXYZ(\r\n transform,\r\n points.getXAtUncheckedPointIndex(i),\r\n points.getYAtUncheckedPointIndex(i),\r\n points.getZAtUncheckedPointIndex(i),\r\n );\r\n }\r\n /** Multiply the point x,y,z by transform and use the coordinate to extend this range. */\r\n public extendTransformedXYZ(transform: Transform, x: number, y: number, z: number) {\r\n const origin = transform.origin;\r\n const coffs = transform.matrix.coffs;\r\n this.extendXYZ(\r\n origin.x + coffs[0] * x + coffs[1] * y + coffs[2] * z,\r\n origin.y + coffs[3] * x + coffs[4] * y + coffs[5] * z,\r\n origin.z + coffs[6] * x + coffs[7] * y + coffs[8] * z,\r\n );\r\n }\r\n /** Multiply the point x,y,z,w by transform and use the coordinate to extend this range. */\r\n public extendTransformedXYZW(transform: Transform, x: number, y: number, z: number, w: number) {\r\n const origin = transform.origin;\r\n const coffs = transform.matrix.coffs;\r\n this.extendXYZW(\r\n origin.x * w + coffs[0] * x + coffs[1] * y + coffs[2] * z,\r\n origin.y * w + coffs[3] * x + coffs[4] * y + coffs[5] * z,\r\n origin.z * w + coffs[6] * x + coffs[7] * y + coffs[8] * z,\r\n w,\r\n );\r\n }\r\n\r\n /** Multiply the point x,y,z by the inverse of the transform and use the coordinate to extend this range. */\r\n public extendInverseTransformedXYZ(transform: Transform, x: number, y: number, z: number): boolean {\r\n const origin = transform.origin;\r\n if (!transform.matrix.computeCachedInverse(true))\r\n return false;\r\n const coffs = transform.matrix.inverseCoffs!;\r\n const xx = x - origin.x;\r\n const yy = y - origin.y;\r\n const zz = z - origin.z;\r\n this.extendXYZ(\r\n coffs[0] * xx + coffs[1] * yy + coffs[2] * zz,\r\n coffs[3] * xx + coffs[4] * yy + coffs[5] * zz,\r\n coffs[6] * xx + coffs[7] * yy + coffs[8] * zz,\r\n );\r\n return true;\r\n }\r\n /** Extend the range by the two transforms applied to xyz */\r\n public extendTransformTransformedXYZ(\r\n transformA: Transform, transformB: Transform, x: number, y: number, z: number,\r\n ): void {\r\n const origin = transformB.origin;\r\n const coffs = transformB.matrix.coffs;\r\n this.extendTransformedXYZ(\r\n transformA,\r\n origin.x + coffs[0] * x + coffs[1] * y + coffs[2] * z,\r\n origin.y + coffs[3] * x + coffs[4] * y + coffs[5] * z,\r\n origin.z + coffs[6] * x + coffs[7] * y + coffs[8] * z,\r\n );\r\n }\r\n /** Test if the box has high<low for any of x,y,z, condition. Note that a range around a single point is NOT null. */\r\n public get isNull(): boolean {\r\n return this.high.x < this.low.x\r\n || this.high.y < this.low.y\r\n || this.high.z < this.low.z;\r\n }\r\n /** Test if data has high<low for any of x,y,z, condition. Note that a range around a single point is NOT null. */\r\n public static isNull(data: LowAndHighXYZ): boolean {\r\n return data.high.x < data.low.x\r\n || data.high.y < data.low.y\r\n || data.high.z < data.low.z;\r\n }\r\n /** Test of the range contains a single point. */\r\n public get isSinglePoint(): boolean {\r\n return this.high.x === this.low.x\r\n && this.high.y === this.low.y\r\n && this.high.z === this.low.z;\r\n }\r\n /** Return the midpoint of the diagonal. No test for null range. */\r\n public get center(): Point3d {\r\n return this.low.interpolate(.5, this.high);\r\n }\r\n /** Return the low x coordinate */\r\n public get xLow(): number {\r\n return this.low.x;\r\n }\r\n /** Return the low y coordinate */\r\n public get yLow(): number {\r\n return this.low.y;\r\n }\r\n /** Return the low z coordinate */\r\n public get zLow(): number {\r\n return this.low.z;\r\n }\r\n /** Return the high x coordinate */\r\n public get xHigh(): number {\r\n return this.high.x;\r\n }\r\n /** Return the high y coordinate */\r\n public get yHigh(): number {\r\n return this.high.y;\r\n }\r\n /** Return the high z coordinate */\r\n public get zHigh(): number {\r\n return this.high.z;\r\n }\r\n /** Return the length of the box in the x direction */\r\n public xLength(): number {\r\n const a = this.high.x - this.low.x; return a > 0.0 ? a : 0.0;\r\n }\r\n /** Return the length of the box in the y direction */\r\n public yLength(): number {\r\n const a = this.high.y - this.low.y; return a > 0.0 ? a : 0.0;\r\n }\r\n /** Return the length of the box in the z direction */\r\n public zLength(): number {\r\n const a = this.high.z - this.low.z; return a > 0.0 ? a : 0.0;\r\n }\r\n /** Return the largest of the x,y, z lengths of the range. */\r\n public maxLength(): number {\r\n return Math.max(this.xLength(), this.yLength(), this.zLength());\r\n }\r\n /**\r\n * Return the diagonal vector. There is no check for isNull -- if the range isNull(), the vector will have very\r\n * large negative coordinates.\r\n */\r\n public diagonal(result?: Vector3d): Vector3d {\r\n return this.low.vectorTo(this.high, result);\r\n }\r\n /**\r\n * Return the diagonal vector. There is no check for isNull -- if the range isNull(), the vector will have very\r\n * large negative coordinates.\r\n */\r\n public diagonalFractionToPoint(fraction: number, result?: Point3d): Point3d {\r\n return this.low.interpolate(fraction, this.high, result);\r\n }\r\n /** Return a point given by fractional positions on the XYZ axes. This is done with no check for isNull !!! */\r\n public fractionToPoint(fractionX: number, fractionY: number, fractionZ: number = 0, result?: Point3d): Point3d {\r\n return this.low.interpolateXYZ(fractionX, fractionY, fractionZ, this.high, result);\r\n }\r\n /**\r\n * Return a point given by fractional positions on the XYZ axes.\r\n * Returns undefined if the range is null.\r\n */\r\n public localXYZToWorld(\r\n fractionX: number, fractionY: number, fractionZ: number, result?: Point3d,\r\n ): Point3d | undefined {\r\n if (this.isNull) return undefined;\r\n return this.low.interpolateXYZ(fractionX, fractionY, fractionZ, this.high, result);\r\n }\r\n /**\r\n * Return a point given by fractional positions on the XYZ axes.\r\n * * Returns undefined if the range is null.\r\n */\r\n public localToWorld(xyz: XYAndZ, result?: Point3d): Point3d | undefined {\r\n return this.localXYZToWorld(xyz.x, xyz.y, xyz.z, result);\r\n }\r\n /**\r\n * Replace fractional coordinates by world coordinates.\r\n * @returns false if null range.\r\n */\r\n public localToWorldArrayInPlace(points: Point3d[]): boolean {\r\n if (this.isNull) return false;\r\n for (const p of points)\r\n this.low.interpolateXYZ(p.x, p.y, p.z, this.high, p);\r\n return false;\r\n }\r\n /**\r\n * Return fractional coordinates of point within the range.\r\n * * returns undefined if the range is null.\r\n * * returns undefined if any direction (x,y,z) has zero length\r\n */\r\n public worldToLocal(point: XYAndZ, result?: Point3d): Point3d | undefined {\r\n const ax = RangeBase.npcScaleFactor(this.low.x, this.high.x);\r\n const ay = RangeBase.npcScaleFactor(this.low.y, this.high.y);\r\n const az = RangeBase.npcScaleFactor(this.low.z, this.high.z);\r\n if (ax === 0.0 || ay === 0.0 || az === 0.0)\r\n return undefined;\r\n return Point3d.create(\r\n (point.x - this.low.x) * ax,\r\n (point.y - this.low.y) * ay,\r\n (point.z - this.low.z) * az,\r\n result,\r\n );\r\n }\r\n /**\r\n * Return fractional coordinates of point within the range.\r\n * * returns undefined if the range is null.\r\n * * returns undefined if any direction (x,y,z) has zero length\r\n */\r\n public worldToLocalArrayInPlace(point: Point3d[]): boolean {\r\n const ax = RangeBase.npcScaleFactor(this.low.x, this.high.x);\r\n const ay = RangeBase.npcScaleFactor(this.low.y, this.high.y);\r\n const az = RangeBase.npcScaleFactor(this.low.z, this.high.z);\r\n if (ax === 0.0 || ay === 0.0 || az === 0.0)\r\n return false;\r\n for (const p of point)\r\n Point3d.create((p.x - this.low.x) * ax, (p.y - this.low.y) * ay, (p.z - this.low.z) * az, p);\r\n return true;\r\n }\r\n /**\r\n * Return an array with the 8 corners on order wth \"x varies fastest, then y, then z\"\r\n * * points preallocated in `result` are reused if result.length >= 8.\r\n * * in reuse case, result.length is trimmed to 8\r\n */\r\n public corners(result?: Point3d[]): Point3d[] {\r\n if (result !== undefined && result.length >= 8) {\r\n result[0].set(this.low.x, this.low.y, this.low.z);\r\n result[1].set(this.high.x, this.low.y, this.low.z);\r\n result[2].set(this.low.x, this.high.y, this.low.z);\r\n result[3].set(this.high.x, this.high.y, this.low.z);\r\n result[4].set(this.low.x, this.low.y, this.high.z);\r\n result[5].set(this.high.x, this.low.y, this.high.z);\r\n result[6].set(this.low.x, this.high.y, this.high.z);\r\n result[7].set(this.high.x, this.high.y, this.high.z);\r\n result.length = 8;\r\n return result;\r\n }\r\n return [\r\n Point3d.create(this.low.x, this.low.y, this.low.z),\r\n Point3d.create(this.high.x, this.low.y, this.low.z),\r\n Point3d.create(this.low.x, this.high.y, this.low.z),\r\n Point3d.create(this.high.x, this.high.y, this.low.z),\r\n Point3d.create(this.low.x, this.low.y, this.high.z),\r\n Point3d.create(this.high.x, this.low.y, this.high.z),\r\n Point3d.create(this.low.x, this.high.y, this.high.z),\r\n Point3d.create(this.high.x, this.high.y, this.high.z),\r\n ];\r\n }\r\n /**\r\n * Return an array with indices of the corners of a face\r\n * * face 0 has negative x normal\r\n * * face 1 has positive x normal\r\n * * face 2 has negative y normal\r\n * * face 3 has positive y normal\r\n * * face 4 has negative z normal\r\n * * face 5 has positive z normal\r\n * * Any other value returns face 5\r\n * * faces are CCW as viewed from outside.\r\n */\r\n public static faceCornerIndices(index: number): number[] {\r\n if (index === 0)\r\n return [0, 4, 6, 2];\r\n if (index === 1)\r\n return [1, 3, 7, 5];\r\n if (index === 2)\r\n return [0, 1, 5, 4];\r\n if (index === 3)\r\n return [3, 2, 6, 7];\r\n if (index === 4)\r\n return [0, 2, 3, 1];\r\n return [4, 5, 7, 6];\r\n }\r\n /**\r\n * Return a rectangle that is the cross section as viewed from above (z direction) and at zFraction\r\n * @param zFraction plane altitude within the 0..1 z fraction range\r\n * @param upwardNormal true for CCW as viewed from above\r\n * @param addClosure true to add closure edge back to the start\r\n * @returns rectangle points\r\n */\r\n public rectangleXY(\r\n zFraction: number = 0.0, upwardNormal: boolean = true, addClosure: boolean = true,\r\n ): Point3d[] | undefined {\r\n if (this.isNull)\r\n return undefined;\r\n const points: Point3d[] = [\r\n this.fractionToPoint(0, 0, zFraction),\r\n this.fractionToPoint(1, 0, zFraction),\r\n this.fractionToPoint(1, 1, zFraction),\r\n this.fractionToPoint(0, 1, zFraction),\r\n ];\r\n if (addClosure)\r\n points.push(points[0].clone());\r\n\r\n if (!upwardNormal)\r\n points.reverse();\r\n return points;\r\n }\r\n /** Return the largest absolute value among any coordinates in the box corners. */\r\n public maxAbs(): number {\r\n if (this.isNull)\r\n return 0.0;\r\n return Math.max(this.low.maxAbs(), this.high.maxAbs());\r\n }\r\n /** Returns true if the x direction size is nearly zero */\r\n public get isAlmostZeroX(): boolean {\r\n return Geometry.isSmallMetricDistance(this.xLength());\r\n }\r\n /** Returns true if the y direction size is nearly zero */\r\n public get isAlmostZeroY(): boolean {\r\n return Geometry.isSmallMetricDistance(this.yLength());\r\n }\r\n /** Returns true if the z direction size is nearly zero */\r\n public get isAlmostZeroZ(): boolean {\r\n return Geometry.isSmallMetricDistance(this.zLength());\r\n }\r\n /** Test if a point given as x,y,z is within the range. */\r\n public containsXYZ(x: number, y: number, z: number): boolean {\r\n return x >= this.low.x\r\n && y >= this.low.y\r\n && z >= this.low.z\r\n && x <= this.high.x\r\n && y <= this.high.y\r\n && z <= this.high.z;\r\n }\r\n /** Test if a point given as x,y is within the range (ignoring z of range). */\r\n public containsXY(x: number, y: number): boolean {\r\n return x >= this.low.x\r\n && y >= this.low.y\r\n && x <= this.high.x\r\n && y <= this.high.y;\r\n }\r\n /** Test if a point is within the range. */\r\n public containsPoint(point: XYAndZ): boolean {\r\n return this.containsXYZ(point.x, point.y, point.z);\r\n }\r\n /** Test if the x,y coordinates of a point are within the range. */\r\n public containsPointXY(point: XYAndZ): boolean {\r\n return point.x >= this.low.x\r\n && point.y >= this.low.y\r\n && point.x <= this.high.x\r\n && point.y <= this.high.y;\r\n }\r\n /** Test of other range is within this range */\r\n public containsRange(other: Range3d): boolean {\r\n return other.low.x >= this.low.x\r\n && other.low.y >= this.low.y\r\n && other.low.z >= this.low.z\r\n && other.high.x <= this.high.x\r\n && other.high.y <= this.high.y\r\n && other.high.z <= this.high.z;\r\n }\r\n /**\r\n * Test if there is any intersection with the other range.\r\n * @param other the other range.\r\n * @param margin optional signed distance by which to expand/shrink `other` in all directions.\r\n */\r\n public intersectsRange(other: Range3d, margin?: number): boolean {\r\n if (margin) {\r\n return !(\r\n this.low.x > other.high.x + margin\r\n || this.low.y > other.high.y + margin\r\n || this.low.z > other.high.z + margin\r\n || other.low.x > this.high.x + margin\r\n || other.low.y > this.high.y + margin\r\n || other.low.z > this.high.z + margin\r\n );\r\n }\r\n return !(\r\n this.low.x > other.high.x\r\n || this.low.y > other.high.y\r\n || this.low.z > other.high.z\r\n || other.low.x > this.high.x\r\n || other.low.y > this.high.y\r\n || other.low.z > this.high.z\r\n );\r\n }\r\n /**\r\n * Test if there is any intersection with the other range, ignoring z.\r\n * @param other the other range.\r\n * @param margin optional signed distance by which to expand/shrink `other` in all xy-directions.\r\n */\r\n public intersectsRangeXY(other: Range3d, margin?: number): boolean {\r\n if (margin) {\r\n return !(\r\n this.low.x > other.high.x + margin\r\n || this.low.y > other.high.y + margin\r\n || other.low.x > this.high.x + margin\r\n || other.low.y > this.high.y + margin\r\n );\r\n }\r\n return !(\r\n this.low.x > other.high.x\r\n || this.low.y > other.high.y\r\n || other.low.x > this.high.x\r\n || other.low.y > this.high.y\r\n );\r\n }\r\n /** Return 0 if the point is within the range, otherwise the distance to the closest face or corner. */\r\n public distanceToPoint(point: XYAndZ): number {\r\n if (this.isNull)\r\n return RangeBase._EXTREME_POSITIVE;\r\n return Math.min(\r\n Geometry.hypotenuseXYZ(\r\n RangeBase.coordinateToRangeAbsoluteDistance(point.x, this.low.x, this.high.x),\r\n RangeBase.coordinateToRangeAbsoluteDistance(point.y, this.low.y, this.high.y),\r\n RangeBase.coordinateToRangeAbsoluteDistance(point.z, this.low.z, this.high.z),\r\n ),\r\n RangeBase._EXTREME_POSITIVE,\r\n );\r\n }\r\n /** Return 0 if the point's xy-coordinates are within the range, otherwise the xy-distance to the closest face or corner. */\r\n public distanceToPointXY(point: XAndY): number {\r\n if (this.isNull)\r\n return RangeBase._EXTREME_POSITIVE;\r\n return Math.min(\r\n Geometry.hypotenuseXY(\r\n RangeBase.coordinateToRangeAbsoluteDistance(point.x, this.low.x, this.high.x),\r\n RangeBase.coordinateToRangeAbsoluteDistance(point.y, this.low.y, this.high.y),\r\n ),\r\n RangeBase._EXTREME_POSITIVE,\r\n );\r\n }\r\n /** Returns 0 if the ranges have any overlap, otherwise the shortest absolute distance from one to the other. */\r\n public distanceToRange(other: Range3d): number {\r\n return Math.min(\r\n Geometry.hypotenuseXYZ(\r\n RangeBase.rangeToRangeAbsoluteDistance(this.low.x, this.high.x, other.low.x, other.high.x),\r\n RangeBase.rangeToRangeAbsoluteDistance(this.low.y, this.high.y, other.low.y, other.high.y),\r\n RangeBase.rangeToRangeAbsoluteDistance(this.low.z, this.high.z, other.low.z, other.high.z),\r\n ),\r\n RangeBase._EXTREME_POSITIVE,\r\n );\r\n }\r\n /** Returns 0 if the ranges have any xy-overlap, otherwise the shortest absolute xy-distance from one to the other. */\r\n public distanceToRangeXY(other: Range3d): number {\r\n return Math.min(\r\n Geometry.hypotenuseXY(\r\n RangeBase.rangeToRangeAbsoluteDistance(this.low.x, this.high.x, other.low.x, other.high.x),\r\n RangeBase.rangeToRangeAbsoluteDistance(this.low.y, this.high.y, other.low.y, other.high.y),\r\n ),\r\n RangeBase._EXTREME_POSITIVE,\r\n );\r\n }\r\n /** Expand this range to include the given point. */\r\n public extendXYZ(x: number, y: number, z: number): void {\r\n if (x < this.low.x)\r\n this.low.x = x;\r\n if (x > this.high.x)\r\n this.high.x = x;\r\n\r\n if (y < this.low.y)\r\n this.low.y = y;\r\n if (y > this.high.y)\r\n this.high.y = y;\r\n\r\n if (z < this.low.z)\r\n this.low.z = z;\r\n if (z > this.high.z)\r\n this.high.z = z;\r\n }\r\n /** Expand this range by a point interpolated between given points. */\r\n public extendInterpolated(xyz0: XYAndZ, fraction: number, xyz1: XYAndZ): void {\r\n if (fraction < 0.5) {\r\n this.extendXYZ(\r\n xyz0.x + fraction * (xyz1.x - xyz0.x),\r\n xyz0.y + fraction * (xyz1.y - xyz0.y),\r\n xyz0.z + fraction * (xyz1.z - xyz0.z));\r\n } else {\r\n // use reversed formulas for best accuracy at fraction=1.0\r\n const g = 1.0 - fraction;\r\n this.extendXYZ(\r\n xyz1.x + g * (xyz0.x - xyz1.x),\r\n xyz1.y + g * (xyz0.y - xyz1.y),\r\n xyz1.z + g * (xyz0.z - xyz1.z));\r\n }\r\n }\r\n /** Expand this range to include the x-coordinate. */\r\n public extendXOnly(x: number): void {\r\n if (x < this.low.x)\r\n this.low.x = x;\r\n if (x > this.high.x)\r\n this.high.x = x;\r\n }\r\n /** Expand this range to include the y-coordinate. */\r\n public extendYOnly(y: number): void {\r\n if (y < this.low.y)\r\n this.low.y = y;\r\n if (y > this.high.y)\r\n this.high.y = y;\r\n }\r\n /** Expand this range to include the z-coordinate. */\r\n public extendZOnly(z: number): void {\r\n if (z < this.low.z)\r\n this.low.z = z;\r\n if (z > this.high.z)\r\n this.high.z = z;\r\n }\r\n /** Expand this range to include the specified coordinate `a`. */\r\n public extendSingleAxis(a: number, axisIndex: AxisIndex): void {\r\n if (axisIndex === AxisIndex.X)\r\n this.extendXOnly(a);\r\n if (axisIndex === AxisIndex.Y)\r\n this.extendYOnly(a);\r\n if (axisIndex === AxisIndex.Z)\r\n this.extendZOnly(a);\r\n }\r\n /** Expand this range by distances a (weighted and possibly signed) in all directions */\r\n public extendXYZW(x: number, y: number, z: number, w: number): void {\r\n if (!Geometry.isSmallMetricDistance(w))\r\n this.extendXYZ(x / w, y / w, z / w);\r\n }\r\n /** Expand this range to include an optionally transformed point. */\r\n public extendPoint(point: XYAndZ, transform?: Transform): void {\r\n if (transform) {\r\n this.extendTransformedXYZ(transform, point.x, point.y, point.z);\r\n } else {\r\n this.extendXYZ(point.x, point.y, point.z);\r\n }\r\n }\r\n /** Expand this range to include a transformed point. */\r\n public extendTransformedPoint(transform: Transform, point: XYAndZ): void {\r\n this.extendTransformedXYZ(transform, point.x, point.y, point.z);\r\n }\r\n /** Expand this range to include a range. */\r\n public extendRange(other: LowAndHighXYZ): void {\r\n if (!Range3d.isNull(other)) {\r\n this.extendXYZ(other.low.x, other.low.y, other.low.z);\r\n this.extendXYZ(other.high.x, other.high.y, other.high.z);\r\n }\r\n }\r\n /**\r\n * In each direction look at the difference between this range limit and that of interiorRange.\r\n * * If this range is larger, expand it by extrapolationFactor.\r\n */\r\n public extendWhenLarger(other: LowAndHighXYZ, extrapolationFactor: number): void {\r\n if (!Range3d.isNull(other) && !Range3d.isNull(this)) {\r\n this.high.x += RangeBase.multiplyIfPositive(this.high.x - other.high.x, extrapolationFactor);\r\n this.high.y += RangeBase.multiplyIfPositive(this.high.y - other.high.y, extrapolationFactor);\r\n this.high.z += RangeBase.multiplyIfPositive(this.high.z - other.high.z, extrapolationFactor);\r\n this.low.x -= RangeBase.multiplyIfPositive(other.low.x - this.low.x, extrapolationFactor);\r\n this.low.y -= RangeBase.multiplyIfPositive(other.low.y - this.low.y, extrapolationFactor);\r\n this.low.z -= RangeBase.multiplyIfPositive(other.low.z - this.low.z, extrapolationFactor);\r\n }\r\n }\r\n /** Return the intersection of ranges. */\r\n public intersect(other: Range3d, result?: Range3d): Range3d {\r\n if (!this.intersectsRange(other))\r\n return Range3d.createNull(result);\r\n return Range3d.createXYZXYZOrCorrectToNull(\r\n Math.max(this.low.x, other.low.x), Math.max(this.low.y, other.low.y), Math.max(this.low.z, other.low.z),\r\n Math.min(this.high.x, other.high.x), Math.min(this.high.y, other.high.y), Math.min(this.high.z, other.high.z),\r\n result,\r\n );\r\n }\r\n /** Return the union of ranges. */\r\n public union(other: Range3d, result?: Range3d): Range3d {\r\n if (this.isNull)\r\n return other.clone(result);\r\n if (other.isNull)\r\n return this.clone(result as this);\r\n // we trust null ranges have EXTREME values, so a null in either input leads to expected results.\r\n return Range3d.createXYZXYZOrCorrectToNull(\r\n Math.min(this.low.x, other.low.x), Math.min(this.low.y, other.low.y), Math.min(this.low.z, other.low.z),\r\n Math.max(this.high.x, other.high.x), Math.max(this.high.y, other.high.y), Math.max(this.high.z, other.high.z),\r\n result,\r\n );\r\n }\r\n /**\r\n * Move low and high points by scaleFactor around the center point.\r\n * @param scaleFactor scale factor applied to low, high distance from center.\r\n */\r\n public scaleAboutCenterInPlace(scaleFactor: number) {\r\n if (!this.isNull) {\r\n scaleFactor = Math.abs(scaleFactor);\r\n // do the scalar stuff to avoid making a temporary object ....\r\n const xMid = 0.5 * (this.low.x + this.high.x);\r\n const yMid = 0.5 * (this.low.y + this.high.y);\r\n const zMid = 0.5 * (this.low.z + this.high.z);\r\n this.high.x = Geometry.interpolate(xMid, scaleFactor, this.high.x);\r\n this.high.y = Geometry.interpolate(yMid, scaleFactor, this.high.y);\r\n this.high.z = Geometry.interpolate(zMid, scaleFactor, this.high.z);\r\n this.low.x = Geometry.interpolate(xMid, scaleFactor, this.low.x);\r\n this.low.y = Geometry.interpolate(yMid, scaleFactor, this.low.y);\r\n this.low.z = Geometry.interpolate(zMid, scaleFactor, this.low.z);\r\n }\r\n }\r\n /**\r\n * Move all limits by a fixed amount.\r\n * * positive delta expands the range size\r\n * * negative delta reduces the range size\r\n * * if any dimension reduces below zero size, the whole range becomes null\r\n * @param delta shift to apply.\r\n */\r\n public expandInPlace(delta: number): void {\r\n this.setDirect(\r\n this.low.x - delta, this.low.y - delta, this.low.z - delta,\r\n this.high.x + delta, this.high.y + delta, this.high.z + delta,\r\n true,\r\n );\r\n }\r\n /** Create a local to world transform from this range. */\r\n public getLocalToWorldTransform(result?: Transform): Transform {\r\n return Transform.createOriginAndMatrix(\r\n Point3d.create(this.low.x, this.low.y, this.low.z),\r\n Matrix3d.createRowValues(\r\n this.high.x - this.low.x, 0, 0,\r\n 0, this.high.y - this.low.y, 0,\r\n 0, 0, this.high.z - this.low.z,\r\n ),\r\n result,\r\n );\r\n }\r\n /**\r\n * Creates an NPC to world transformation to go from 000...111 to the globally aligned cube with diagonally\r\n * opposite corners that are the\r\n * min and max of this range. The diagonal component for any degenerate direction is 1.\r\n */\r\n public getNpcToWorldRangeTransform(result?: Transform): Transform {\r\n const transform = this.getLocalToWorldTransform(result);\r\n const matrix = transform.matrix;\r\n if (matrix.coffs[0] === 0)\r\n matrix.coffs[0] = 1;\r\n if (matrix.coffs[4] === 0)\r\n matrix.coffs[4] = 1;\r\n if (matrix.coffs[8] === 0)\r\n matrix.coffs[8] = 1;\r\n return transform;\r\n }\r\n /**\r\n * Ensure that the length of each dimension of this Range3d is at least a minimum size. If not, expand\r\n * to minimum about the center.\r\n * @param min The minimum length for each dimension.\r\n */\r\n public ensureMinLengths(min: number = .001): void {\r\n let size = (min - this.xLength()) / 2.0;\r\n if (size > 0) {\r\n this.low.x -= size;\r\n this.high.x += size;\r\n }\r\n size = (min - this.yLength()) / 2.0;\r\n if (size > 0) {\r\n this.low.y -= size;\r\n this.high.y += size;\r\n }\r\n size = (min - this.zLength()) / 2.0;\r\n if (size > 0) {\r\n this.low.z -= size;\r\n this.high.z += size;\r\n }\r\n }\r\n}\r\n\r\n/**\r\n * Range on a 1d axis\r\n * * `low` and `high` members are always non-null objects\r\n * * having `low > high` indicates an empty range.\r\n * * the range contains x values for which `low <= x <= high`\r\n * @public\r\n */\r\nexport class Range1d extends RangeBase {\r\n /** Low point coordinates. DO NOT MODIFY FROM OUTSIDE THIS CLASS */\r\n public low: number;\r\n /** High point coordinates. DO NOT MODIFY FROM OUTSIDE THIS CLASS */\r\n public high: number;\r\n /** Reset the low and high to null range state. */\r\n public setNull() {\r\n this.low = RangeBase._EXTREME_POSITIVE;\r\n this.high = RangeBase._EXTREME_NEGATIVE;\r\n }\r\n // internal use only -- directly set all coordinates, test only if directed.\r\n private setDirect(low: number, high: number, correctToNull: boolean = false) {\r\n this.low = low;\r\n this.high = high;\r\n if (correctToNull && low > high)\r\n this.setNull();\r\n }\r\n // explicit ctor - no enforcement of value relationships\r\n private constructor(low: number = RangeBase._EXTREME_POSITIVE, high: number = RangeBase._EXTREME_NEGATIVE) {\r\n super();\r\n this.low = low; this.high = high; // duplicates set_direct, but compiler is not convinced they are set.\r\n this.setDirect(low, high);\r\n }\r\n /** Returns true if this and other have equal low and high parts, or both are null ranges. */\r\n public isAlmostEqual(other: Readonly<Range1d>): boolean {\r\n return (Geometry.isSameCoordinate(this.low, other.low) && Geometry.isSameCoordinate(this.high, other.high))\r\n || (this.isNull && other.isNull);\r\n }\r\n /** Copy contents from other Range1d. */\r\n public setFrom(other: Range1d) {\r\n this.low = other.low;\r\n this.high = other.high;\r\n }\r\n /**\r\n * Convert from a JSON object of one of these forms:\r\n * * Any array of numbers: `[value,value, value]`\r\n * * An object with low and high as properties: `{low:lowValue, high: highValue}`\r\n */\r\n public setFromJSON(json: Range1dProps): void {\r\n this.setNull();\r\n if (Array.isArray(json)) {\r\n let value;\r\n for (value of json) {\r\n if (Number.isFinite(value))\r\n this.extendX(value);\r\n }\r\n } else if (\r\n json.low !== undefined && Number.isFinite(json.low) && json.high !== undefined && Number.isFinite(json.high)\r\n ) {\r\n this.extendX(json.low);\r\n this.extendX(json.high);\r\n }\r\n }\r\n /** Use `setFromJSON` to parse `json` into a new Range1d instance. */\r\n public static fromJSON<T extends Range1d>(json?: Range1dProps): T {\r\n const result = new this() as T;\r\n if (json)\r\n result.setFromJSON(json);\r\n return result;\r\n }\r\n /**\r\n * Convert to a JSON object of form\r\n * ```\r\n * [lowValue,highValue]\r\n * ```\r\n */\r\n public toJSON(): Range1dProps {\r\n if (this.isNull)\r\n return new Array<number>();\r\n else\r\n return [this.low, this.high];\r\n }\r\n /**\r\n * Return a new Range1d with contents of this.\r\n * @param result optional result.\r\n */\r\n public clone(result?: this): this {\r\n result = result ? result : new (this.constructor as any)() as this;\r\n result.setDirect(this.low, this.high);\r\n return result;\r\n }\r\n /**\r\n * Return a new Range1d with contents of this.\r\n * @param result optional result.\r\n */\r\n public static createFrom<T extends Range1d>(other: T, result?: T) {\r\n result = result ? result : new this() as T;\r\n result.setDirect(other.low, other.high);\r\n return result;\r\n }\r\n /**\r\n * Create a range with no content.\r\n * @param result optional result.\r\n */\r\n public static createNull<T extends Range1d>(result?: T): T {\r\n result = result ? result : new this() as T;\r\n result.setNull();\r\n return result;\r\n }\r\n /**\r\n * Create a range with `delta` added to low and high\r\n * * If `this` is a null range, return a null range.\r\n */\r\n public cloneTranslated(delta: number, result?: Range1d): Range1d {\r\n result = result ? result : this.clone();\r\n if (!result.isNull) {\r\n result.low += delta;\r\n result.high += delta;\r\n }\r\n return result;\r\n }\r\n /**\r\n * Set this range to be a single value.\r\n * @param x value to use as both low and high.\r\n */\r\n public setX(x: number) {\r\n this.low = this.high = x;\r\n }\r\n /** Create a single point box */\r\n public static createX<T extends Range1d>(x: number, result?: T): T {\r\n result = result ? result : new this() as T;\r\n result.setDirect(x, x);\r\n return result;\r\n }\r\n /**\r\n * Set this range to (min(x0,x1), max(x0,x1))\r\n * @param x0 first value\r\n * @param x1 second value\r\n */\r\n public setXXUnordered(x0: number, x1: number) {\r\n if (x0 <= x1) {\r\n this.low = x0; this.high = x1;\r\n } else {\r\n this.low = x1; this.high = x0;\r\n }\r\n }\r\n /** Check if low is 0 and high is 1 */\r\n public get isExact01(): boolean {\r\n return this.low === 0.0 && this.high === 1.0;\r\n }\r\n /**\r\n * Create a box from two values. Values are reversed if needed\r\n * @param xA first value\r\n * @param xB second value\r\n */\r\n public static createXX<T extends Range1d>(xA: number, xB: number, result?: T): T {\r\n result = result ? result : new this() as T;\r\n result.setDirect(\r\n Math.min(xA, xB),\r\n Math.max(xA, xB),\r\n );\r\n return result;\r\n }\r\n /**\r\n * Create a box from two values, but null range if the values are reversed\r\n * @param xA first value\r\n * @param xB second value\r\n */\r\n public static createXXOrCorrectToNull<T extends Range1d>(xA: number, xB: number, result?: T): T {\r\n if (xB < xA)\r\n return Range1d.createNull(result);\r\n\r\n result = result ? result : new this() as T;\r\n result.setDirect(\r\n Math.min(xA, xB),\r\n Math.max(xA, xB),\r\n );\r\n return result;\r\n }\r\n /**\r\n * Create a range containing all the values in an array.\r\n * @param values array of points to be contained in the range.\r\n * @param result optional result.\r\n */\r\n public static createArray<T extends Range1d>(values: Float64Array | number[], result?: T): T {\r\n result = result ? result : new this() as T;\r\n let x;\r\n for (x of values)\r\n result.extendX(x);\r\n return result;\r\n }\r\n /** Extend to include an array of values */\r\n public extendArray(values: Float64Array | number[]) {\r\n let x;\r\n for (x of values)\r\n this.extendX(x);\r\n }\r\n /**\r\n * Extend to include `values` at indices `beginIndex <= i < endIndex]`\r\n * @param values array of values\r\n * @param beginIndex first index to include\r\n * @param numValue number of values to access\r\n */\r\n public extendArraySubset(values: Float64Array | number[], beginIndex: number, numValue: number) {\r\n const endIndex = beginIndex + numValue;\r\n for (let i = beginIndex; i < endIndex; i++)\r\n this.extendX(values[i]);\r\n }\r\n /** Test if the box has high<low Note that a range around a single point is NOT null. */\r\n public get isNull(): boolean {\r\n return this.high < this.low;\r\n }\r\n /** Test of the range contains a single point. */\r\n public get isSinglePoint(): boolean {\r\n return this.high === this.low;\r\n }\r\n /** Return the length of the range in the x direction */\r\n public length(): number {\r\n const a = this.high - this.low;\r\n return a > 0.0 ? a : 0.0;\r\n }\r\n /** Return a point given by fractional positions within the range. This is done with no check for isNull !!! */\r\n public fractionToPoint(fraction: number): number {\r\n return Geometry.interpolate(this.low, fraction, this.high);\r\n }\r\n /** Return the largest absolute value among the box limits. */\r\n public maxAbs(): number {\r\n if (this.isNull)\r\n return 0.0;\r\n return Math.max(Math.abs(this.low), Math.abs(this.high));\r\n }\r\n /** Test if the x direction size is nearly zero */\r\n public get isAlmostZeroLength(): boolean {\r\n return Geometry.isSmallMetricDistance(this.length());\r\n }\r\n /** Test if a number is within the range. */\r\n public containsX(x: number): boolean {\r\n return x >= this.low && x <= this.high;\r\n }\r\n /**\r\n * Test if a number is in within the open range.\r\n * * This method differs from `containsX` by returning false if x equals either range extreme.\r\n */\r\n public containsXOpen(x: number): boolean {\r\n return x > this.low && x < this.high;\r\n }\r\n\r\n /** Test of other range is within this range */\r\n public containsRange(other: Range1d): boolean {\r\n return other.low >= this.low\r\n && other.high <= this.high;\r\n }\r\n /** Test if there is any intersection with other range */\r\n public intersectsRange(other: Range1d): boolean {\r\n return !(this.low > other.high || other.low > this.high);\r\n }\r\n /**\r\n * Intersect this range with a range defined by parameters x0 and x1\r\n * * For x1 > x0, that range is null, and the intersection is null.\r\n * * For x0 <= x1, the input is a non-null range.\r\n * * The intersection range replaces the contents of this.\r\n */\r\n public intersectRangeXXInPlace(x0: number, x1: number) {\r\n if (x1 < x0 || x1 < this.low || x0 > this.high) {\r\n this.setNull();\r\n } else {\r\n if (x1 < this.high)\r\n this.high = x1;\r\n if (x0 > this.low)\r\n this.low = x0;\r\n }\r\n }\r\n /** Returns 0 if the ranges have any overlap, otherwise the shortest absolute distance from one to the other. */\r\n public distanceToRange(other: Range1d): number {\r\n return RangeBase.rangeToRangeAbsoluteDistance(this.low, this.high, other.low, other.high);\r\n }\r\n /** Return 0 if the point is within the range, otherwise the (unsigned) distance to the closest face or corner */\r\n public distanceToX(x: number): number {\r\n if (this.isNull)\r\n return RangeBase._EXTREME_POSITIVE;\r\n return RangeBase.coordinateToRangeAbsoluteDistance(x, this.low, this.high);\r\n }\r\n /** Expand this range by a single coordinate */\r\n public extendX(x: number): void {\r\n if (x < this.low) this.low = x;\r\n if (x > this.high) this.high = x;\r\n }\r\n /** Expand this range to include a range. */\r\n public extendRange(other: Range1d): void {\r\n if (!other.isNull) {\r\n this.extendX(other.low);\r\n this.extendX(other.high);\r\n }\r\n }\r\n /** Extend only the low limit to x. Return true if the low limit is changed. */\r\n public extendLow(x: number): boolean {\r\n if (this.isNull || x < this.low) {\r\n this.low = x;\r\n return true;\r\n }\r\n return false;\r\n }\r\n /** Extend only the high limit to x. Return true if the high limit is changed. */\r\n public extendHigh(x: number): boolean {\r\n if (this.isNull || x > this.high) {\r\n this.high = x;\r\n return true;\r\n }\r\n return false;\r\n }\r\n /** Return the intersection of ranges. */\r\n public intersect(other: Range1d, result?: Range1d): Range1d {\r\n if (!this.intersectsRange(other))\r\n return Range1d.createNull(result);\r\n\r\n return Range1d.createXXOrCorrectToNull(\r\n Math.max(this.low, other.low),\r\n Math.min(this.high, other.high),\r\n result,\r\n );\r\n }\r\n /** Return the union of ranges. */\r\n public union(other: Range1d, result?: Range1d): Range1d {\r\n // we trust null ranges have EXTREME values, so a null in either input leads to expected results.\r\n return Range1d.createXX\r\n (\r\n Math.min(this.low, other.low),\r\n Math.max(this.high, other.high),\r\n result);\r\n }\r\n /**\r\n * Move low and high points by scaleFactor around the center point.\r\n * @param scaleFactor scale factor applied to low, high distance from center.\r\n */\r\n public scaleAboutCenterInPlace(scaleFactor: number) {\r\n if (!this.isNull) {\r\n scaleFactor = Math.abs(scaleFactor);\r\n // do the scalar stuff to avoid making a temporary object ....\r\n const xMid = 0.5 * (this.low + this.high);\r\n this.high = Geometry.interpolate(xMid, scaleFactor, this.high);\r\n this.low = Geometry.interpolate(xMid, scaleFactor, this.low);\r\n }\r\n }\r\n /**\r\n * Move all limits by a fixed amount.\r\n * * positive delta expands the range size\r\n * * negative delta reduces the range size\r\n * * if any dimension reduces below zero size, the whole range becomes null\r\n * @param delta shift to apply.\r\n */\r\n public expandInPlace(delta: number): void {\r\n this.setDirect(\r\n this.low - delta,\r\n this.high + delta, true);\r\n }\r\n /**\r\n * Clip this range to a linear half space condition.\r\n * * If `limitA > limitB` the limit space is empty:\r\n * * Make this range null.\r\n * * Return `false`.\r\n * * Otherwise for `limitA <= limitB`:\r\n * * Solve `a + u * fA = limitA` and `a + u * fB = limitB`.\r\n * * If unable to solve (i.e. u near zero), `a` alone determines whether to leave this interval unchanged or reduce to null.\r\n * * Form an interval from the solution `{fA, fB}`.\r\n * * Clip this instance to the solution interval.\r\n * * Return `true` if the range is non-null after the clip.\r\n * @param a constant of linear map\r\n * @param u coefficient of linear map\r\n * @param limitA crossing value, assumed in range relation with limitB\r\n * @param limitB crossing value, assumed in range relation with limitB\r\n */\r\n public clipLinearMapToInterval(a: number, u: number, limitA: number, limitB: number): boolean {\r\n // f = (limit - a) / u\r\n if (limitB < limitA || this.high < this.low)\r\n return false;\r\n const fractionA = Geometry.conditionalDivideFraction(limitA - a, u);\r\n const fractionB = Geometry.conditionalDivideFraction(limitB - a, u);\r\n // single point case\r\n if (fractionA === undefined || fractionB === undefined) {\r\n if (limitA <= a && a <= limitB)\r\n return true;\r\n this.setNull();\r\n return false;\r\n }\r\n if (fractionA < fractionB) {\r\n if (fractionA > this.low)\r\n this.low = fractionA;\r\n if (fractionB < this.high)\r\n this.high = fractionB;\r\n } else {\r\n if (fractionA < this.high)\r\n this.high = fractionA;\r\n if (fractionB > this.low)\r\n this.low = fractionB;\r\n }\r\n if (this.high < this.low) {\r\n this.setNull();\r\n return false;\r\n }\r\n return true;\r\n }\r\n}\r\n\r\n/**\r\n * Range box in xy plane\r\n * @public\r\n */\r\nexport class Range2d extends RangeBase implements LowAndHighXY {\r\n // low and high are always non-null objects\r\n // any direction of low.q > high.q is considered a null range.\r\n /** Low point coordinates. DO NOT MODIFY FROM OUTSIDE THIS CLASS */\r\n public low: Point2d;\r\n /** High point coordinates. DO NOT MODIFY FROM OUTSIDE THIS CLASS */\r\n public high: Point2d;\r\n /** Reset the low and high to null range state. */\r\n public setNull() {\r\n this.low.x = RangeBase._EXTREME_POSITIVE;\r\n this.low.y = RangeBase._EXTREME_POSITIVE;\r\n this.high.x = RangeBase._EXTREME_NEGATIVE;\r\n this.high.y = RangeBase._EXTREME_NEGATIVE;\r\n }\r\n /** Flatten the low and high coordinates of any json object with low.x .. high.y into an array of 4 doubles */\r\n public static toFloat64Array(val: LowAndHighXY): Float64Array {\r\n return Float64Array.of(val.low.x, val.low.y, val.high.x, val.high.y);\r\n }\r\n /** Flatten the low and high coordinates of this instance into an array of 4 doubles */\r\n public toFloat64Array(): Float64Array {\r\n return Range2d.toFloat64Array(this);\r\n }\r\n /**\r\n * Construct a Range2d from an array of double-precision values\r\n * @param f64 the array, which should contain exactly 4 values in this order: lowX, lowY, highX, highY\r\n * @return a new Range2d object\r\n */\r\n public static fromFloat64Array<T extends Range2d>(f64: Float64Array): T {\r\n if (f64.length !== 4)\r\n throw new Error(\"invalid array\");\r\n return new this(f64[0], f64[1], f64[2], f64[3]) as T;\r\n }\r\n /**\r\n * Construct a Range2d from an un-typed array. This mostly useful when interpreting ECSQL query results of\r\n * the 'blob' type, where you know that that result is a Range3d.\r\n * @param buffer untyped array\r\n * @return a new Range2d object\r\n */\r\n public static fromArrayBuffer<T extends Range2d>(buffer: ArrayBuffer): T {\r\n return this.fromFloat64Array(new Float64Array(buffer));\r\n }\r\n // explicit constructor - no enforcement of value relationships\r\n public constructor(\r\n lowX = Range2d._EXTREME_POSITIVE, lowY = Range2d._EXTREME_POSITIVE,\r\n highX = Range2d._EXTREME_NEGATIVE, highY = Range2d._EXTREME_NEGATIVE,\r\n ) {\r\n super();\r\n this.low = Point2d.create(lowX, lowY);\r\n this.high = Point2d.create(highX, highY);\r\n }\r\n /** Returns true if this and other have equal low and high parts, or both are null ranges. */\r\n public isAlmostEqual(other: Range2d): boolean {\r\n return (this.low.isAlmostEqual(other.low) && this.high.isAlmostEqual(other.high))\r\n || (this.isNull && other.isNull);\r\n }\r\n /** Copy all content from any `other` that has low and high xy data. */\r\n public setFrom(other: LowAndHighXY) {\r\n this.low.set(other.low.x, other.low.y);\r\n this.high.set(other.high.x, other.high.y);\r\n }\r\n /** Create a new Range2d from any `other` that has low and high xy data. */\r\n public static createFrom<T extends Range2d>(other: LowAndHighXY, result?: T): T {\r\n if (result) { result.setFrom(other); return result; }\r\n return this.createXYXYOrCorrectToNull(other.low.x, other.low.y, other.high.x, other.high.y, result) as T;\r\n }\r\n /** Treat any array of numbers as numbers to be inserted !!! */\r\n public setFromJSON(json: Range2dProps): void {\r\n this.setNull();\r\n if (Array.isArray(json)) {\r\n const point = Point2d.create();\r\n for (const value of json) {\r\n point.setFromJSON(value);\r\n this.extendPoint(point);\r\n }\r\n return;\r\n }\r\n const low = Point2d.fromJSON(json.low);\r\n const high = Point2d.fromJSON(json.high);\r\n if (!RangeBase.isExtremePoint2d(low) && !RangeBase.isExtremePoint2d(high)) {\r\n this.extendPoint(low);\r\n this.extendPoint(high);\r\n }\r\n }\r\n /** Freeze this instance (and its members) so it is read-only */\r\n public freeze(): Readonly<this> {\r\n this.low.freeze();\r\n this.high.freeze();\r\n return Object.freeze(this);\r\n }\r\n /** Return json array with two points as produced by `Point2d.toJSON` */\r\n public toJSON(): Range2dProps {\r\n return this.isNull ? [] : [this.low.toJSON(), this.high.toJSON()];\r\n }\r\n /** Use `setFromJSON` to parse `json` into a new Range2d instance. */\r\n public static fromJSON<T extends Range2d>(json?: Range2dProps): T {\r\n const result = new this() as T;\r\n if (json)\r\n result.setFromJSON(json);\r\n return result;\r\n }\r\n // internal use only -- directly set all coordinates, without tests.\r\n private setDirect(xA: number, yA: number, xB: number, yB: number, correctToNull: boolean) {\r\n this.low.x = xA;\r\n this.low.y = yA;\r\n this.high.x = xB;\r\n this.high.y = yB;\r\n if (correctToNull) {\r\n if (this.low.x > this.high.x || this.low.y > this.high.y)\r\n this.setNull();\r\n }\r\n }\r\n /** Return a clone of this range (or copy to optional result) */\r\n public clone(result?: this): this {\r\n result = result ? result : new (this.constructor as any)() as this;\r\n result.setDirect(this.low.x, this.low.y, this.high.x, this.high.y, false);\r\n return result;\r\n }\r\n\r\n /**\r\n * Return a copy, translated by adding `shift` components in all directions.\r\n * @note The translation of a null range is also a null range.\r\n */\r\n public cloneTranslated(shift: XAndY, result?: this): this {\r\n result = result ? result : new (this.constructor as any)() as this;\r\n if (!this.isNull)\r\n result.setDirect(\r\n this.low.x + shift.x, this.low.y + shift.y,\r\n this.high.x + shift.x, this.high.y + shift.y,\r\n false,\r\n );\r\n return result;\r\n }\r\n\r\n /** Create a range with no content. */\r\n public static createNull<T extends Range2d>(result?: T): T {\r\n result = result ? result : new this() as T;\r\n result.setNull();\r\n return result;\r\n }\r\n /** Set low and hight to a single xy value. */\r\n public setXY(x: number, y: number) {\r\n this.low.x = this.high.x = x;\r\n this.low.y = this.high.y = y;\r\n }\r\n /** Create a single point box */\r\n public static createXY<T extends Range2d>(x: number, y: number, result?: T): T {\r\n result = result ? result : new this() as T;\r\n result.setDirect(x, y, x, y, false);\r\n return result;\r\n }\r\n /** Create a box with 2 pairs of xy candidates. Theses are compared and shuffled as needed for the box. */\r\n public static createXYXY<T extends Range2d>(xA: number, yA: number, xB: number, yB: number, result?: T): T {\r\n result = result ? result : new this() as T;\r\n result.setDirect(\r\n Math.min(xA, xB), Math.min(yA, yB),\r\n Math.max(xA, xB), Math.max(yA, yB), false);\r\n return result;\r\n }\r\n /** Create a box with 3 pairs of xy candidates. Theses are compared and shuffled as needed for the box. */\r\n public static createXYXYXY<T extends Range2d>(\r\n xA: number, yA: number, xB: number, yB: number, xC: number, yC: number, result?: T,\r\n ): T {\r\n result = result ? result : new this() as T;\r\n result.setDirect(\r\n Math.min(xA, xB, xC), Math.min(yA, yB, yC),\r\n Math.max(xA, xB, xC), Math.max(yA, yB, yC),\r\n false,\r\n );\r\n return result;\r\n }\r\n /** Create a box with 2 pairs of xy candidates. If any direction has order flip, create null. */\r\n public static createXYXYOrCorrectToNull<T extends Range2d>(\r\n xA: number, yA: number, xB: number, yB: number, result?: T,\r\n ): T {\r\n if (xA > xB || yA > yB)\r\n return this.createNull(result);\r\n result = result ? result : new this() as T;\r\n result.setDirect(\r\n Math.min(xA, xB), Math.min(yA, yB),\r\n Math.max(xA, xB), Math.max(yA, yB),\r\n true,\r\n );\r\n return result;\r\n }\r\n /** Create a range around an array of points. */\r\n public static createArray<T extends Range2d>(points: XAndY[], result?: T): T {\r\n result = result ? result : new this() as T;\r\n let point;\r\n for (point of points)\r\n result.extendPoint(point);\r\n return result;\r\n }\r\n /** Test if the box has high<low for any of x,y, condition. Note that a range around a single point is NOT null. */\r\n public get isNull(): boolean {\r\n return this.high.x < this.low.x\r\n || this.high.y < this.low.y;\r\n }\r\n /**\r\n * Test if the box has high strictly less than low for any of x,y, condition. Note that a range around a\r\n * single point is NOT null.\r\n */\r\n public static isNull(range: LowAndHighXY): boolean {\r\n return range.high.x < range.low.x\r\n || range.high.y < range.low.y;\r\n }\r\n /** Test of the range contains a single point. */\r\n public get isSinglePoint(): boolean {\r\n return this.high.x === this.low.x\r\n && this.high.y === this.low.y;\r\n }\r\n /** Return the midpoint of the diagonal. No test for null range. */\r\n public get center(): Point2d {\r\n return this.low.interpolate(.5, this.high);\r\n }\r\n /** Return the low x coordinate */\r\n public get xLow(): number {\r\n return this.low.x;\r\n }\r\n /** Return the low y coordinate */\r\n public get yLow(): number {\r\n return this.low.y;\r\n }\r\n /** Return the high x coordinate */\r\n public get xHigh(): number {\r\n return this.high.x;\r\n }\r\n /** Return the high y coordinate */\r\n public get yHigh(): number {\r\n return this.high.y;\r\n }\r\n /** Length of the box in the x direction */\r\n public xLength(): number {\r\n const a = this.high.x - this.low.x;\r\n return a > 0.0 ? a : 0.0;\r\n }\r\n /** Length of the box in the y direction */\r\n public yLength(): number {\r\n const a = this.high.y - this.low.y;\r\n return a > 0.0 ? a : 0.0;\r\n }\r\n /**\r\n * Return the diagonal vector. There is no check for isNull -- if the range isNull(), the vector will have very\r\n * large negative coordinates.\r\n */\r\n public diagonal(result?: Vector2d): Vector2d {\r\n return this.low.vectorTo(this.high, result);\r\n }\r\n /**\r\n * Return the point at the specified fraction along the diagonal vector. There is no check for isNull -- if the\r\n * range isNull(), the vector will have very large negative coordinates.\r\n */\r\n public diagonalFractionToPoint(fraction: number, result?: Point2d): Point2d {\r\n return this.low.interpolate(fraction, this.high, result);\r\n }\r\n /** Return a point given by fractional positions on the XY axes. This is done with no check for isNull !!! */\r\n public fractionToPoint(fractionX: number, fractionY: number, result?: Point2d): Point2d {\r\n return this.low.interpolateXY(fractionX, fractionY, this.high, result);\r\n }\r\n /**\r\n * Return an array with the 4 corners.\r\n * * if asLoop is false, 4 corners are \"x varies fastest, then y\"\r\n * * if asLoop is true, 5 corners are in CCW order WITH CLOSURE\r\n */\r\n public corners3d(asLoop: boolean = false, z: number = 0): Point3d[] {\r\n if (asLoop)\r\n return [\r\n Point3d.create(this.low.x, this.low.y, z),\r\n Point3d.create(this.high.x, this.low.y, z),\r\n Point3d.create(this.high.x, this.high.y, z),\r\n Point3d.create(this.low.x, this.high.y, z),\r\n Point3d.create(this.low.x, this.low.y, z),\r\n ];\r\n return [\r\n Point3d.create(this.low.x, this.low.y, z),\r\n Point3d.create(this.high.x, this.low.y, z),\r\n Point3d.create(this.low.x, this.high.y, z),\r\n Point3d.create(this.high.x, this.high.y, z),\r\n ];\r\n }\r\n /** Largest absolute value among any coordinates in the box corners. */\r\n public maxAbs(): number {\r\n if (this.isNull)\r\n return 0.0;\r\n return Math.max(this.low.maxAbs(), this.high.maxAbs());\r\n }\r\n /** Test if the x direction size is nearly zero */\r\n public get isAlmostZeroX(): boolean {\r\n return Geometry.isSmallMetricDistance(this.xLength());\r\n }\r\n /** Test if the y direction size is nearly zero */\r\n public get isAlmostZeroY(): boolean {\r\n return Geometry.isSmallMetricDistance(this.yLength());\r\n }\r\n /** Test if a point given as x,y is within the range */\r\n public containsXY(x: number, y: number): boolean {\r\n return x >= this.low.x\r\n && y >= this.low.y\r\n && x <= this.high.x\r\n && y <= this.high.y;\r\n }\r\n /** Test if a point is within the range. */\r\n public containsPoint(point: XAndY): boolean {\r\n return this.containsXY(point.x, point.y);\r\n }\r\n /** Test of other range is within this range */\r\n public containsRange(other: LowAndHighXY): boolean {\r\n return other.low.x >= this.low.x\r\n && other.low.y >= this.low.y\r\n && other.high.x <= this.high.x\r\n && other.high.y <= this.high.y;\r\n }\r\n /** Test if there is any intersection with other range */\r\n public intersectsRange(other: LowAndHighXY): boolean {\r\n return !(\r\n this.low.x > other.high.x\r\n || this.low.y > other.high.y\r\n || other.low.x > this.high.x\r\n || other.low.y > this.high.y\r\n );\r\n }\r\n /** Return 0 if the point is within the range, otherwise the distance to the closest face or corner */\r\n public distanceToPoint(point: XAndY): number {\r\n if (this.isNull)\r\n return Range2d._EXTREME_POSITIVE;\r\n return Math.min(\r\n Geometry.hypotenuseXY(\r\n RangeBase.coordinateToRangeAbsoluteDistance(point.x, this.low.x, this.high.x),\r\n RangeBase.coordinateToRangeAbsoluteDistance(point.y, this.low.y, this.high.y),\r\n ),\r\n Range2d._EXTREME_POSITIVE,\r\n );\r\n }\r\n /** Return 0 if the point is within the range, otherwise the distance to the closest face or corner */\r\n public distanceToRange(other: LowAndHighXY): number {\r\n return Math.min(\r\n Geometry.hypotenuseXY(\r\n RangeBase.rangeToRangeAbsoluteDistance(this.low.x, this.high.x, other.low.x, other.high.x),\r\n RangeBase.rangeToRangeAbsoluteDistance(this.low.y, this.high.y, other.low.y, other.high.y),\r\n ),\r\n Range2d._EXTREME_POSITIVE,\r\n );\r\n }\r\n /** Expand this range to include a point given by x,y */\r\n public extendXY(x: number, y: number): void {\r\n if (x < this.low.x)\r\n this.low.x = x;\r\n if (x > this.high.x)\r\n this.high.x = x;\r\n if (y < this.low.y)\r\n this.low.y = y;\r\n if (y > this.high.y)\r\n this.high.y = y;\r\n }\r\n /** Expand this range to include a point given by x,y */\r\n public extendTransformedXY(transform: Transform, x: number, y: number): void {\r\n const x1 = transform.multiplyComponentXYZ(0, x, y, 0);\r\n const y1 = transform.multiplyComponentXYZ(1, x, y, 0);\r\n this.extendXY(x1, y1);\r\n }\r\n /** Expand this range to include a point. */\r\n public extendPoint(point: XAndY): void {\r\n this.extendXY(point.x, point.y);\r\n }\r\n /** Expand this range to include a range. */\r\n public extendRange(other: LowAndHighXY): void {\r\n if (!Range2d.isNull(other)) {\r\n this.extendXY(other.low.x, other.low.y);\r\n this.extendXY(other.high.x, other.high.y);\r\n }\r\n }\r\n /** Return the intersection of ranges. */\r\n public intersect(other: LowAndHighXY, result?: Range2d): Range2d {\r\n if (!this.intersectsRange(other))\r\n return Range2d.createNull(result);\r\n return Range2d.createXYXY(\r\n Math.max(this.low.x, other.low.x), Math.max(this.low.y, other.low.y),\r\n Math.min(this.high.x, other.high.x), Math.min(this.high.y, other.high.y),\r\n result,\r\n );\r\n }\r\n /** Return the union of ranges. */\r\n public union(other: LowAndHighXY, result?: Range2d): Range2d {\r\n if (this.isNull)\r\n return Range2d.createFrom(other, result);\r\n if (Range2d.isNull(other))\r\n return this.clone(result as this);\r\n // we trust null ranges have EXTREME values, so a null in either input leads to expected results.\r\n return Range2d.createXYXY(\r\n Math.min(this.low.x, other.low.x), Math.min(this.low.y, other.low.y),\r\n Math.max(this.high.x, other.high.x), Math.max(this.high.y, other.high.y),\r\n result,\r\n );\r\n }\r\n /**\r\n * Move low and high points by scaleFactor around the center point.\r\n * @param scaleFactor scale factor applied to low, high distance from center.\r\n */\r\n public scaleAboutCenterInPlace(scaleFactor: number) {\r\n if (!this.isNull) {\r\n scaleFactor = Math.abs(scaleFactor);\r\n // do the scalar stuff to avoid making a temporary object ....\r\n const xMid = 0.5 * (this.low.x + this.high.x);\r\n const yMid = 0.5 * (this.low.y + this.high.y);\r\n this.high.x = Geometry.interpolate(xMid, scaleFactor, this.high.x);\r\n this.high.y = Geometry.interpolate(yMid, scaleFactor, this.high.y);\r\n this.low.x = Geometry.interpolate(xMid, scaleFactor, this.low.x);\r\n this.low.y = Geometry.interpolate(yMid, scaleFactor, this.low.y);\r\n }\r\n }\r\n /**\r\n * Move all limits by a fixed amount.\r\n * * positive delta expands the range size\r\n * * negative delta reduces the range size\r\n * * if any dimension reduces below zero size, the whole range becomes null\r\n * @param delta shift to apply.\r\n */\r\n public expandInPlace(delta: number): void {\r\n this.setDirect(\r\n this.low.x - delta, this.low.y - delta,\r\n this.high.x + delta, this.high.y + delta,\r\n true,\r\n );\r\n }\r\n /**\r\n * Return fractional coordinates of point within the range.\r\n * * returns undefined if the range is null.\r\n * * returns undefined if any direction (x,y) has zero length\r\n */\r\n public worldToLocal(point: XAndY, result?: Point2d): Point2d | undefined {\r\n const ax = RangeBase.npcScaleFactor(this.low.x, this.high.x);\r\n const ay = RangeBase.npcScaleFactor(this.low.y, this.high.y);\r\n if (ax === 0.0 || ay === 0.0)\r\n return undefined;\r\n return Point2d.create((point.x - this.low.x) * ax, (point.y - this.low.y) * ay, result);\r\n }\r\n}\r\n"]}
|
|
1
|
+
{"version":3,"file":"Range.js","sourceRoot":"","sources":["../../../src/geometry3d/Range.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAE/F;;GAEG;AAEH,OAAO,EAAE,SAAS,EAAmB,QAAQ,EAAE,MAAM,aAAa,CAAC;AAGnE,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACtC,OAAO,EAAE,OAAO,EAAY,MAAM,mBAAmB,CAAC;AACtD,OAAO,EAAE,OAAO,EAAY,MAAM,mBAAmB,CAAC;AACtD,OAAO,EAAE,yBAAyB,EAAE,sBAAsB,EAAE,MAAM,kBAAkB,CAAC;AACrF,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAGxC,gDAAgD;AAChD,yDAAyD;AACzD;;;GAGG;AACH,MAAM,OAAgB,SAAS;IAC7B,+EAA+E;IACrE,MAAM,CAAU,iBAAiB,GAAW,OAAO,CAAC;IAC9D,+EAA+E;IACrE,MAAM,CAAU,iBAAiB,GAAW,CAAC,OAAO,CAAC;IAC/D,kFAAkF;IACxE,MAAM,CAAC,cAAc,CAAC,GAAW,EAAE,IAAY;QACvD,OAAO,CAAC,IAAI,IAAI,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,GAAG,CAAC,IAAI,GAAG,GAAG,CAAC,CAAC;IAClD,CAAC;IACD,qFAAqF;IAC9E,MAAM,CAAC,cAAc,CAAC,CAAS;QACpC,OAAO,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,I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IAAI,EAAE,KAAK,GAAG;YAC1B,OAAO,SAAS,CAAC;QACnB,OAAO,OAAO,CAAC,MAAM,CAAC,CAAC,KAAK,CAAC,CAAC,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,KAAK,CAAC,CAAC,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,EAAE,EAAE,MAAM,CAAC,CAAC;IAC1F,CAAC;CACF","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n\n/** @packageDocumentation\n * @module CartesianGeometry\n */\n\nimport { AxisIndex, BeJSONFunctions, Geometry } from \"../Geometry\";\nimport { MultiLineStringDataVariant } from \"../geometry3d/IndexedXYZCollection\";\nimport { GrowableXYZArray } from \"./GrowableXYZArray\";\nimport { Matrix3d } from \"./Matrix3d\";\nimport { Point2d, Vector2d } from \"./Point2dVector2d\";\nimport { Point3d, Vector3d } from \"./Point3dVector3d\";\nimport { PointStreamRangeCollector, VariantPointDataStream } from \"./PointStreaming\";\nimport { Transform } from \"./Transform\";\nimport { LowAndHighXY, LowAndHighXYZ, Range1dProps, Range2dProps, Range3dProps, XAndY, XYAndZ } from \"./XYZProps\";\n\n// allow _EXTREME_POSITIVE and _EXTREME_NEGATIVE\n/* eslint-disable @typescript-eslint/naming-convention */\n/**\n * Base class for Range1d, Range2d, Range3d.\n * @public\n */\nexport abstract class RangeBase {\n /** Number considered impossibly large possibly for a coordinate in a range. */\n protected static readonly _EXTREME_POSITIVE: number = 1.0e200;\n /** Number considered to be impossibly negative for a coordinate in a range. */\n protected static readonly _EXTREME_NEGATIVE: number = -1.0e200;\n /** Return 0 if high<= low, otherwise `1/(high-low)` for use in fractionalizing */\n protected static npcScaleFactor(low: number, high: number): number {\n return (high <= low) ? 0.0 : 1.0 / (high - low);\n }\n /** Return true if x is outside the range `[_EXTREME_NEGATIVE, _EXTREME_POSITIVE]' */\n public static isExtremeValue(x: number): boolean {\n return Math.abs(x) >= RangeBase._EXTREME_POSITIVE;\n }\n /** Return true if any x or y or z is outside the range `[_EXTREME_NEGATIVE, _EXTREME_POSITIVE]' */\n public static isExtremePoint3d(xyz: XYAndZ) {\n return RangeBase.isExtremeValue(xyz.x) || RangeBase.isExtremeValue(xyz.y) || RangeBase.isExtremeValue(xyz.z);\n }\n /** Return true if either of x,y is outside the range `[_EXTREME_NEGATIVE, _EXTREME_POSITIVE]' */\n public static isExtremePoint2d(xy: XAndY) {\n return RangeBase.isExtremeValue(xy.x) || RangeBase.isExtremeValue(xy.y);\n }\n /**\n * Return the min absolute distance from any point of `[lowA,highA]' to any point of `[lowB,highB]'.\n * * Both low,high pairs have order expectations: The condition `high < low` means null interval.\n * * If there is interval overlap, the distance is zero.\n * @param lowA low of interval A\n * @param highA high of interval A\n * @param lowB low of interval B\n * @param highB high of interval B\n */\n public static rangeToRangeAbsoluteDistance(lowA: number, highA: number, lowB: number, highB: number): number {\n if (highA < lowA)\n return RangeBase._EXTREME_POSITIVE;\n if (highB < lowB)\n return RangeBase._EXTREME_POSITIVE;\n if (highB < lowA)\n return lowA - highB;\n if (highB <= highA)\n return 0.0;\n if (lowB <= highA)\n return 0.0;\n return lowB - highA;\n }\n /**\n * Given a coordinate and pair of range limits, return the smallest distance to the range.\n * * This is zero for any point inside the range\n * * This is _EXTREME_POSITIVE if the range limits are inverted\n * * Otherwise (i.e. x is outside a finite range) the distance to the near endpoint.\n */\n public static coordinateToRangeAbsoluteDistance(x: number, low: number, high: number): number {\n if (high < low)\n return RangeBase._EXTREME_POSITIVE;\n if (x < low)\n return low - x;\n if (x > high)\n return x - high;\n return 0.0;\n }\n /**\n * If a > 0, return (extrapolationFactor * a); otherwise return defaultValue\n * @param q\n * @param factor multiplier for positive q values.\n */\n public static multiplyIfPositive(q: number, factor: number, defaultValue: number = 0.0): number {\n return q > 0 ? factor * q : defaultValue;\n }\n}\n\n/**\n * Axis aligned range in 3D.\n * * member `low` contains minimum coordinate of range box\n * * member `high` contains maximum coordinate of range box\n * * The range is considered null (empty) if any low member is larger than its high counterpart.\n * @public\n */\nexport class Range3d extends RangeBase implements LowAndHighXYZ, BeJSONFunctions {\n // low and high are always non-null objects\n // any direction of low.q > high.q is considered a null range.\n // private ctor and setXYZXYZ_direct set the low and high explicitly (without further tests of low.q.<= high.q)\n /** Low point coordinates */\n public low: Point3d;\n /** High point coordinates */\n public high: Point3d;\n /** Set this transform to values that indicate it has no geometric contents. */\n public setNull() {\n this.low.x = RangeBase._EXTREME_POSITIVE;\n this.low.y = RangeBase._EXTREME_POSITIVE;\n this.low.z = RangeBase._EXTREME_POSITIVE;\n this.high.x = RangeBase._EXTREME_NEGATIVE;\n this.high.y = RangeBase._EXTREME_NEGATIVE;\n this.high.z = RangeBase._EXTREME_NEGATIVE;\n }\n\n /** Freeze this instance (and its members) so it is read-only */\n public freeze(): Readonly<this> {\n this.low.freeze();\n this.high.freeze();\n return Object.freeze(this);\n }\n /** Flatten the low and high coordinates of any json object with low.x .. high.z into an array of 6 doubles */\n public static toFloat64Array(val: LowAndHighXYZ): Float64Array {\n return Float64Array.of(val.low.x, val.low.y, val.low.z, val.high.x, val.high.y, val.high.z);\n }\n /** Flatten the low and high coordinates of this into an array of 6 doubles */\n public toFloat64Array(): Float64Array {\n return Range3d.toFloat64Array(this);\n }\n /**\n * Construct a Range3d from an array of double-precision values\n * @param f64 the array, which should contain exactly 6 values in this order: lowX, lowY, lowZ, highX, highY, highZ\n * @return a new Range3d object\n */\n public static fromFloat64Array<T extends Range3d>(f64: Float64Array): T {\n if (f64.length !== 6)\n throw new Error(\"invalid array\");\n return new this(f64[0], f64[1], f64[2], f64[3], f64[4], f64[5]) as T;\n }\n /**\n * Construct a Range3d from an un-typed array. This mostly useful when interpreting ECSQL query results of\n * the 'blob' type, where you know that that result is a Range3d.\n * @param buffer untyped array\n * @return a new Range3d object\n */\n public static fromArrayBuffer<T extends Range3d>(buffer: ArrayBuffer): T {\n return this.fromFloat64Array(new Float64Array(buffer));\n }\n // explicit ctor - no enforcement of value relationships\n public constructor(\n lowX: number = RangeBase._EXTREME_POSITIVE, lowY: number = RangeBase._EXTREME_POSITIVE, lowZ: number = RangeBase._EXTREME_POSITIVE,\n highX: number = RangeBase._EXTREME_NEGATIVE, highY: number = RangeBase._EXTREME_NEGATIVE, highZ: number = RangeBase._EXTREME_NEGATIVE,\n ) {\n super();\n this.low = Point3d.create(lowX, lowY, lowZ);\n this.high = Point3d.create(highX, highY, highZ);\n }\n /** Returns true if this and other have equal low and high parts, or both are null ranges. */\n public isAlmostEqual(other: Readonly<Range3d>, tol?: number): boolean {\n return (this.low.isAlmostEqual(other.low, tol) && this.high.isAlmostEqual(other.high, tol))\n || (this.isNull && other.isNull);\n }\n /** Copy low and high values from other. */\n public setFrom(other: Range3d) {\n this.low.setFrom(other.low);\n this.high.setFrom(other.high);\n }\n /** Return a new Range3d copied from a range or derived type */\n public static createFrom<T extends Range3d>(other: Range3d, result?: T): T {\n if (result) {\n result.setFrom(other);\n return result;\n }\n return this.createXYZXYZOrCorrectToNull<T>(\n other.low.x, other.low.y, other.low.z,\n other.high.x, other.high.y, other.high.z,\n result,\n );\n }\n /**\n * Set this range (in place) from json such as\n * * key-value pairs: `{low:[1,2,3], high:[4,5,6]}`\n * * array of points: `[[1,2,3],[9,3,4],[-2,1,3] ...]`\n * * Lowest level points can be `[1,2,3]` or `{x:1,y:2,z:3}`\n */\n public setFromJSON(json?: Range3dProps) {\n if (!json)\n return;\n this.setNull();\n if (Array.isArray(json)) {\n const point = Point3d.create();\n for (const value of json) {\n point.setFromJSON(value);\n this.extendPoint(point);\n }\n return;\n }\n const low = Point3d.fromJSON(json.low);\n const high = Point3d.fromJSON(json.high);\n if (!RangeBase.isExtremePoint3d(low) && !RangeBase.isExtremePoint3d(high)) {\n this.extendPoint(low);\n this.extendPoint(high);\n }\n }\n /**\n * Return a JSON object `{low: ... , high: ...}`\n * with points formatted by `Point3d.toJSON()`\n */\n public toJSON(): Range3dProps {\n return { low: this.low.toJSON(), high: this.high.toJSON() };\n }\n /** Use `setFromJSON` to parse `json` into a new Range3d instance. */\n public static fromJSON<T extends Range3d>(json?: Range3dProps): T {\n const result = new this() as T;\n result.setFromJSON(json);\n return result;\n }\n // internal use only -- directly set all coordinates, test only if directed.\n private setDirect(xA: number, yA: number, zA: number, xB: number, yB: number, zB: number, correctToNull: boolean) {\n this.low.x = xA;\n this.low.y = yA;\n this.low.z = zA;\n\n this.high.x = xB;\n this.high.y = yB;\n this.high.z = zB;\n if (correctToNull) {\n if (\n this.low.x > this.high.x\n || this.low.y > this.high.y\n || this.low.z > this.high.z\n )\n this.setNull();\n }\n }\n /** Return a copy */\n public clone(result?: this): this {\n result = result ? result : new (this.constructor as any)() as this;\n result.setDirect(this.low.x, this.low.y, this.low.z, this.high.x, this.high.y, this.high.z, false);\n return result;\n }\n /**\n * Return a copy, translated by adding `shift` components in all directions.\n * * The translate of a null range is also a null range.\n */\n public cloneTranslated(shift: XYAndZ, result?: this): this {\n result = result ? result : new (this.constructor as any)() as this;\n if (!this.isNull)\n result.setDirect(\n this.low.x + shift.x, this.low.y + shift.y, this.low.z + shift.z,\n this.high.x + shift.x, this.high.y + shift.y, this.high.z + shift.z,\n false,\n );\n return result;\n }\n\n /** Return a range initialized to have no content. */\n public static createNull<T extends Range3d>(result?: T): T {\n result = result ? result : new this() as T;\n result.setNull();\n return result;\n }\n /** Extend (modify in place) so that the range is large enough to include the supplied points. */\n public extend(...point: XYAndZ[]) {\n for (const p of point)\n this.extendPoint(p);\n }\n /** Return a range large enough to include the supplied points. If no points are given, the range is a null range */\n public static create(...point: XYAndZ[]) {\n const result = Range3d.createNull();\n for (const p of point)\n result.extendPoint(p);\n return result;\n }\n /** Create a range from freely structured MultiLineStringDataVariant. */\n public static createFromVariantData(data: MultiLineStringDataVariant, transform?: Transform, result?: Range3d): Range3d {\n if (result)\n result.setNull();\n const collector = new PointStreamRangeCollector(transform, result);\n VariantPointDataStream.streamXYZ(data, collector);\n return collector.claimResult();\n }\n /** Create a Range3d enclosing the transformed points. */\n public static createTransformed<T extends Range3d>(transform: Transform, ...point: XYAndZ[]): T {\n const result = this.createNull<T>();\n for (const p of point)\n result.extendTransformedXYZ(transform, p.x, p.y, p.z);\n return result;\n }\n /** Create a Range3d enclosing the transformed points. */\n public static createTransformedArray<T extends Range3d>(\n transform: Transform, points: XYAndZ[] | GrowableXYZArray,\n ): T {\n const result = this.createNull<T>();\n result.extendArray(points, transform);\n return result;\n }\n /** Create a Range3d enclosing the points after inverse transform. */\n public static createInverseTransformedArray<T extends Range3d>(\n transform: Transform, points: XYAndZ[] | GrowableXYZArray,\n ): T {\n const result = this.createNull<T>();\n result.extendInverseTransformedArray(points, transform);\n return result;\n }\n /** Set the range to be a single point supplied as x,y,z values */\n public setXYZ(x: number, y: number, z: number) {\n this.low.x = this.high.x = x;\n this.low.y = this.high.y = y;\n this.low.z = this.high.z = z;\n }\n /** Create a single point range */\n public static createXYZ<T extends Range3d>(x: number, y: number, z: number, result?: T): T {\n result = result ? result : new this() as T;\n result.setDirect(x, y, z, x, y, z, false);\n return result;\n }\n /** Create a box with 2 pairs of xyz candidates. Theses are compared and shuffled as needed for the box. */\n public static createXYZXYZ<T extends Range3d>(\n xA: number, yA: number, zA: number, xB: number, yB: number, zB: number, result?: T,\n ): T {\n result = result ? result : new this() as T;\n result.setDirect(\n Math.min(xA, xB), Math.min(yA, yB), Math.min(zA, zB),\n Math.max(xA, xB), Math.max(yA, yB), Math.max(zA, zB),\n false,\n );\n return result;\n }\n\n /** Create a box with 2 pairs of xyz candidates. If any direction has order flip, create null. */\n public static createXYZXYZOrCorrectToNull<T extends Range3d>(\n xA: number, yA: number, zA: number, xB: number, yB: number, zB: number, result?: T,\n ): T {\n result = result ? result : new this() as T;\n if (xA > xB || yA > yB || zA > zB)\n return this.createNull(result);\n result.setDirect(\n Math.min(xA, xB), Math.min(yA, yB), Math.min(zA, zB),\n Math.max(xA, xB), Math.max(yA, yB), Math.max(zA, zB),\n true,\n );\n return result;\n }\n /** Creates a 3d range from a 2d range's low and high members, setting the corresponding z values to the value given. */\n public static createRange2d<T extends Range3d>(range: Range2d, z: number = 0, result?: T): T {\n const retVal = result ? result : new this() as T;\n retVal.setNull();\n retVal.extendXYZ(range.low.x, range.low.y, z);\n retVal.extendXYZ(range.high.x, range.high.y, z);\n return retVal;\n }\n /** Create a range around an array of points. */\n public static createArray<T extends Range3d>(points: XYAndZ[], result?: T): T {\n result = result ? result : new this() as T;\n result.setNull();\n let point;\n for (point of points)\n result.extendPoint(point);\n return result;\n }\n /** Extend a range around an array of points (optionally transformed) */\n public extendArray(points: XYAndZ[] | GrowableXYZArray, transform?: Transform) {\n if (Array.isArray(points))\n if (transform)\n for (const point of points)\n this.extendTransformedXYZ(transform, point.x, point.y, point.z);\n else\n for (const point of points)\n this.extendXYZ(point.x, point.y, point.z);\n else // growable array -- this should be implemented without point extraction !!!\n if (transform)\n for (let i = 0; i < points.length; i++)\n this.extendTransformedXYZ(\n transform,\n points.getXAtUncheckedPointIndex(i),\n points.getYAtUncheckedPointIndex(i),\n points.getZAtUncheckedPointIndex(i),\n );\n else\n for (let i = 0; i < points.length; i++)\n this.extendXYZ(\n points.getXAtUncheckedPointIndex(i),\n points.getYAtUncheckedPointIndex(i),\n points.getZAtUncheckedPointIndex(i),\n );\n }\n /** Extend a range around an array of points (optionally transformed) */\n public extendInverseTransformedArray(points: XYAndZ[] | GrowableXYZArray, transform: Transform) {\n if (Array.isArray(points))\n for (const point of points)\n this.extendInverseTransformedXYZ(transform, point.x, point.y, point.z);\n else // growable array -- this should be implemented without point extraction !!!\n for (let i = 0; i < points.length; i++)\n this.extendInverseTransformedXYZ(\n transform,\n points.getXAtUncheckedPointIndex(i),\n points.getYAtUncheckedPointIndex(i),\n points.getZAtUncheckedPointIndex(i),\n );\n }\n /** Multiply the point x,y,z by transform and use the coordinate to extend this range. */\n public extendTransformedXYZ(transform: Transform, x: number, y: number, z: number) {\n const origin = transform.origin;\n const coffs = transform.matrix.coffs;\n this.extendXYZ(\n origin.x + coffs[0] * x + coffs[1] * y + coffs[2] * z,\n origin.y + coffs[3] * x + coffs[4] * y + coffs[5] * z,\n origin.z + coffs[6] * x + coffs[7] * y + coffs[8] * z,\n );\n }\n /** Multiply the point x,y,z,w by transform and use the coordinate to extend this range. */\n public extendTransformedXYZW(transform: Transform, x: number, y: number, z: number, w: number) {\n const origin = transform.origin;\n const coffs = transform.matrix.coffs;\n this.extendXYZW(\n origin.x * w + coffs[0] * x + coffs[1] * y + coffs[2] * z,\n origin.y * w + coffs[3] * x + coffs[4] * y + coffs[5] * z,\n origin.z * w + coffs[6] * x + coffs[7] * y + coffs[8] * z,\n w,\n );\n }\n\n /** Multiply the point x,y,z by the inverse of the transform and use the coordinate to extend this range. */\n public extendInverseTransformedXYZ(transform: Transform, x: number, y: number, z: number): boolean {\n const origin = transform.origin;\n if (!transform.matrix.computeCachedInverse(true))\n return false;\n const coffs = transform.matrix.inverseCoffs!;\n const xx = x - origin.x;\n const yy = y - origin.y;\n const zz = z - origin.z;\n this.extendXYZ(\n coffs[0] * xx + coffs[1] * yy + coffs[2] * zz,\n coffs[3] * xx + coffs[4] * yy + coffs[5] * zz,\n coffs[6] * xx + coffs[7] * yy + coffs[8] * zz,\n );\n return true;\n }\n /** Extend the range by the two transforms applied to xyz */\n public extendTransformTransformedXYZ(\n transformA: Transform, transformB: Transform, x: number, y: number, z: number,\n ): void {\n const origin = transformB.origin;\n const coffs = transformB.matrix.coffs;\n this.extendTransformedXYZ(\n transformA,\n origin.x + coffs[0] * x + coffs[1] * y + coffs[2] * z,\n origin.y + coffs[3] * x + coffs[4] * y + coffs[5] * z,\n origin.z + coffs[6] * x + coffs[7] * y + coffs[8] * z,\n );\n }\n /** Test if the box has high<low for any of x,y,z, condition. Note that a range around a single point is NOT null. */\n public get isNull(): boolean {\n return this.high.x < this.low.x\n || this.high.y < this.low.y\n || this.high.z < this.low.z;\n }\n /** Test if data has high<low for any of x,y,z, condition. Note that a range around a single point is NOT null. */\n public static isNull(data: LowAndHighXYZ): boolean {\n return data.high.x < data.low.x\n || data.high.y < data.low.y\n || data.high.z < data.low.z;\n }\n /** Test of the range contains a single point. */\n public get isSinglePoint(): boolean {\n return this.high.x === this.low.x\n && this.high.y === this.low.y\n && this.high.z === this.low.z;\n }\n /** Return the midpoint of the diagonal. No test for null range. */\n public get center(): Point3d {\n return this.low.interpolate(.5, this.high);\n }\n /** Return the low x coordinate */\n public get xLow(): number {\n return this.low.x;\n }\n /** Return the low y coordinate */\n public get yLow(): number {\n return this.low.y;\n }\n /** Return the low z coordinate */\n public get zLow(): number {\n return this.low.z;\n }\n /** Return the high x coordinate */\n public get xHigh(): number {\n return this.high.x;\n }\n /** Return the high y coordinate */\n public get yHigh(): number {\n return this.high.y;\n }\n /** Return the high z coordinate */\n public get zHigh(): number {\n return this.high.z;\n }\n /** Return the length of the box in the x direction */\n public xLength(): number {\n const a = this.high.x - this.low.x; return a > 0.0 ? a : 0.0;\n }\n /** Return the length of the box in the y direction */\n public yLength(): number {\n const a = this.high.y - this.low.y; return a > 0.0 ? a : 0.0;\n }\n /** Return the length of the box in the z direction */\n public zLength(): number {\n const a = this.high.z - this.low.z; return a > 0.0 ? a : 0.0;\n }\n /** Return the largest of the x,y, z lengths of the range. */\n public maxLength(): number {\n return Math.max(this.xLength(), this.yLength(), this.zLength());\n }\n /**\n * Return the diagonal vector. There is no check for isNull -- if the range isNull(), the vector will have very\n * large negative coordinates.\n */\n public diagonal(result?: Vector3d): Vector3d {\n return this.low.vectorTo(this.high, result);\n }\n /**\n * Return the diagonal vector. There is no check for isNull -- if the range isNull(), the vector will have very\n * large negative coordinates.\n */\n public diagonalFractionToPoint(fraction: number, result?: Point3d): Point3d {\n return this.low.interpolate(fraction, this.high, result);\n }\n /** Return a point given by fractional positions on the XYZ axes. This is done with no check for isNull !!! */\n public fractionToPoint(fractionX: number, fractionY: number, fractionZ: number = 0, result?: Point3d): Point3d {\n return this.low.interpolateXYZ(fractionX, fractionY, fractionZ, this.high, result);\n }\n /**\n * Return a point given by fractional positions on the XYZ axes.\n * Returns undefined if the range is null.\n */\n public localXYZToWorld(\n fractionX: number, fractionY: number, fractionZ: number, result?: Point3d,\n ): Point3d | undefined {\n if (this.isNull) return undefined;\n return this.low.interpolateXYZ(fractionX, fractionY, fractionZ, this.high, result);\n }\n /**\n * Return a point given by fractional positions on the XYZ axes.\n * * Returns undefined if the range is null.\n */\n public localToWorld(xyz: XYAndZ, result?: Point3d): Point3d | undefined {\n return this.localXYZToWorld(xyz.x, xyz.y, xyz.z, result);\n }\n /**\n * Replace fractional coordinates by world coordinates.\n * @returns false if null range.\n */\n public localToWorldArrayInPlace(points: Point3d[]): boolean {\n if (this.isNull) return false;\n for (const p of points)\n this.low.interpolateXYZ(p.x, p.y, p.z, this.high, p);\n return false;\n }\n /**\n * Return fractional coordinates of point within the range.\n * * returns undefined if the range is null.\n * * returns undefined if any direction (x,y,z) has zero length\n */\n public worldToLocal(point: XYAndZ, result?: Point3d): Point3d | undefined {\n const ax = RangeBase.npcScaleFactor(this.low.x, this.high.x);\n const ay = RangeBase.npcScaleFactor(this.low.y, this.high.y);\n const az = RangeBase.npcScaleFactor(this.low.z, this.high.z);\n if (ax === 0.0 || ay === 0.0 || az === 0.0)\n return undefined;\n return Point3d.create(\n (point.x - this.low.x) * ax,\n (point.y - this.low.y) * ay,\n (point.z - this.low.z) * az,\n result,\n );\n }\n /**\n * Return fractional coordinates of point within the range.\n * * returns undefined if the range is null.\n * * returns undefined if any direction (x,y,z) has zero length\n */\n public worldToLocalArrayInPlace(point: Point3d[]): boolean {\n const ax = RangeBase.npcScaleFactor(this.low.x, this.high.x);\n const ay = RangeBase.npcScaleFactor(this.low.y, this.high.y);\n const az = RangeBase.npcScaleFactor(this.low.z, this.high.z);\n if (ax === 0.0 || ay === 0.0 || az === 0.0)\n return false;\n for (const p of point)\n Point3d.create((p.x - this.low.x) * ax, (p.y - this.low.y) * ay, (p.z - this.low.z) * az, p);\n return true;\n }\n /**\n * Return an array with the 8 corners on order wth \"x varies fastest, then y, then z\"\n * * points preallocated in `result` are reused if result.length >= 8.\n * * in reuse case, result.length is trimmed to 8\n */\n public corners(result?: Point3d[]): Point3d[] {\n if (result !== undefined && result.length >= 8) {\n result[0].set(this.low.x, this.low.y, this.low.z);\n result[1].set(this.high.x, this.low.y, this.low.z);\n result[2].set(this.low.x, this.high.y, this.low.z);\n result[3].set(this.high.x, this.high.y, this.low.z);\n result[4].set(this.low.x, this.low.y, this.high.z);\n result[5].set(this.high.x, this.low.y, this.high.z);\n result[6].set(this.low.x, this.high.y, this.high.z);\n result[7].set(this.high.x, this.high.y, this.high.z);\n result.length = 8;\n return result;\n }\n return [\n Point3d.create(this.low.x, this.low.y, this.low.z),\n Point3d.create(this.high.x, this.low.y, this.low.z),\n Point3d.create(this.low.x, this.high.y, this.low.z),\n Point3d.create(this.high.x, this.high.y, this.low.z),\n Point3d.create(this.low.x, this.low.y, this.high.z),\n Point3d.create(this.high.x, this.low.y, this.high.z),\n Point3d.create(this.low.x, this.high.y, this.high.z),\n Point3d.create(this.high.x, this.high.y, this.high.z),\n ];\n }\n /**\n * Return an array with indices of the corners of a face\n * * face 0 has negative x normal\n * * face 1 has positive x normal\n * * face 2 has negative y normal\n * * face 3 has positive y normal\n * * face 4 has negative z normal\n * * face 5 has positive z normal\n * * Any other value returns face 5\n * * faces are CCW as viewed from outside.\n */\n public static faceCornerIndices(index: number): number[] {\n if (index === 0)\n return [0, 4, 6, 2];\n if (index === 1)\n return [1, 3, 7, 5];\n if (index === 2)\n return [0, 1, 5, 4];\n if (index === 3)\n return [3, 2, 6, 7];\n if (index === 4)\n return [0, 2, 3, 1];\n return [4, 5, 7, 6];\n }\n /**\n * Return a rectangle that is the cross section as viewed from above (z direction) and at zFraction\n * @param zFraction plane altitude within the 0..1 z fraction range\n * @param upwardNormal true for CCW as viewed from above\n * @param addClosure true to add closure edge back to the start\n * @returns rectangle points\n */\n public rectangleXY(\n zFraction: number = 0.0, upwardNormal: boolean = true, addClosure: boolean = true,\n ): Point3d[] | undefined {\n if (this.isNull)\n return undefined;\n const points: Point3d[] = [\n this.fractionToPoint(0, 0, zFraction),\n this.fractionToPoint(1, 0, zFraction),\n this.fractionToPoint(1, 1, zFraction),\n this.fractionToPoint(0, 1, zFraction),\n ];\n if (addClosure)\n points.push(points[0].clone());\n\n if (!upwardNormal)\n points.reverse();\n return points;\n }\n /** Return the largest absolute value among any coordinates in the box corners. */\n public maxAbs(): number {\n if (this.isNull)\n return 0.0;\n return Math.max(this.low.maxAbs(), this.high.maxAbs());\n }\n /** Returns true if the x direction size is nearly zero */\n public get isAlmostZeroX(): boolean {\n return Geometry.isSmallMetricDistance(this.xLength());\n }\n /** Returns true if the y direction size is nearly zero */\n public get isAlmostZeroY(): boolean {\n return Geometry.isSmallMetricDistance(this.yLength());\n }\n /** Returns true if the z direction size is nearly zero */\n public get isAlmostZeroZ(): boolean {\n return Geometry.isSmallMetricDistance(this.zLength());\n }\n /** Test if a point given as x,y,z is within the range. */\n public containsXYZ(x: number, y: number, z: number): boolean {\n return x >= this.low.x\n && y >= this.low.y\n && z >= this.low.z\n && x <= this.high.x\n && y <= this.high.y\n && z <= this.high.z;\n }\n /** Test if a point given as x,y is within the range (ignoring z of range). */\n public containsXY(x: number, y: number): boolean {\n return x >= this.low.x\n && y >= this.low.y\n && x <= this.high.x\n && y <= this.high.y;\n }\n /** Test if a point is within the range. */\n public containsPoint(point: XYAndZ): boolean {\n return this.containsXYZ(point.x, point.y, point.z);\n }\n /** Test if the x,y coordinates of a point are within the range. */\n public containsPointXY(point: XYAndZ): boolean {\n return point.x >= this.low.x\n && point.y >= this.low.y\n && point.x <= this.high.x\n && point.y <= this.high.y;\n }\n /** Test of other range is within this range */\n public containsRange(other: Range3d): boolean {\n return other.low.x >= this.low.x\n && other.low.y >= this.low.y\n && other.low.z >= this.low.z\n && other.high.x <= this.high.x\n && other.high.y <= this.high.y\n && other.high.z <= this.high.z;\n }\n /**\n * Test if there is any intersection with the other range.\n * @param other the other range.\n * @param margin optional signed distance by which to expand/shrink `other` in all directions.\n */\n public intersectsRange(other: Range3d, margin?: number): boolean {\n if (margin) {\n return !(\n this.low.x > other.high.x + margin\n || this.low.y > other.high.y + margin\n || this.low.z > other.high.z + margin\n || other.low.x > this.high.x + margin\n || other.low.y > this.high.y + margin\n || other.low.z > this.high.z + margin\n );\n }\n return !(\n this.low.x > other.high.x\n || this.low.y > other.high.y\n || this.low.z > other.high.z\n || other.low.x > this.high.x\n || other.low.y > this.high.y\n || other.low.z > this.high.z\n );\n }\n /**\n * Test if there is any intersection with the other range, ignoring z.\n * @param other the other range.\n * @param margin optional signed distance by which to expand/shrink `other` in all xy-directions.\n */\n public intersectsRangeXY(other: Range3d, margin?: number): boolean {\n if (margin) {\n return !(\n this.low.x > other.high.x + margin\n || this.low.y > other.high.y + margin\n || other.low.x > this.high.x + margin\n || other.low.y > this.high.y + margin\n );\n }\n return !(\n this.low.x > other.high.x\n || this.low.y > other.high.y\n || other.low.x > this.high.x\n || other.low.y > this.high.y\n );\n }\n /** Return 0 if the point is within the range, otherwise the distance to the closest face or corner. */\n public distanceToPoint(point: XYAndZ): number {\n if (this.isNull)\n return RangeBase._EXTREME_POSITIVE;\n return Math.min(\n Geometry.hypotenuseXYZ(\n RangeBase.coordinateToRangeAbsoluteDistance(point.x, this.low.x, this.high.x),\n RangeBase.coordinateToRangeAbsoluteDistance(point.y, this.low.y, this.high.y),\n RangeBase.coordinateToRangeAbsoluteDistance(point.z, this.low.z, this.high.z),\n ),\n RangeBase._EXTREME_POSITIVE,\n );\n }\n /** Return 0 if the point's xy-coordinates are within the range, otherwise the xy-distance to the closest face or corner. */\n public distanceToPointXY(point: XAndY): number {\n if (this.isNull)\n return RangeBase._EXTREME_POSITIVE;\n return Math.min(\n Geometry.hypotenuseXY(\n RangeBase.coordinateToRangeAbsoluteDistance(point.x, this.low.x, this.high.x),\n RangeBase.coordinateToRangeAbsoluteDistance(point.y, this.low.y, this.high.y),\n ),\n RangeBase._EXTREME_POSITIVE,\n );\n }\n /** Returns 0 if the ranges have any overlap, otherwise the shortest absolute distance from one to the other. */\n public distanceToRange(other: Range3d): number {\n return Math.min(\n Geometry.hypotenuseXYZ(\n RangeBase.rangeToRangeAbsoluteDistance(this.low.x, this.high.x, other.low.x, other.high.x),\n RangeBase.rangeToRangeAbsoluteDistance(this.low.y, this.high.y, other.low.y, other.high.y),\n RangeBase.rangeToRangeAbsoluteDistance(this.low.z, this.high.z, other.low.z, other.high.z),\n ),\n RangeBase._EXTREME_POSITIVE,\n );\n }\n /** Returns 0 if the ranges have any xy-overlap, otherwise the shortest absolute xy-distance from one to the other. */\n public distanceToRangeXY(other: Range3d): number {\n return Math.min(\n Geometry.hypotenuseXY(\n RangeBase.rangeToRangeAbsoluteDistance(this.low.x, this.high.x, other.low.x, other.high.x),\n RangeBase.rangeToRangeAbsoluteDistance(this.low.y, this.high.y, other.low.y, other.high.y),\n ),\n RangeBase._EXTREME_POSITIVE,\n );\n }\n /** Expand this range to include the given point. */\n public extendXYZ(x: number, y: number, z: number): void {\n if (x < this.low.x)\n this.low.x = x;\n if (x > this.high.x)\n this.high.x = x;\n\n if (y < this.low.y)\n this.low.y = y;\n if (y > this.high.y)\n this.high.y = y;\n\n if (z < this.low.z)\n this.low.z = z;\n if (z > this.high.z)\n this.high.z = z;\n }\n /** Expand this range by a point interpolated between given points. */\n public extendInterpolated(xyz0: XYAndZ, fraction: number, xyz1: XYAndZ): void {\n if (fraction < 0.5) {\n this.extendXYZ(\n xyz0.x + fraction * (xyz1.x - xyz0.x),\n xyz0.y + fraction * (xyz1.y - xyz0.y),\n xyz0.z + fraction * (xyz1.z - xyz0.z));\n } else {\n // use reversed formulas for best accuracy at fraction=1.0\n const g = 1.0 - fraction;\n this.extendXYZ(\n xyz1.x + g * (xyz0.x - xyz1.x),\n xyz1.y + g * (xyz0.y - xyz1.y),\n xyz1.z + g * (xyz0.z - xyz1.z));\n }\n }\n /** Expand this range to include the x-coordinate. */\n public extendXOnly(x: number): void {\n if (x < this.low.x)\n this.low.x = x;\n if (x > this.high.x)\n this.high.x = x;\n }\n /** Expand this range to include the y-coordinate. */\n public extendYOnly(y: number): void {\n if (y < this.low.y)\n this.low.y = y;\n if (y > this.high.y)\n this.high.y = y;\n }\n /** Expand this range to include the z-coordinate. */\n public extendZOnly(z: number): void {\n if (z < this.low.z)\n this.low.z = z;\n if (z > this.high.z)\n this.high.z = z;\n }\n /** Expand this range to include the specified coordinate `a`. */\n public extendSingleAxis(a: number, axisIndex: AxisIndex): void {\n if (axisIndex === AxisIndex.X)\n this.extendXOnly(a);\n if (axisIndex === AxisIndex.Y)\n this.extendYOnly(a);\n if (axisIndex === AxisIndex.Z)\n this.extendZOnly(a);\n }\n /** Expand this range by distances a (weighted and possibly signed) in all directions */\n public extendXYZW(x: number, y: number, z: number, w: number): void {\n if (!Geometry.isSmallMetricDistance(w))\n this.extendXYZ(x / w, y / w, z / w);\n }\n /** Expand this range to include an optionally transformed point. */\n public extendPoint(point: XYAndZ, transform?: Transform): void {\n if (transform) {\n this.extendTransformedXYZ(transform, point.x, point.y, point.z);\n } else {\n this.extendXYZ(point.x, point.y, point.z);\n }\n }\n /** Expand this range to include a transformed point. */\n public extendTransformedPoint(transform: Transform, point: XYAndZ): void {\n this.extendTransformedXYZ(transform, point.x, point.y, point.z);\n }\n /** Expand this range to include a range. */\n public extendRange(other: LowAndHighXYZ): void {\n if (!Range3d.isNull(other)) {\n this.extendXYZ(other.low.x, other.low.y, other.low.z);\n this.extendXYZ(other.high.x, other.high.y, other.high.z);\n }\n }\n /**\n * In each direction look at the difference between this range limit and that of interiorRange.\n * * If this range is larger, expand it by extrapolationFactor.\n */\n public extendWhenLarger(other: LowAndHighXYZ, extrapolationFactor: number): void {\n if (!Range3d.isNull(other) && !Range3d.isNull(this)) {\n this.high.x += RangeBase.multiplyIfPositive(this.high.x - other.high.x, extrapolationFactor);\n this.high.y += RangeBase.multiplyIfPositive(this.high.y - other.high.y, extrapolationFactor);\n this.high.z += RangeBase.multiplyIfPositive(this.high.z - other.high.z, extrapolationFactor);\n this.low.x -= RangeBase.multiplyIfPositive(other.low.x - this.low.x, extrapolationFactor);\n this.low.y -= RangeBase.multiplyIfPositive(other.low.y - this.low.y, extrapolationFactor);\n this.low.z -= RangeBase.multiplyIfPositive(other.low.z - this.low.z, extrapolationFactor);\n }\n }\n /** Return the intersection of ranges. */\n public intersect(other: Range3d, result?: Range3d): Range3d {\n if (!this.intersectsRange(other))\n return Range3d.createNull(result);\n return Range3d.createXYZXYZOrCorrectToNull(\n Math.max(this.low.x, other.low.x), Math.max(this.low.y, other.low.y), Math.max(this.low.z, other.low.z),\n Math.min(this.high.x, other.high.x), Math.min(this.high.y, other.high.y), Math.min(this.high.z, other.high.z),\n result,\n );\n }\n /** Return the union of ranges. */\n public union(other: Range3d, result?: Range3d): Range3d {\n if (this.isNull)\n return other.clone(result);\n if (other.isNull)\n return this.clone(result as this);\n // we trust null ranges have EXTREME values, so a null in either input leads to expected results.\n return Range3d.createXYZXYZOrCorrectToNull(\n Math.min(this.low.x, other.low.x), Math.min(this.low.y, other.low.y), Math.min(this.low.z, other.low.z),\n Math.max(this.high.x, other.high.x), Math.max(this.high.y, other.high.y), Math.max(this.high.z, other.high.z),\n result,\n );\n }\n /**\n * Move low and high points by scaleFactor around the center point.\n * @param scaleFactor scale factor applied to low, high distance from center.\n */\n public scaleAboutCenterInPlace(scaleFactor: number) {\n if (!this.isNull) {\n scaleFactor = Math.abs(scaleFactor);\n // do the scalar stuff to avoid making a temporary object ....\n const xMid = 0.5 * (this.low.x + this.high.x);\n const yMid = 0.5 * (this.low.y + this.high.y);\n const zMid = 0.5 * (this.low.z + this.high.z);\n this.high.x = Geometry.interpolate(xMid, scaleFactor, this.high.x);\n this.high.y = Geometry.interpolate(yMid, scaleFactor, this.high.y);\n this.high.z = Geometry.interpolate(zMid, scaleFactor, this.high.z);\n this.low.x = Geometry.interpolate(xMid, scaleFactor, this.low.x);\n this.low.y = Geometry.interpolate(yMid, scaleFactor, this.low.y);\n this.low.z = Geometry.interpolate(zMid, scaleFactor, this.low.z);\n }\n }\n /**\n * Move all limits by a fixed amount.\n * * positive delta expands the range size\n * * negative delta reduces the range size\n * * if any dimension reduces below zero size, the whole range becomes null\n * @param delta shift to apply.\n */\n public expandInPlace(delta: number): void {\n this.setDirect(\n this.low.x - delta, this.low.y - delta, this.low.z - delta,\n this.high.x + delta, this.high.y + delta, this.high.z + delta,\n true,\n );\n }\n /** Create a local to world transform from this range. */\n public getLocalToWorldTransform(result?: Transform): Transform {\n return Transform.createOriginAndMatrix(\n Point3d.create(this.low.x, this.low.y, this.low.z),\n Matrix3d.createRowValues(\n this.high.x - this.low.x, 0, 0,\n 0, this.high.y - this.low.y, 0,\n 0, 0, this.high.z - this.low.z,\n ),\n result,\n );\n }\n /**\n * Creates an NPC to world transformation to go from 000...111 to the globally aligned cube with diagonally\n * opposite corners that are the\n * min and max of this range. The diagonal component for any degenerate direction is 1.\n */\n public getNpcToWorldRangeTransform(result?: Transform): Transform {\n const transform = this.getLocalToWorldTransform(result);\n const matrix = transform.matrix;\n if (matrix.coffs[0] === 0)\n matrix.coffs[0] = 1;\n if (matrix.coffs[4] === 0)\n matrix.coffs[4] = 1;\n if (matrix.coffs[8] === 0)\n matrix.coffs[8] = 1;\n return transform;\n }\n /**\n * Ensure that the length of each dimension of this Range3d is at least a minimum size. If not, expand\n * to minimum about the center.\n * @param min The minimum length for each dimension.\n */\n public ensureMinLengths(min: number = .001): void {\n let size = (min - this.xLength()) / 2.0;\n if (size > 0) {\n this.low.x -= size;\n this.high.x += size;\n }\n size = (min - this.yLength()) / 2.0;\n if (size > 0) {\n this.low.y -= size;\n this.high.y += size;\n }\n size = (min - this.zLength()) / 2.0;\n if (size > 0) {\n this.low.z -= size;\n this.high.z += size;\n }\n }\n}\n\n/**\n * Range on a 1d axis\n * * `low` and `high` members are always non-null objects\n * * having `low > high` indicates an empty range.\n * * the range contains x values for which `low <= x <= high`\n * @public\n */\nexport class Range1d extends RangeBase {\n /** Low point coordinates. DO NOT MODIFY FROM OUTSIDE THIS CLASS */\n public low: number;\n /** High point coordinates. DO NOT MODIFY FROM OUTSIDE THIS CLASS */\n public high: number;\n /** Reset the low and high to null range state. */\n public setNull() {\n this.low = RangeBase._EXTREME_POSITIVE;\n this.high = RangeBase._EXTREME_NEGATIVE;\n }\n // internal use only -- directly set all coordinates, test only if directed.\n private setDirect(low: number, high: number, correctToNull: boolean = false) {\n this.low = low;\n this.high = high;\n if (correctToNull && low > high)\n this.setNull();\n }\n // explicit ctor - no enforcement of value relationships\n private constructor(low: number = RangeBase._EXTREME_POSITIVE, high: number = RangeBase._EXTREME_NEGATIVE) {\n super();\n this.low = low; this.high = high; // duplicates set_direct, but compiler is not convinced they are set.\n this.setDirect(low, high);\n }\n /** Returns true if this and other have equal low and high parts, or both are null ranges. */\n public isAlmostEqual(other: Readonly<Range1d>): boolean {\n return (Geometry.isSameCoordinate(this.low, other.low) && Geometry.isSameCoordinate(this.high, other.high))\n || (this.isNull && other.isNull);\n }\n /** Copy contents from other Range1d. */\n public setFrom(other: Range1d) {\n this.low = other.low;\n this.high = other.high;\n }\n /**\n * Convert from a JSON object of one of these forms:\n * * Any array of numbers: `[value,value, value]`\n * * An object with low and high as properties: `{low:lowValue, high: highValue}`\n */\n public setFromJSON(json: Range1dProps): void {\n this.setNull();\n if (Array.isArray(json)) {\n let value;\n for (value of json) {\n if (Number.isFinite(value))\n this.extendX(value);\n }\n } else if (\n json.low !== undefined && Number.isFinite(json.low) && json.high !== undefined && Number.isFinite(json.high)\n ) {\n this.extendX(json.low);\n this.extendX(json.high);\n }\n }\n /** Use `setFromJSON` to parse `json` into a new Range1d instance. */\n public static fromJSON<T extends Range1d>(json?: Range1dProps): T {\n const result = new this() as T;\n if (json)\n result.setFromJSON(json);\n return result;\n }\n /**\n * Convert to a JSON object of form\n * ```\n * [lowValue,highValue]\n * ```\n */\n public toJSON(): Range1dProps {\n if (this.isNull)\n return new Array<number>();\n else\n return [this.low, this.high];\n }\n /**\n * Return a new Range1d with contents of this.\n * @param result optional result.\n */\n public clone(result?: this): this {\n result = result ? result : new (this.constructor as any)() as this;\n result.setDirect(this.low, this.high);\n return result;\n }\n /**\n * Return a new Range1d with contents of this.\n * @param result optional result.\n */\n public static createFrom<T extends Range1d>(other: T, result?: T) {\n result = result ? result : new this() as T;\n result.setDirect(other.low, other.high);\n return result;\n }\n /**\n * Create a range with no content.\n * @param result optional result.\n */\n public static createNull<T extends Range1d>(result?: T): T {\n result = result ? result : new this() as T;\n result.setNull();\n return result;\n }\n /**\n * Create a range with `delta` added to low and high\n * * If `this` is a null range, return a null range.\n */\n public cloneTranslated(delta: number, result?: Range1d): Range1d {\n result = result ? result : this.clone();\n if (!result.isNull) {\n result.low += delta;\n result.high += delta;\n }\n return result;\n }\n /**\n * Set this range to be a single value.\n * @param x value to use as both low and high.\n */\n public setX(x: number) {\n this.low = this.high = x;\n }\n /** Create a single point box */\n public static createX<T extends Range1d>(x: number, result?: T): T {\n result = result ? result : new this() as T;\n result.setDirect(x, x);\n return result;\n }\n /**\n * Set this range to (min(x0,x1), max(x0,x1))\n * @param x0 first value\n * @param x1 second value\n */\n public setXXUnordered(x0: number, x1: number) {\n if (x0 <= x1) {\n this.low = x0; this.high = x1;\n } else {\n this.low = x1; this.high = x0;\n }\n }\n /** Check if low is 0 and high is 1 */\n public get isExact01(): boolean {\n return this.low === 0.0 && this.high === 1.0;\n }\n /**\n * Create a box from two values. Values are reversed if needed\n * @param xA first value\n * @param xB second value\n */\n public static createXX<T extends Range1d>(xA: number, xB: number, result?: T): T {\n result = result ? result : new this() as T;\n result.setDirect(\n Math.min(xA, xB),\n Math.max(xA, xB),\n );\n return result;\n }\n /**\n * Create a box from two values, but null range if the values are reversed\n * @param xA first value\n * @param xB second value\n */\n public static createXXOrCorrectToNull<T extends Range1d>(xA: number, xB: number, result?: T): T {\n if (xB < xA)\n return Range1d.createNull(result);\n\n result = result ? result : new this() as T;\n result.setDirect(\n Math.min(xA, xB),\n Math.max(xA, xB),\n );\n return result;\n }\n /**\n * Create a range containing all the values in an array.\n * @param values array of points to be contained in the range.\n * @param result optional result.\n */\n public static createArray<T extends Range1d>(values: Float64Array | number[], result?: T): T {\n result = result ? result : new this() as T;\n let x;\n for (x of values)\n result.extendX(x);\n return result;\n }\n /** Extend to include an array of values */\n public extendArray(values: Float64Array | number[]) {\n let x;\n for (x of values)\n this.extendX(x);\n }\n /**\n * Extend to include `values` at indices `beginIndex <= i < endIndex]`\n * @param values array of values\n * @param beginIndex first index to include\n * @param numValue number of values to access\n */\n public extendArraySubset(values: Float64Array | number[], beginIndex: number, numValue: number) {\n const endIndex = beginIndex + numValue;\n for (let i = beginIndex; i < endIndex; i++)\n this.extendX(values[i]);\n }\n /** Test if the box has high<low Note that a range around a single point is NOT null. */\n public get isNull(): boolean {\n return this.high < this.low;\n }\n /** Test of the range contains a single point. */\n public get isSinglePoint(): boolean {\n return this.high === this.low;\n }\n /** Return the length of the range in the x direction */\n public length(): number {\n const a = this.high - this.low;\n return a > 0.0 ? a : 0.0;\n }\n /** Return a point given by fractional positions within the range. This is done with no check for isNull !!! */\n public fractionToPoint(fraction: number): number {\n return Geometry.interpolate(this.low, fraction, this.high);\n }\n /** Return the largest absolute value among the box limits. */\n public maxAbs(): number {\n if (this.isNull)\n return 0.0;\n return Math.max(Math.abs(this.low), Math.abs(this.high));\n }\n /** Test if the x direction size is nearly zero */\n public get isAlmostZeroLength(): boolean {\n return Geometry.isSmallMetricDistance(this.length());\n }\n /** Test if a number is within the range. */\n public containsX(x: number): boolean {\n return x >= this.low && x <= this.high;\n }\n /**\n * Test if a number is in within the open range.\n * * This method differs from `containsX` by returning false if x equals either range extreme.\n */\n public containsXOpen(x: number): boolean {\n return x > this.low && x < this.high;\n }\n\n /** Test of other range is within this range */\n public containsRange(other: Range1d): boolean {\n return other.low >= this.low\n && other.high <= this.high;\n }\n /** Test if there is any intersection with other range */\n public intersectsRange(other: Range1d): boolean {\n return !(this.low > other.high || other.low > this.high);\n }\n /**\n * Intersect this range with a range defined by parameters x0 and x1\n * * For x1 > x0, that range is null, and the intersection is null.\n * * For x0 <= x1, the input is a non-null range.\n * * The intersection range replaces the contents of this.\n */\n public intersectRangeXXInPlace(x0: number, x1: number) {\n if (x1 < x0 || x1 < this.low || x0 > this.high) {\n this.setNull();\n } else {\n if (x1 < this.high)\n this.high = x1;\n if (x0 > this.low)\n this.low = x0;\n }\n }\n /** Returns 0 if the ranges have any overlap, otherwise the shortest absolute distance from one to the other. */\n public distanceToRange(other: Range1d): number {\n return RangeBase.rangeToRangeAbsoluteDistance(this.low, this.high, other.low, other.high);\n }\n /** Return 0 if the point is within the range, otherwise the (unsigned) distance to the closest face or corner */\n public distanceToX(x: number): number {\n if (this.isNull)\n return RangeBase._EXTREME_POSITIVE;\n return RangeBase.coordinateToRangeAbsoluteDistance(x, this.low, this.high);\n }\n /** Expand this range by a single coordinate */\n public extendX(x: number): void {\n if (x < this.low) this.low = x;\n if (x > this.high) this.high = x;\n }\n /** Expand this range to include a range. */\n public extendRange(other: Range1d): void {\n if (!other.isNull) {\n this.extendX(other.low);\n this.extendX(other.high);\n }\n }\n /** Extend only the low limit to x. Return true if the low limit is changed. */\n public extendLow(x: number): boolean {\n if (this.isNull || x < this.low) {\n this.low = x;\n return true;\n }\n return false;\n }\n /** Extend only the high limit to x. Return true if the high limit is changed. */\n public extendHigh(x: number): boolean {\n if (this.isNull || x > this.high) {\n this.high = x;\n return true;\n }\n return false;\n }\n /** Return the intersection of ranges. */\n public intersect(other: Range1d, result?: Range1d): Range1d {\n if (!this.intersectsRange(other))\n return Range1d.createNull(result);\n\n return Range1d.createXXOrCorrectToNull(\n Math.max(this.low, other.low),\n Math.min(this.high, other.high),\n result,\n );\n }\n /** Return the union of ranges. */\n public union(other: Range1d, result?: Range1d): Range1d {\n // we trust null ranges have EXTREME values, so a null in either input leads to expected results.\n return Range1d.createXX\n (\n Math.min(this.low, other.low),\n Math.max(this.high, other.high),\n result);\n }\n /**\n * Move low and high points by scaleFactor around the center point.\n * @param scaleFactor scale factor applied to low, high distance from center.\n */\n public scaleAboutCenterInPlace(scaleFactor: number) {\n if (!this.isNull) {\n scaleFactor = Math.abs(scaleFactor);\n // do the scalar stuff to avoid making a temporary object ....\n const xMid = 0.5 * (this.low + this.high);\n this.high = Geometry.interpolate(xMid, scaleFactor, this.high);\n this.low = Geometry.interpolate(xMid, scaleFactor, this.low);\n }\n }\n /**\n * Move all limits by a fixed amount.\n * * positive delta expands the range size\n * * negative delta reduces the range size\n * * if any dimension reduces below zero size, the whole range becomes null\n * @param delta shift to apply.\n */\n public expandInPlace(delta: number): void {\n this.setDirect(\n this.low - delta,\n this.high + delta, true);\n }\n /**\n * Clip this range to a linear half space condition.\n * * If `limitA > limitB` the limit space is empty:\n * * Make this range null.\n * * Return `false`.\n * * Otherwise for `limitA <= limitB`:\n * * Solve `a + u * fA = limitA` and `a + u * fB = limitB`.\n * * If unable to solve (i.e. u near zero), `a` alone determines whether to leave this interval unchanged or reduce to null.\n * * Form an interval from the solution `{fA, fB}`.\n * * Clip this instance to the solution interval.\n * * Return `true` if the range is non-null after the clip.\n * @param a constant of linear map\n * @param u coefficient of linear map\n * @param limitA crossing value, assumed in range relation with limitB\n * @param limitB crossing value, assumed in range relation with limitB\n */\n public clipLinearMapToInterval(a: number, u: number, limitA: number, limitB: number): boolean {\n // f = (limit - a) / u\n if (limitB < limitA || this.high < this.low)\n return false;\n const fractionA = Geometry.conditionalDivideFraction(limitA - a, u);\n const fractionB = Geometry.conditionalDivideFraction(limitB - a, u);\n // single point case\n if (fractionA === undefined || fractionB === undefined) {\n if (limitA <= a && a <= limitB)\n return true;\n this.setNull();\n return false;\n }\n if (fractionA < fractionB) {\n if (fractionA > this.low)\n this.low = fractionA;\n if (fractionB < this.high)\n this.high = fractionB;\n } else {\n if (fractionA < this.high)\n this.high = fractionA;\n if (fractionB > this.low)\n this.low = fractionB;\n }\n if (this.high < this.low) {\n this.setNull();\n return false;\n }\n return true;\n }\n}\n\n/**\n * Range box in xy plane\n * @public\n */\nexport class Range2d extends RangeBase implements LowAndHighXY {\n // low and high are always non-null objects\n // any direction of low.q > high.q is considered a null range.\n /** Low point coordinates. DO NOT MODIFY FROM OUTSIDE THIS CLASS */\n public low: Point2d;\n /** High point coordinates. DO NOT MODIFY FROM OUTSIDE THIS CLASS */\n public high: Point2d;\n /** Reset the low and high to null range state. */\n public setNull() {\n this.low.x = RangeBase._EXTREME_POSITIVE;\n this.low.y = RangeBase._EXTREME_POSITIVE;\n this.high.x = RangeBase._EXTREME_NEGATIVE;\n this.high.y = RangeBase._EXTREME_NEGATIVE;\n }\n /** Flatten the low and high coordinates of any json object with low.x .. high.y into an array of 4 doubles */\n public static toFloat64Array(val: LowAndHighXY): Float64Array {\n return Float64Array.of(val.low.x, val.low.y, val.high.x, val.high.y);\n }\n /** Flatten the low and high coordinates of this instance into an array of 4 doubles */\n public toFloat64Array(): Float64Array {\n return Range2d.toFloat64Array(this);\n }\n /**\n * Construct a Range2d from an array of double-precision values\n * @param f64 the array, which should contain exactly 4 values in this order: lowX, lowY, highX, highY\n * @return a new Range2d object\n */\n public static fromFloat64Array<T extends Range2d>(f64: Float64Array): T {\n if (f64.length !== 4)\n throw new Error(\"invalid array\");\n return new this(f64[0], f64[1], f64[2], f64[3]) as T;\n }\n /**\n * Construct a Range2d from an un-typed array. This mostly useful when interpreting ECSQL query results of\n * the 'blob' type, where you know that that result is a Range3d.\n * @param buffer untyped array\n * @return a new Range2d object\n */\n public static fromArrayBuffer<T extends Range2d>(buffer: ArrayBuffer): T {\n return this.fromFloat64Array(new Float64Array(buffer));\n }\n // explicit constructor - no enforcement of value relationships\n public constructor(\n lowX = Range2d._EXTREME_POSITIVE, lowY = Range2d._EXTREME_POSITIVE,\n highX = Range2d._EXTREME_NEGATIVE, highY = Range2d._EXTREME_NEGATIVE,\n ) {\n super();\n this.low = Point2d.create(lowX, lowY);\n this.high = Point2d.create(highX, highY);\n }\n /** Returns true if this and other have equal low and high parts, or both are null ranges. */\n public isAlmostEqual(other: Range2d): boolean {\n return (this.low.isAlmostEqual(other.low) && this.high.isAlmostEqual(other.high))\n || (this.isNull && other.isNull);\n }\n /** Copy all content from any `other` that has low and high xy data. */\n public setFrom(other: LowAndHighXY) {\n this.low.set(other.low.x, other.low.y);\n this.high.set(other.high.x, other.high.y);\n }\n /** Create a new Range2d from any `other` that has low and high xy data. */\n public static createFrom<T extends Range2d>(other: LowAndHighXY, result?: T): T {\n if (result) { result.setFrom(other); return result; }\n return this.createXYXYOrCorrectToNull(other.low.x, other.low.y, other.high.x, other.high.y, result) as T;\n }\n /** Treat any array of numbers as numbers to be inserted !!! */\n public setFromJSON(json: Range2dProps): void {\n this.setNull();\n if (Array.isArray(json)) {\n const point = Point2d.create();\n for (const value of json) {\n point.setFromJSON(value);\n this.extendPoint(point);\n }\n return;\n }\n const low = Point2d.fromJSON(json.low);\n const high = Point2d.fromJSON(json.high);\n if (!RangeBase.isExtremePoint2d(low) && !RangeBase.isExtremePoint2d(high)) {\n this.extendPoint(low);\n this.extendPoint(high);\n }\n }\n /** Freeze this instance (and its members) so it is read-only */\n public freeze(): Readonly<this> {\n this.low.freeze();\n this.high.freeze();\n return Object.freeze(this);\n }\n /** Return json array with two points as produced by `Point2d.toJSON` */\n public toJSON(): Range2dProps {\n return this.isNull ? [] : [this.low.toJSON(), this.high.toJSON()];\n }\n /** Use `setFromJSON` to parse `json` into a new Range2d instance. */\n public static fromJSON<T extends Range2d>(json?: Range2dProps): T {\n const result = new this() as T;\n if (json)\n result.setFromJSON(json);\n return result;\n }\n // internal use only -- directly set all coordinates, without tests.\n private setDirect(xA: number, yA: number, xB: number, yB: number, correctToNull: boolean) {\n this.low.x = xA;\n this.low.y = yA;\n this.high.x = xB;\n this.high.y = yB;\n if (correctToNull) {\n if (this.low.x > this.high.x || this.low.y > this.high.y)\n this.setNull();\n }\n }\n /** Return a clone of this range (or copy to optional result) */\n public clone(result?: this): this {\n result = result ? result : new (this.constructor as any)() as this;\n result.setDirect(this.low.x, this.low.y, this.high.x, this.high.y, false);\n return result;\n }\n\n /**\n * Return a copy, translated by adding `shift` components in all directions.\n * @note The translation of a null range is also a null range.\n */\n public cloneTranslated(shift: XAndY, result?: this): this {\n result = result ? result : new (this.constructor as any)() as this;\n if (!this.isNull)\n result.setDirect(\n this.low.x + shift.x, this.low.y + shift.y,\n this.high.x + shift.x, this.high.y + shift.y,\n false,\n );\n return result;\n }\n\n /** Create a range with no content. */\n public static createNull<T extends Range2d>(result?: T): T {\n result = result ? result : new this() as T;\n result.setNull();\n return result;\n }\n /** Set low and hight to a single xy value. */\n public setXY(x: number, y: number) {\n this.low.x = this.high.x = x;\n this.low.y = this.high.y = y;\n }\n /** Create a single point box */\n public static createXY<T extends Range2d>(x: number, y: number, result?: T): T {\n result = result ? result : new this() as T;\n result.setDirect(x, y, x, y, false);\n return result;\n }\n /** Create a box with 2 pairs of xy candidates. Theses are compared and shuffled as needed for the box. */\n public static createXYXY<T extends Range2d>(xA: number, yA: number, xB: number, yB: number, result?: T): T {\n result = result ? result : new this() as T;\n result.setDirect(\n Math.min(xA, xB), Math.min(yA, yB),\n Math.max(xA, xB), Math.max(yA, yB), false);\n return result;\n }\n /** Create a box with 3 pairs of xy candidates. Theses are compared and shuffled as needed for the box. */\n public static createXYXYXY<T extends Range2d>(\n xA: number, yA: number, xB: number, yB: number, xC: number, yC: number, result?: T,\n ): T {\n result = result ? result : new this() as T;\n result.setDirect(\n Math.min(xA, xB, xC), Math.min(yA, yB, yC),\n Math.max(xA, xB, xC), Math.max(yA, yB, yC),\n false,\n );\n return result;\n }\n /** Create a box with 2 pairs of xy candidates. If any direction has order flip, create null. */\n public static createXYXYOrCorrectToNull<T extends Range2d>(\n xA: number, yA: number, xB: number, yB: number, result?: T,\n ): T {\n if (xA > xB || yA > yB)\n return this.createNull(result);\n result = result ? result : new this() as T;\n result.setDirect(\n Math.min(xA, xB), Math.min(yA, yB),\n Math.max(xA, xB), Math.max(yA, yB),\n true,\n );\n return result;\n }\n /** Create a range around an array of points. */\n public static createArray<T extends Range2d>(points: XAndY[], result?: T): T {\n result = result ? result : new this() as T;\n let point;\n for (point of points)\n result.extendPoint(point);\n return result;\n }\n /** Test if the box has high<low for any of x,y, condition. Note that a range around a single point is NOT null. */\n public get isNull(): boolean {\n return this.high.x < this.low.x\n || this.high.y < this.low.y;\n }\n /**\n * Test if the box has high strictly less than low for any of x,y, condition. Note that a range around a\n * single point is NOT null.\n */\n public static isNull(range: LowAndHighXY): boolean {\n return range.high.x < range.low.x\n || range.high.y < range.low.y;\n }\n /** Test of the range contains a single point. */\n public get isSinglePoint(): boolean {\n return this.high.x === this.low.x\n && this.high.y === this.low.y;\n }\n /** Return the midpoint of the diagonal. No test for null range. */\n public get center(): Point2d {\n return this.low.interpolate(.5, this.high);\n }\n /** Return the low x coordinate */\n public get xLow(): number {\n return this.low.x;\n }\n /** Return the low y coordinate */\n public get yLow(): number {\n return this.low.y;\n }\n /** Return the high x coordinate */\n public get xHigh(): number {\n return this.high.x;\n }\n /** Return the high y coordinate */\n public get yHigh(): number {\n return this.high.y;\n }\n /** Length of the box in the x direction */\n public xLength(): number {\n const a = this.high.x - this.low.x;\n return a > 0.0 ? a : 0.0;\n }\n /** Length of the box in the y direction */\n public yLength(): number {\n const a = this.high.y - this.low.y;\n return a > 0.0 ? a : 0.0;\n }\n /**\n * Return the diagonal vector. There is no check for isNull -- if the range isNull(), the vector will have very\n * large negative coordinates.\n */\n public diagonal(result?: Vector2d): Vector2d {\n return this.low.vectorTo(this.high, result);\n }\n /**\n * Return the point at the specified fraction along the diagonal vector. There is no check for isNull -- if the\n * range isNull(), the vector will have very large negative coordinates.\n */\n public diagonalFractionToPoint(fraction: number, result?: Point2d): Point2d {\n return this.low.interpolate(fraction, this.high, result);\n }\n /** Return a point given by fractional positions on the XY axes. This is done with no check for isNull !!! */\n public fractionToPoint(fractionX: number, fractionY: number, result?: Point2d): Point2d {\n return this.low.interpolateXY(fractionX, fractionY, this.high, result);\n }\n /**\n * Return an array with the 4 corners.\n * * if asLoop is false, 4 corners are \"x varies fastest, then y\"\n * * if asLoop is true, 5 corners are in CCW order WITH CLOSURE\n */\n public corners3d(asLoop: boolean = false, z: number = 0): Point3d[] {\n if (asLoop)\n return [\n Point3d.create(this.low.x, this.low.y, z),\n Point3d.create(this.high.x, this.low.y, z),\n Point3d.create(this.high.x, this.high.y, z),\n Point3d.create(this.low.x, this.high.y, z),\n Point3d.create(this.low.x, this.low.y, z),\n ];\n return [\n Point3d.create(this.low.x, this.low.y, z),\n Point3d.create(this.high.x, this.low.y, z),\n Point3d.create(this.low.x, this.high.y, z),\n Point3d.create(this.high.x, this.high.y, z),\n ];\n }\n /** Largest absolute value among any coordinates in the box corners. */\n public maxAbs(): number {\n if (this.isNull)\n return 0.0;\n return Math.max(this.low.maxAbs(), this.high.maxAbs());\n }\n /** Test if the x direction size is nearly zero */\n public get isAlmostZeroX(): boolean {\n return Geometry.isSmallMetricDistance(this.xLength());\n }\n /** Test if the y direction size is nearly zero */\n public get isAlmostZeroY(): boolean {\n return Geometry.isSmallMetricDistance(this.yLength());\n }\n /** Test if a point given as x,y is within the range */\n public containsXY(x: number, y: number): boolean {\n return x >= this.low.x\n && y >= this.low.y\n && x <= this.high.x\n && y <= this.high.y;\n }\n /** Test if a point is within the range. */\n public containsPoint(point: XAndY): boolean {\n return this.containsXY(point.x, point.y);\n }\n /** Test of other range is within this range */\n public containsRange(other: LowAndHighXY): boolean {\n return other.low.x >= this.low.x\n && other.low.y >= this.low.y\n && other.high.x <= this.high.x\n && other.high.y <= this.high.y;\n }\n /** Test if there is any intersection with other range */\n public intersectsRange(other: LowAndHighXY): boolean {\n return !(\n this.low.x > other.high.x\n || this.low.y > other.high.y\n || other.low.x > this.high.x\n || other.low.y > this.high.y\n );\n }\n /** Return 0 if the point is within the range, otherwise the distance to the closest face or corner */\n public distanceToPoint(point: XAndY): number {\n if (this.isNull)\n return Range2d._EXTREME_POSITIVE;\n return Math.min(\n Geometry.hypotenuseXY(\n RangeBase.coordinateToRangeAbsoluteDistance(point.x, this.low.x, this.high.x),\n RangeBase.coordinateToRangeAbsoluteDistance(point.y, this.low.y, this.high.y),\n ),\n Range2d._EXTREME_POSITIVE,\n );\n }\n /** Return 0 if the point is within the range, otherwise the distance to the closest face or corner */\n public distanceToRange(other: LowAndHighXY): number {\n return Math.min(\n Geometry.hypotenuseXY(\n RangeBase.rangeToRangeAbsoluteDistance(this.low.x, this.high.x, other.low.x, other.high.x),\n RangeBase.rangeToRangeAbsoluteDistance(this.low.y, this.high.y, other.low.y, other.high.y),\n ),\n Range2d._EXTREME_POSITIVE,\n );\n }\n /** Expand this range to include a point given by x,y */\n public extendXY(x: number, y: number): void {\n if (x < this.low.x)\n this.low.x = x;\n if (x > this.high.x)\n this.high.x = x;\n if (y < this.low.y)\n this.low.y = y;\n if (y > this.high.y)\n this.high.y = y;\n }\n /** Expand this range to include a point given by x,y */\n public extendTransformedXY(transform: Transform, x: number, y: number): void {\n const x1 = transform.multiplyComponentXYZ(0, x, y, 0);\n const y1 = transform.multiplyComponentXYZ(1, x, y, 0);\n this.extendXY(x1, y1);\n }\n /** Expand this range to include a point. */\n public extendPoint(point: XAndY): void {\n this.extendXY(point.x, point.y);\n }\n /** Expand this range to include a range. */\n public extendRange(other: LowAndHighXY): void {\n if (!Range2d.isNull(other)) {\n this.extendXY(other.low.x, other.low.y);\n this.extendXY(other.high.x, other.high.y);\n }\n }\n /** Return the intersection of ranges. */\n public intersect(other: LowAndHighXY, result?: Range2d): Range2d {\n if (!this.intersectsRange(other))\n return Range2d.createNull(result);\n return Range2d.createXYXY(\n Math.max(this.low.x, other.low.x), Math.max(this.low.y, other.low.y),\n Math.min(this.high.x, other.high.x), Math.min(this.high.y, other.high.y),\n result,\n );\n }\n /** Return the union of ranges. */\n public union(other: LowAndHighXY, result?: Range2d): Range2d {\n if (this.isNull)\n return Range2d.createFrom(other, result);\n if (Range2d.isNull(other))\n return this.clone(result as this);\n // we trust null ranges have EXTREME values, so a null in either input leads to expected results.\n return Range2d.createXYXY(\n Math.min(this.low.x, other.low.x), Math.min(this.low.y, other.low.y),\n Math.max(this.high.x, other.high.x), Math.max(this.high.y, other.high.y),\n result,\n );\n }\n /**\n * Move low and high points by scaleFactor around the center point.\n * @param scaleFactor scale factor applied to low, high distance from center.\n */\n public scaleAboutCenterInPlace(scaleFactor: number) {\n if (!this.isNull) {\n scaleFactor = Math.abs(scaleFactor);\n // do the scalar stuff to avoid making a temporary object ....\n const xMid = 0.5 * (this.low.x + this.high.x);\n const yMid = 0.5 * (this.low.y + this.high.y);\n this.high.x = Geometry.interpolate(xMid, scaleFactor, this.high.x);\n this.high.y = Geometry.interpolate(yMid, scaleFactor, this.high.y);\n this.low.x = Geometry.interpolate(xMid, scaleFactor, this.low.x);\n this.low.y = Geometry.interpolate(yMid, scaleFactor, this.low.y);\n }\n }\n /**\n * Move all limits by a fixed amount.\n * * positive delta expands the range size\n * * negative delta reduces the range size\n * * if any dimension reduces below zero size, the whole range becomes null\n * @param delta shift to apply.\n */\n public expandInPlace(delta: number): void {\n this.setDirect(\n this.low.x - delta, this.low.y - delta,\n this.high.x + delta, this.high.y + delta,\n true,\n );\n }\n /**\n * Return fractional coordinates of point within the range.\n * * returns undefined if the range is null.\n * * returns undefined if any direction (x,y) has zero length\n */\n public worldToLocal(point: XAndY, result?: Point2d): Point2d | undefined {\n const ax = RangeBase.npcScaleFactor(this.low.x, this.high.x);\n const ay = RangeBase.npcScaleFactor(this.low.y, this.high.y);\n if (ax === 0.0 || ay === 0.0)\n return undefined;\n return Point2d.create((point.x - this.low.x) * ax, (point.y - this.low.y) * ay, result);\n }\n}\n"]}
|