@itwin/core-geometry 4.1.0-dev.4 → 4.1.0-dev.40
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 +32 -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.d.ts +1 -0
- package/lib/cjs/core-geometry.d.ts.map +1 -1
- package/lib/cjs/core-geometry.js +4 -1
- package/lib/cjs/core-geometry.js.map +1 -1
- package/lib/cjs/curve/Arc3d.d.ts +71 -86
- package/lib/cjs/curve/Arc3d.d.ts.map +1 -1
- package/lib/cjs/curve/Arc3d.js +110 -96
- package/lib/cjs/curve/Arc3d.js.map +1 -1
- package/lib/cjs/curve/ChainCollectorContext.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/CurveChain.js.map +1 -1
- package/lib/cjs/curve/CurveChainWithDistanceIndex.d.ts +61 -41
- package/lib/cjs/curve/CurveChainWithDistanceIndex.d.ts.map +1 -1
- package/lib/cjs/curve/CurveChainWithDistanceIndex.js +69 -46
- package/lib/cjs/curve/CurveChainWithDistanceIndex.js.map +1 -1
- package/lib/cjs/curve/CurveCollection.d.ts +73 -46
- package/lib/cjs/curve/CurveCollection.d.ts.map +1 -1
- package/lib/cjs/curve/CurveCollection.js +100 -64
- package/lib/cjs/curve/CurveCollection.js.map +1 -1
- package/lib/cjs/curve/CurveCurve.d.ts.map +1 -1
- package/lib/cjs/curve/CurveCurve.js.map +1 -1
- package/lib/cjs/curve/CurveCurveCloseApproachXY.js.map +1 -1
- package/lib/cjs/curve/CurveCurveIntersectXY.js.map +1 -1
- package/lib/cjs/curve/CurveCurveIntersectXYZ.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.d.ts +45 -46
- package/lib/cjs/curve/CurveLocationDetail.d.ts.map +1 -1
- package/lib/cjs/curve/CurveLocationDetail.js +39 -41
- package/lib/cjs/curve/CurveLocationDetail.js.map +1 -1
- package/lib/cjs/curve/CurvePrimitive.d.ts +138 -92
- package/lib/cjs/curve/CurvePrimitive.d.ts.map +1 -1
- package/lib/cjs/curve/CurvePrimitive.js +115 -75
- package/lib/cjs/curve/CurvePrimitive.js.map +1 -1
- package/lib/cjs/curve/CurveProcessor.js.map +1 -1
- package/lib/cjs/curve/CurveWireMomentsXYZ.js.map +1 -1
- package/lib/cjs/curve/GeometryQuery.d.ts +26 -20
- package/lib/cjs/curve/GeometryQuery.d.ts.map +1 -1
- package/lib/cjs/curve/GeometryQuery.js +11 -9
- package/lib/cjs/curve/GeometryQuery.js.map +1 -1
- package/lib/cjs/curve/LineSegment3d.d.ts +38 -27
- package/lib/cjs/curve/LineSegment3d.d.ts.map +1 -1
- package/lib/cjs/curve/LineSegment3d.js +77 -39
- package/lib/cjs/curve/LineSegment3d.js.map +1 -1
- package/lib/cjs/curve/LineString3d.d.ts +70 -51
- package/lib/cjs/curve/LineString3d.d.ts.map +1 -1
- package/lib/cjs/curve/LineString3d.js +120 -71
- package/lib/cjs/curve/LineString3d.js.map +1 -1
- package/lib/cjs/curve/Loop.d.ts +7 -5
- package/lib/cjs/curve/Loop.d.ts.map +1 -1
- package/lib/cjs/curve/Loop.js +18 -6
- package/lib/cjs/curve/Loop.js.map +1 -1
- package/lib/cjs/curve/ParityRegion.d.ts +7 -7
- package/lib/cjs/curve/ParityRegion.d.ts.map +1 -1
- package/lib/cjs/curve/ParityRegion.js +19 -11
- package/lib/cjs/curve/ParityRegion.js.map +1 -1
- package/lib/cjs/curve/Path.d.ts +6 -6
- package/lib/cjs/curve/Path.d.ts.map +1 -1
- package/lib/cjs/curve/Path.js +15 -9
- package/lib/cjs/curve/Path.js.map +1 -1
- package/lib/cjs/curve/PointString3d.js.map +1 -1
- package/lib/cjs/curve/ProxyCurve.d.ts +4 -6
- package/lib/cjs/curve/ProxyCurve.d.ts.map +1 -1
- package/lib/cjs/curve/ProxyCurve.js +7 -7
- package/lib/cjs/curve/ProxyCurve.js.map +1 -1
- package/lib/cjs/curve/Query/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.d.ts +14 -13
- package/lib/cjs/curve/Query/StrokeCountMap.d.ts.map +1 -1
- package/lib/cjs/curve/Query/StrokeCountMap.js +9 -8
- package/lib/cjs/curve/Query/StrokeCountMap.js.map +1 -1
- package/lib/cjs/curve/RegionMomentsXY.js.map +1 -1
- package/lib/cjs/curve/RegionOps.d.ts +69 -47
- package/lib/cjs/curve/RegionOps.d.ts.map +1 -1
- package/lib/cjs/curve/RegionOps.js +70 -47
- package/lib/cjs/curve/RegionOps.js.map +1 -1
- package/lib/cjs/curve/RegionOpsClassificationSweeps.js.map +1 -1
- package/lib/cjs/curve/StrokeOptions.d.ts +29 -21
- package/lib/cjs/curve/StrokeOptions.d.ts.map +1 -1
- package/lib/cjs/curve/StrokeOptions.js +50 -24
- package/lib/cjs/curve/StrokeOptions.js.map +1 -1
- package/lib/cjs/curve/UnionRegion.d.ts +6 -5
- package/lib/cjs/curve/UnionRegion.d.ts.map +1 -1
- package/lib/cjs/curve/UnionRegion.js +17 -8
- package/lib/cjs/curve/UnionRegion.js.map +1 -1
- package/lib/cjs/curve/internalContexts/AppendPlaneIntersectionStrokeHandler.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/CurveLengthContext.js.map +1 -1
- package/lib/cjs/curve/internalContexts/CurveOffsetXYHandler.js.map +1 -1
- package/lib/cjs/curve/internalContexts/GapSearchContext.d.ts +2 -1
- package/lib/cjs/curve/internalContexts/GapSearchContext.d.ts.map +1 -1
- package/lib/cjs/curve/internalContexts/GapSearchContext.js +6 -2
- package/lib/cjs/curve/internalContexts/GapSearchContext.js.map +1 -1
- package/lib/cjs/curve/internalContexts/MultiChainCollector.d.ts +4 -0
- package/lib/cjs/curve/internalContexts/MultiChainCollector.d.ts.map +1 -1
- package/lib/cjs/curve/internalContexts/MultiChainCollector.js +5 -2
- 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.d.ts +14 -8
- package/lib/cjs/curve/internalContexts/PlaneAltitudeRangeContext.d.ts.map +1 -1
- package/lib/cjs/curve/internalContexts/PlaneAltitudeRangeContext.js +14 -8
- package/lib/cjs/curve/internalContexts/PlaneAltitudeRangeContext.js.map +1 -1
- package/lib/cjs/curve/internalContexts/PolygonOffsetContext.d.ts +56 -34
- package/lib/cjs/curve/internalContexts/PolygonOffsetContext.d.ts.map +1 -1
- package/lib/cjs/curve/internalContexts/PolygonOffsetContext.js +152 -87
- package/lib/cjs/curve/internalContexts/PolygonOffsetContext.js.map +1 -1
- package/lib/cjs/curve/internalContexts/SumLengthsContext.d.ts.map +1 -1
- package/lib/cjs/curve/internalContexts/SumLengthsContext.js +4 -1
- package/lib/cjs/curve/internalContexts/SumLengthsContext.js.map +1 -1
- package/lib/cjs/curve/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.d.ts +2 -2
- package/lib/cjs/geometry3d/Matrix3d.js +2 -2
- 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.d.ts +36 -32
- package/lib/cjs/geometry3d/Plane3dByOriginAndVectors.d.ts.map +1 -1
- package/lib/cjs/geometry3d/Plane3dByOriginAndVectors.js +35 -32
- 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.d.ts +133 -93
- package/lib/cjs/geometry3d/Range.d.ts.map +1 -1
- package/lib/cjs/geometry3d/Range.js +296 -144
- package/lib/cjs/geometry3d/Range.js.map +1 -1
- package/lib/cjs/geometry3d/Ray3d.d.ts.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/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/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/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/solid/Box.js.map +1 -1
- package/lib/cjs/solid/Cone.js.map +1 -1
- package/lib/cjs/solid/LinearSweep.js.map +1 -1
- package/lib/cjs/solid/RotationalSweep.js.map +1 -1
- package/lib/cjs/solid/RuledSweep.js.map +1 -1
- package/lib/cjs/solid/SolidPrimitive.js.map +1 -1
- package/lib/cjs/solid/Sphere.js.map +1 -1
- package/lib/cjs/solid/SweepContour.js.map +1 -1
- package/lib/cjs/solid/TorusPipe.js.map +1 -1
- package/lib/cjs/topology/ChainMerge.js.map +1 -1
- package/lib/cjs/topology/Graph.js.map +1 -1
- package/lib/cjs/topology/HalfEdgeGraphFromIndexedLoopsContext.js.map +1 -1
- package/lib/cjs/topology/HalfEdgeGraphSearch.js.map +1 -1
- package/lib/cjs/topology/HalfEdgeGraphSpineContext.js.map +1 -1
- package/lib/cjs/topology/HalfEdgeGraphValidation.js.map +1 -1
- package/lib/cjs/topology/HalfEdgeMarkSet.js.map +1 -1
- package/lib/cjs/topology/HalfEdgeNodeXYZUV.js.map +1 -1
- package/lib/cjs/topology/HalfEdgePointInGraphSearch.js.map +1 -1
- package/lib/cjs/topology/HalfEdgePositionDetail.js.map +1 -1
- package/lib/cjs/topology/HalfEdgePriorityQueue.js.map +1 -1
- package/lib/cjs/topology/InsertAndRetriangulateContext.js.map +1 -1
- package/lib/cjs/topology/MaskManager.js.map +1 -1
- package/lib/cjs/topology/Merging.js.map +1 -1
- package/lib/cjs/topology/RegularizeFace.js.map +1 -1
- package/lib/cjs/topology/SignedDataSummary.js.map +1 -1
- package/lib/cjs/topology/SpaceTriangulation.js.map +1 -1
- package/lib/cjs/topology/Triangulation.js.map +1 -1
- package/lib/cjs/topology/XYParitySearchContext.js.map +1 -1
- package/lib/esm/Constant.js.map +1 -1
- package/lib/esm/Geometry.js.map +1 -1
- package/lib/esm/bspline/AkimaCurve3d.js.map +1 -1
- package/lib/esm/bspline/BSpline1dNd.js.map +1 -1
- package/lib/esm/bspline/BSplineCurve.js.map +1 -1
- package/lib/esm/bspline/BSplineCurve3dH.js.map +1 -1
- package/lib/esm/bspline/BSplineCurveOps.js.map +1 -1
- package/lib/esm/bspline/BSplineSurface.js.map +1 -1
- package/lib/esm/bspline/Bezier1dNd.js.map +1 -1
- package/lib/esm/bspline/BezierCurve3d.js.map +1 -1
- package/lib/esm/bspline/BezierCurve3dH.js.map +1 -1
- package/lib/esm/bspline/BezierCurveBase.js.map +1 -1
- package/lib/esm/bspline/InterpolationCurve3d.js.map +1 -1
- package/lib/esm/bspline/KnotVector.js.map +1 -1
- package/lib/esm/bspline/SurfaceLocationDetail.js.map +1 -1
- package/lib/esm/clipping/AlternatingConvexClipTree.js.map +1 -1
- package/lib/esm/clipping/BooleanClipFactory.js.map +1 -1
- package/lib/esm/clipping/BooleanClipNode.js.map +1 -1
- package/lib/esm/clipping/ClipPlane.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.d.ts +1 -0
- package/lib/esm/core-geometry.d.ts.map +1 -1
- package/lib/esm/core-geometry.js +2 -0
- package/lib/esm/core-geometry.js.map +1 -1
- package/lib/esm/curve/Arc3d.d.ts +71 -86
- package/lib/esm/curve/Arc3d.d.ts.map +1 -1
- package/lib/esm/curve/Arc3d.js +110 -96
- package/lib/esm/curve/Arc3d.js.map +1 -1
- package/lib/esm/curve/ChainCollectorContext.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/CurveChain.js.map +1 -1
- package/lib/esm/curve/CurveChainWithDistanceIndex.d.ts +61 -41
- package/lib/esm/curve/CurveChainWithDistanceIndex.d.ts.map +1 -1
- package/lib/esm/curve/CurveChainWithDistanceIndex.js +69 -46
- package/lib/esm/curve/CurveChainWithDistanceIndex.js.map +1 -1
- package/lib/esm/curve/CurveCollection.d.ts +73 -46
- package/lib/esm/curve/CurveCollection.d.ts.map +1 -1
- package/lib/esm/curve/CurveCollection.js +100 -64
- package/lib/esm/curve/CurveCollection.js.map +1 -1
- package/lib/esm/curve/CurveCurve.d.ts.map +1 -1
- package/lib/esm/curve/CurveCurve.js.map +1 -1
- package/lib/esm/curve/CurveCurveCloseApproachXY.js.map +1 -1
- package/lib/esm/curve/CurveCurveIntersectXY.js.map +1 -1
- package/lib/esm/curve/CurveCurveIntersectXYZ.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.d.ts +45 -46
- package/lib/esm/curve/CurveLocationDetail.d.ts.map +1 -1
- package/lib/esm/curve/CurveLocationDetail.js +39 -41
- package/lib/esm/curve/CurveLocationDetail.js.map +1 -1
- package/lib/esm/curve/CurvePrimitive.d.ts +138 -92
- package/lib/esm/curve/CurvePrimitive.d.ts.map +1 -1
- package/lib/esm/curve/CurvePrimitive.js +115 -75
- package/lib/esm/curve/CurvePrimitive.js.map +1 -1
- package/lib/esm/curve/CurveProcessor.js.map +1 -1
- package/lib/esm/curve/CurveWireMomentsXYZ.js.map +1 -1
- package/lib/esm/curve/GeometryQuery.d.ts +26 -20
- package/lib/esm/curve/GeometryQuery.d.ts.map +1 -1
- package/lib/esm/curve/GeometryQuery.js +11 -9
- package/lib/esm/curve/GeometryQuery.js.map +1 -1
- package/lib/esm/curve/LineSegment3d.d.ts +38 -27
- package/lib/esm/curve/LineSegment3d.d.ts.map +1 -1
- package/lib/esm/curve/LineSegment3d.js +77 -39
- package/lib/esm/curve/LineSegment3d.js.map +1 -1
- package/lib/esm/curve/LineString3d.d.ts +70 -51
- package/lib/esm/curve/LineString3d.d.ts.map +1 -1
- package/lib/esm/curve/LineString3d.js +120 -71
- package/lib/esm/curve/LineString3d.js.map +1 -1
- package/lib/esm/curve/Loop.d.ts +7 -5
- package/lib/esm/curve/Loop.d.ts.map +1 -1
- package/lib/esm/curve/Loop.js +18 -6
- package/lib/esm/curve/Loop.js.map +1 -1
- package/lib/esm/curve/ParityRegion.d.ts +7 -7
- package/lib/esm/curve/ParityRegion.d.ts.map +1 -1
- package/lib/esm/curve/ParityRegion.js +19 -11
- package/lib/esm/curve/ParityRegion.js.map +1 -1
- package/lib/esm/curve/Path.d.ts +6 -6
- package/lib/esm/curve/Path.d.ts.map +1 -1
- package/lib/esm/curve/Path.js +15 -9
- package/lib/esm/curve/Path.js.map +1 -1
- package/lib/esm/curve/PointString3d.js.map +1 -1
- package/lib/esm/curve/ProxyCurve.d.ts +4 -6
- package/lib/esm/curve/ProxyCurve.d.ts.map +1 -1
- package/lib/esm/curve/ProxyCurve.js +7 -7
- package/lib/esm/curve/ProxyCurve.js.map +1 -1
- package/lib/esm/curve/Query/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.d.ts +14 -13
- package/lib/esm/curve/Query/StrokeCountMap.d.ts.map +1 -1
- package/lib/esm/curve/Query/StrokeCountMap.js +9 -8
- package/lib/esm/curve/Query/StrokeCountMap.js.map +1 -1
- package/lib/esm/curve/RegionMomentsXY.js.map +1 -1
- package/lib/esm/curve/RegionOps.d.ts +69 -47
- package/lib/esm/curve/RegionOps.d.ts.map +1 -1
- package/lib/esm/curve/RegionOps.js +70 -47
- package/lib/esm/curve/RegionOps.js.map +1 -1
- package/lib/esm/curve/RegionOpsClassificationSweeps.js.map +1 -1
- package/lib/esm/curve/StrokeOptions.d.ts +29 -21
- package/lib/esm/curve/StrokeOptions.d.ts.map +1 -1
- package/lib/esm/curve/StrokeOptions.js +50 -24
- package/lib/esm/curve/StrokeOptions.js.map +1 -1
- package/lib/esm/curve/UnionRegion.d.ts +6 -5
- package/lib/esm/curve/UnionRegion.d.ts.map +1 -1
- package/lib/esm/curve/UnionRegion.js +17 -8
- package/lib/esm/curve/UnionRegion.js.map +1 -1
- package/lib/esm/curve/internalContexts/AppendPlaneIntersectionStrokeHandler.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/CurveLengthContext.js.map +1 -1
- package/lib/esm/curve/internalContexts/CurveOffsetXYHandler.js.map +1 -1
- package/lib/esm/curve/internalContexts/GapSearchContext.d.ts +2 -1
- package/lib/esm/curve/internalContexts/GapSearchContext.d.ts.map +1 -1
- package/lib/esm/curve/internalContexts/GapSearchContext.js +6 -2
- package/lib/esm/curve/internalContexts/GapSearchContext.js.map +1 -1
- package/lib/esm/curve/internalContexts/MultiChainCollector.d.ts +4 -0
- package/lib/esm/curve/internalContexts/MultiChainCollector.d.ts.map +1 -1
- package/lib/esm/curve/internalContexts/MultiChainCollector.js +5 -2
- 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.d.ts +14 -8
- package/lib/esm/curve/internalContexts/PlaneAltitudeRangeContext.d.ts.map +1 -1
- package/lib/esm/curve/internalContexts/PlaneAltitudeRangeContext.js +14 -8
- package/lib/esm/curve/internalContexts/PlaneAltitudeRangeContext.js.map +1 -1
- package/lib/esm/curve/internalContexts/PolygonOffsetContext.d.ts +56 -34
- package/lib/esm/curve/internalContexts/PolygonOffsetContext.d.ts.map +1 -1
- package/lib/esm/curve/internalContexts/PolygonOffsetContext.js +152 -87
- package/lib/esm/curve/internalContexts/PolygonOffsetContext.js.map +1 -1
- package/lib/esm/curve/internalContexts/SumLengthsContext.d.ts.map +1 -1
- package/lib/esm/curve/internalContexts/SumLengthsContext.js +4 -1
- package/lib/esm/curve/internalContexts/SumLengthsContext.js.map +1 -1
- package/lib/esm/curve/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.d.ts +2 -2
- package/lib/esm/geometry3d/Matrix3d.js +2 -2
- 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.d.ts +36 -32
- package/lib/esm/geometry3d/Plane3dByOriginAndVectors.d.ts.map +1 -1
- package/lib/esm/geometry3d/Plane3dByOriginAndVectors.js +35 -32
- 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.d.ts +133 -93
- package/lib/esm/geometry3d/Range.d.ts.map +1 -1
- package/lib/esm/geometry3d/Range.js +296 -144
- package/lib/esm/geometry3d/Range.js.map +1 -1
- package/lib/esm/geometry3d/Ray3d.d.ts.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/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/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/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/solid/Box.js.map +1 -1
- package/lib/esm/solid/Cone.js.map +1 -1
- package/lib/esm/solid/LinearSweep.js.map +1 -1
- package/lib/esm/solid/RotationalSweep.js.map +1 -1
- package/lib/esm/solid/RuledSweep.js.map +1 -1
- package/lib/esm/solid/SolidPrimitive.js.map +1 -1
- package/lib/esm/solid/Sphere.js.map +1 -1
- package/lib/esm/solid/SweepContour.js.map +1 -1
- package/lib/esm/solid/TorusPipe.js.map +1 -1
- package/lib/esm/topology/ChainMerge.js.map +1 -1
- package/lib/esm/topology/Graph.js.map +1 -1
- package/lib/esm/topology/HalfEdgeGraphFromIndexedLoopsContext.js.map +1 -1
- package/lib/esm/topology/HalfEdgeGraphSearch.js.map +1 -1
- package/lib/esm/topology/HalfEdgeGraphSpineContext.js.map +1 -1
- package/lib/esm/topology/HalfEdgeGraphValidation.js.map +1 -1
- package/lib/esm/topology/HalfEdgeMarkSet.js.map +1 -1
- package/lib/esm/topology/HalfEdgeNodeXYZUV.js.map +1 -1
- package/lib/esm/topology/HalfEdgePointInGraphSearch.js.map +1 -1
- package/lib/esm/topology/HalfEdgePositionDetail.js.map +1 -1
- package/lib/esm/topology/HalfEdgePriorityQueue.js.map +1 -1
- package/lib/esm/topology/InsertAndRetriangulateContext.js.map +1 -1
- package/lib/esm/topology/MaskManager.js.map +1 -1
- package/lib/esm/topology/Merging.js.map +1 -1
- package/lib/esm/topology/RegularizeFace.js.map +1 -1
- package/lib/esm/topology/SignedDataSummary.js.map +1 -1
- package/lib/esm/topology/SpaceTriangulation.js.map +1 -1
- package/lib/esm/topology/Triangulation.js.map +1 -1
- package/lib/esm/topology/XYParitySearchContext.js.map +1 -1
- package/package.json +3 -3
|
@@ -22,13 +22,21 @@ const Transform_1 = require("./Transform");
|
|
|
22
22
|
*/
|
|
23
23
|
class RangeBase {
|
|
24
24
|
/** Return 0 if high<= low, otherwise `1/(high-low)` for use in fractionalizing */
|
|
25
|
-
static npcScaleFactor(low, high) {
|
|
25
|
+
static npcScaleFactor(low, high) {
|
|
26
|
+
return (high <= low) ? 0.0 : 1.0 / (high - low);
|
|
27
|
+
}
|
|
26
28
|
/** Return true if x is outside the range `[_EXTREME_NEGATIVE, _EXTREME_POSITIVE]' */
|
|
27
|
-
static isExtremeValue(x) {
|
|
29
|
+
static isExtremeValue(x) {
|
|
30
|
+
return Math.abs(x) >= RangeBase._EXTREME_POSITIVE;
|
|
31
|
+
}
|
|
28
32
|
/** Return true if any x or y or z is outside the range `[_EXTREME_NEGATIVE, _EXTREME_POSITIVE]' */
|
|
29
|
-
static isExtremePoint3d(xyz) {
|
|
33
|
+
static isExtremePoint3d(xyz) {
|
|
34
|
+
return RangeBase.isExtremeValue(xyz.x) || RangeBase.isExtremeValue(xyz.y) || RangeBase.isExtremeValue(xyz.z);
|
|
35
|
+
}
|
|
30
36
|
/** Return true if either of x,y is outside the range `[_EXTREME_NEGATIVE, _EXTREME_POSITIVE]' */
|
|
31
|
-
static isExtremePoint2d(xy) {
|
|
37
|
+
static isExtremePoint2d(xy) {
|
|
38
|
+
return RangeBase.isExtremeValue(xy.x) || RangeBase.isExtremeValue(xy.y);
|
|
39
|
+
}
|
|
32
40
|
/**
|
|
33
41
|
* Return the min absolute distance from any point of `[lowA,highA]' to any point of `[lowB,highB]'.
|
|
34
42
|
* * Both low,high pairs have order expectations: The condition `high < low` means null interval.
|
|
@@ -51,7 +59,8 @@ class RangeBase {
|
|
|
51
59
|
return 0.0;
|
|
52
60
|
return lowB - highA;
|
|
53
61
|
}
|
|
54
|
-
/**
|
|
62
|
+
/**
|
|
63
|
+
* Given a coordinate and pair of range limits, return the smallest distance to the range.
|
|
55
64
|
* * This is zero for any point inside the range
|
|
56
65
|
* * This is _EXTREME_POSITIVE if the range limits are inverted
|
|
57
66
|
* * Otherwise (i.e. x is outside a finite range) the distance to the near endpoint.
|
|
@@ -66,7 +75,7 @@ class RangeBase {
|
|
|
66
75
|
return 0.0;
|
|
67
76
|
}
|
|
68
77
|
/**
|
|
69
|
-
*
|
|
78
|
+
* If a > 0, return (extrapolationFactor * a); otherwise return defaultValue
|
|
70
79
|
* @param q
|
|
71
80
|
* @param factor multiplier for positive q values.
|
|
72
81
|
*/
|
|
@@ -97,11 +106,19 @@ class Range3d extends RangeBase {
|
|
|
97
106
|
this.high.z = RangeBase._EXTREME_NEGATIVE;
|
|
98
107
|
}
|
|
99
108
|
/** Freeze this instance (and its members) so it is read-only */
|
|
100
|
-
freeze() {
|
|
109
|
+
freeze() {
|
|
110
|
+
this.low.freeze();
|
|
111
|
+
this.high.freeze();
|
|
112
|
+
return Object.freeze(this);
|
|
113
|
+
}
|
|
101
114
|
/** Flatten the low and high coordinates of any json object with low.x .. high.z into an array of 6 doubles */
|
|
102
|
-
static toFloat64Array(val) {
|
|
115
|
+
static toFloat64Array(val) {
|
|
116
|
+
return Float64Array.of(val.low.x, val.low.y, val.low.z, val.high.x, val.high.y, val.high.z);
|
|
117
|
+
}
|
|
103
118
|
/** Flatten the low and high coordinates of this into an array of 6 doubles */
|
|
104
|
-
toFloat64Array() {
|
|
119
|
+
toFloat64Array() {
|
|
120
|
+
return Range3d.toFloat64Array(this);
|
|
121
|
+
}
|
|
105
122
|
/**
|
|
106
123
|
* Construct a Range3d from an array of double-precision values
|
|
107
124
|
* @param f64 the array, which should contain exactly 6 values in this order: lowX, lowY, lowZ, highX, highY, highZ
|
|
@@ -113,11 +130,14 @@ class Range3d extends RangeBase {
|
|
|
113
130
|
return new this(f64[0], f64[1], f64[2], f64[3], f64[4], f64[5]);
|
|
114
131
|
}
|
|
115
132
|
/**
|
|
116
|
-
* Construct a Range3d from an un-typed array. This mostly useful when interpreting ECSQL query results of
|
|
133
|
+
* Construct a Range3d from an un-typed array. This mostly useful when interpreting ECSQL query results of
|
|
134
|
+
* the 'blob' type, where you know that that result is a Range3d.
|
|
117
135
|
* @param buffer untyped array
|
|
118
136
|
* @return a new Range3d object
|
|
119
137
|
*/
|
|
120
|
-
static fromArrayBuffer(buffer) {
|
|
138
|
+
static fromArrayBuffer(buffer) {
|
|
139
|
+
return this.fromFloat64Array(new Float64Array(buffer));
|
|
140
|
+
}
|
|
121
141
|
// explicit ctor - no enforcement of value relationships
|
|
122
142
|
constructor(lowX = RangeBase._EXTREME_POSITIVE, lowY = RangeBase._EXTREME_POSITIVE, lowZ = RangeBase._EXTREME_POSITIVE, highX = RangeBase._EXTREME_NEGATIVE, highY = RangeBase._EXTREME_NEGATIVE, highZ = RangeBase._EXTREME_NEGATIVE) {
|
|
123
143
|
super();
|
|
@@ -129,8 +149,11 @@ class Range3d extends RangeBase {
|
|
|
129
149
|
return (this.low.isAlmostEqual(other.low, tol) && this.high.isAlmostEqual(other.high, tol))
|
|
130
150
|
|| (this.isNull && other.isNull);
|
|
131
151
|
}
|
|
132
|
-
/**
|
|
133
|
-
setFrom(other) {
|
|
152
|
+
/** Copy low and high values from other. */
|
|
153
|
+
setFrom(other) {
|
|
154
|
+
this.low.setFrom(other.low);
|
|
155
|
+
this.high.setFrom(other.high);
|
|
156
|
+
}
|
|
134
157
|
/** Return a new Range3d copied from a range or derived type */
|
|
135
158
|
static createFrom(other, result) {
|
|
136
159
|
if (result) {
|
|
@@ -139,7 +162,8 @@ class Range3d extends RangeBase {
|
|
|
139
162
|
}
|
|
140
163
|
return this.createXYZXYZOrCorrectToNull(other.low.x, other.low.y, other.low.z, other.high.x, other.high.y, other.high.z, result);
|
|
141
164
|
}
|
|
142
|
-
/**
|
|
165
|
+
/**
|
|
166
|
+
* Set this range (in place) from json such as
|
|
143
167
|
* * key-value pairs: `{low:[1,2,3], high:[4,5,6]}`
|
|
144
168
|
* * array of points: `[[1,2,3],[9,3,4],[-2,1,3] ...]`
|
|
145
169
|
* * Lowest level points can be `[1,2,3]` or `{x:1,y:2,z:3}`
|
|
@@ -163,10 +187,13 @@ class Range3d extends RangeBase {
|
|
|
163
187
|
this.extendPoint(high);
|
|
164
188
|
}
|
|
165
189
|
}
|
|
166
|
-
/**
|
|
190
|
+
/**
|
|
191
|
+
* Return a JSON object `{low: ... , high: ...}`
|
|
167
192
|
* with points formatted by `Point3d.toJSON()`
|
|
168
193
|
*/
|
|
169
|
-
toJSON() {
|
|
194
|
+
toJSON() {
|
|
195
|
+
return { low: this.low.toJSON(), high: this.high.toJSON() };
|
|
196
|
+
}
|
|
170
197
|
/** Use `setFromJSON` to parse `json` into a new Range3d instance. */
|
|
171
198
|
static fromJSON(json) {
|
|
172
199
|
const result = new this();
|
|
@@ -194,7 +221,8 @@ class Range3d extends RangeBase {
|
|
|
194
221
|
result.setDirect(this.low.x, this.low.y, this.low.z, this.high.x, this.high.y, this.high.z, false);
|
|
195
222
|
return result;
|
|
196
223
|
}
|
|
197
|
-
/**
|
|
224
|
+
/**
|
|
225
|
+
* Return a copy, translated by adding `shift` components in all directions.
|
|
198
226
|
* * The translate of a null range is also a null range.
|
|
199
227
|
*/
|
|
200
228
|
cloneTranslated(shift, result) {
|
|
@@ -229,7 +257,7 @@ class Range3d extends RangeBase {
|
|
|
229
257
|
PointStreaming_1.VariantPointDataStream.streamXYZ(data, collector);
|
|
230
258
|
return collector.claimResult();
|
|
231
259
|
}
|
|
232
|
-
/**
|
|
260
|
+
/** Create a Range3d enclosing the transformed points. */
|
|
233
261
|
static createTransformed(transform, ...point) {
|
|
234
262
|
const result = this.createNull();
|
|
235
263
|
let p;
|
|
@@ -237,13 +265,13 @@ class Range3d extends RangeBase {
|
|
|
237
265
|
result.extendTransformedXYZ(transform, p.x, p.y, p.z);
|
|
238
266
|
return result;
|
|
239
267
|
}
|
|
240
|
-
/**
|
|
268
|
+
/** Create a Range3d enclosing the transformed points. */
|
|
241
269
|
static createTransformedArray(transform, points) {
|
|
242
270
|
const result = this.createNull();
|
|
243
271
|
result.extendArray(points, transform);
|
|
244
272
|
return result;
|
|
245
273
|
}
|
|
246
|
-
/**
|
|
274
|
+
/** Create a Range3d enclosing the points after inverse transform. */
|
|
247
275
|
static createInverseTransformedArray(transform, points) {
|
|
248
276
|
const result = this.createNull();
|
|
249
277
|
result.extendInverseTransformedArray(points, transform);
|
|
@@ -292,7 +320,7 @@ class Range3d extends RangeBase {
|
|
|
292
320
|
result.extendPoint(point);
|
|
293
321
|
return result;
|
|
294
322
|
}
|
|
295
|
-
/**
|
|
323
|
+
/** Extend a range around an array of points (optionally transformed) */
|
|
296
324
|
extendArray(points, transform) {
|
|
297
325
|
if (Array.isArray(points))
|
|
298
326
|
if (transform)
|
|
@@ -309,7 +337,7 @@ class Range3d extends RangeBase {
|
|
|
309
337
|
for (let i = 0; i < points.length; i++)
|
|
310
338
|
this.extendXYZ(points.getXAtUncheckedPointIndex(i), points.getYAtUncheckedPointIndex(i), points.getZAtUncheckedPointIndex(i));
|
|
311
339
|
}
|
|
312
|
-
/**
|
|
340
|
+
/** Extend a range around an array of points (optionally transformed) */
|
|
313
341
|
extendInverseTransformedArray(points, transform) {
|
|
314
342
|
if (Array.isArray(points))
|
|
315
343
|
for (const point of points)
|
|
@@ -318,22 +346,19 @@ class Range3d extends RangeBase {
|
|
|
318
346
|
for (let i = 0; i < points.length; i++)
|
|
319
347
|
this.extendInverseTransformedXYZ(transform, points.getXAtUncheckedPointIndex(i), points.getYAtUncheckedPointIndex(i), points.getZAtUncheckedPointIndex(i));
|
|
320
348
|
}
|
|
321
|
-
/**
|
|
322
|
-
*/
|
|
349
|
+
/** Multiply the point x,y,z by transform and use the coordinate to extend this range. */
|
|
323
350
|
extendTransformedXYZ(transform, x, y, z) {
|
|
324
351
|
const origin = transform.origin;
|
|
325
352
|
const coffs = transform.matrix.coffs;
|
|
326
353
|
this.extendXYZ(origin.x + coffs[0] * x + coffs[1] * y + coffs[2] * z, origin.y + coffs[3] * x + coffs[4] * y + coffs[5] * z, origin.z + coffs[6] * x + coffs[7] * y + coffs[8] * z);
|
|
327
354
|
}
|
|
328
|
-
/**
|
|
329
|
-
*/
|
|
355
|
+
/** Multiply the point x,y,z,w by transform and use the coordinate to extend this range. */
|
|
330
356
|
extendTransformedXYZW(transform, x, y, z, w) {
|
|
331
357
|
const origin = transform.origin;
|
|
332
358
|
const coffs = transform.matrix.coffs;
|
|
333
359
|
this.extendXYZW(origin.x * w + coffs[0] * x + coffs[1] * y + coffs[2] * z, origin.y * w + coffs[3] * x + coffs[4] * y + coffs[5] * z, origin.z * w + coffs[6] * x + coffs[7] * y + coffs[8] * z, w);
|
|
334
360
|
}
|
|
335
|
-
/**
|
|
336
|
-
*/
|
|
361
|
+
/** Multiply the point x,y,z by the inverse of the transform and use the coordinate to extend this range. */
|
|
337
362
|
extendInverseTransformedXYZ(transform, x, y, z) {
|
|
338
363
|
const origin = transform.origin;
|
|
339
364
|
if (!transform.matrix.computeCachedInverse(true))
|
|
@@ -370,36 +395,72 @@ class Range3d extends RangeBase {
|
|
|
370
395
|
&& this.high.z === this.low.z;
|
|
371
396
|
}
|
|
372
397
|
/** Return the midpoint of the diagonal. No test for null range. */
|
|
373
|
-
get center() {
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
/**
|
|
377
|
-
get
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
/**
|
|
381
|
-
get
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
/**
|
|
385
|
-
get
|
|
398
|
+
get center() {
|
|
399
|
+
return this.low.interpolate(.5, this.high);
|
|
400
|
+
}
|
|
401
|
+
/** Return the low x coordinate */
|
|
402
|
+
get xLow() {
|
|
403
|
+
return this.low.x;
|
|
404
|
+
}
|
|
405
|
+
/** Return the low y coordinate */
|
|
406
|
+
get yLow() {
|
|
407
|
+
return this.low.y;
|
|
408
|
+
}
|
|
409
|
+
/** Return the low z coordinate */
|
|
410
|
+
get zLow() {
|
|
411
|
+
return this.low.z;
|
|
412
|
+
}
|
|
413
|
+
/** Return the high x coordinate */
|
|
414
|
+
get xHigh() {
|
|
415
|
+
return this.high.x;
|
|
416
|
+
}
|
|
417
|
+
/** Return the high y coordinate */
|
|
418
|
+
get yHigh() {
|
|
419
|
+
return this.high.y;
|
|
420
|
+
}
|
|
421
|
+
/** Return the high z coordinate */
|
|
422
|
+
get zHigh() {
|
|
423
|
+
return this.high.z;
|
|
424
|
+
}
|
|
386
425
|
/** Return the length of the box in the x direction */
|
|
387
|
-
xLength() {
|
|
426
|
+
xLength() {
|
|
427
|
+
const a = this.high.x - this.low.x;
|
|
428
|
+
return a > 0.0 ? a : 0.0;
|
|
429
|
+
}
|
|
388
430
|
/** Return the length of the box in the y direction */
|
|
389
|
-
yLength() {
|
|
431
|
+
yLength() {
|
|
432
|
+
const a = this.high.y - this.low.y;
|
|
433
|
+
return a > 0.0 ? a : 0.0;
|
|
434
|
+
}
|
|
390
435
|
/** Return the length of the box in the z direction */
|
|
391
|
-
zLength() {
|
|
436
|
+
zLength() {
|
|
437
|
+
const a = this.high.z - this.low.z;
|
|
438
|
+
return a > 0.0 ? a : 0.0;
|
|
439
|
+
}
|
|
392
440
|
/** Return the largest of the x,y, z lengths of the range. */
|
|
393
|
-
maxLength() {
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
/**
|
|
397
|
-
|
|
398
|
-
|
|
441
|
+
maxLength() {
|
|
442
|
+
return Math.max(this.xLength(), this.yLength(), this.zLength());
|
|
443
|
+
}
|
|
444
|
+
/**
|
|
445
|
+
* Return the diagonal vector. There is no check for isNull -- if the range isNull(), the vector will have very
|
|
446
|
+
* large negative coordinates.
|
|
447
|
+
*/
|
|
448
|
+
diagonal(result) {
|
|
449
|
+
return this.low.vectorTo(this.high, result);
|
|
450
|
+
}
|
|
451
|
+
/**
|
|
452
|
+
* Return the diagonal vector. There is no check for isNull -- if the range isNull(), the vector will have very
|
|
453
|
+
* large negative coordinates.
|
|
454
|
+
*/
|
|
455
|
+
diagonalFractionToPoint(fraction, result) {
|
|
456
|
+
return this.low.interpolate(fraction, this.high, result);
|
|
457
|
+
}
|
|
458
|
+
/** Return a point given by fractional positions on the XYZ axes. This is done with no check for isNull !!! */
|
|
399
459
|
fractionToPoint(fractionX, fractionY, fractionZ = 0, result) {
|
|
400
460
|
return this.low.interpolateXYZ(fractionX, fractionY, fractionZ, this.high, result);
|
|
401
461
|
}
|
|
402
|
-
/**
|
|
462
|
+
/**
|
|
463
|
+
* Return a point given by fractional positions on the XYZ axes.
|
|
403
464
|
* Returns undefined if the range is null.
|
|
404
465
|
*/
|
|
405
466
|
localXYZToWorld(fractionX, fractionY, fractionZ, result) {
|
|
@@ -407,13 +468,15 @@ class Range3d extends RangeBase {
|
|
|
407
468
|
return undefined;
|
|
408
469
|
return this.low.interpolateXYZ(fractionX, fractionY, fractionZ, this.high, result);
|
|
409
470
|
}
|
|
410
|
-
/**
|
|
471
|
+
/**
|
|
472
|
+
* Return a point given by fractional positions on the XYZ axes.
|
|
411
473
|
* * Returns undefined if the range is null.
|
|
412
474
|
*/
|
|
413
475
|
localToWorld(xyz, result) {
|
|
414
476
|
return this.localXYZToWorld(xyz.x, xyz.y, xyz.z, result);
|
|
415
477
|
}
|
|
416
|
-
/**
|
|
478
|
+
/**
|
|
479
|
+
* Replace fractional coordinates by world coordinates.
|
|
417
480
|
* @returns false if null range.
|
|
418
481
|
*/
|
|
419
482
|
localToWorldArrayInPlace(points) {
|
|
@@ -423,7 +486,8 @@ class Range3d extends RangeBase {
|
|
|
423
486
|
this.low.interpolateXYZ(p.x, p.y, p.z, this.high, p);
|
|
424
487
|
return false;
|
|
425
488
|
}
|
|
426
|
-
/**
|
|
489
|
+
/**
|
|
490
|
+
* Return fractional coordinates of point within the range.
|
|
427
491
|
* * returns undefined if the range is null.
|
|
428
492
|
* * returns undefined if any direction (x,y,z) has zero length
|
|
429
493
|
*/
|
|
@@ -435,7 +499,8 @@ class Range3d extends RangeBase {
|
|
|
435
499
|
return undefined;
|
|
436
500
|
return Point3dVector3d_1.Point3d.create((point.x - this.low.x) * ax, (point.y - this.low.y) * ay, (point.z - this.low.z) * az, result);
|
|
437
501
|
}
|
|
438
|
-
/**
|
|
502
|
+
/**
|
|
503
|
+
* Return fractional coordinates of point within the range.
|
|
439
504
|
* * returns undefined if the range is null.
|
|
440
505
|
* * returns undefined if any direction (x,y,z) has zero length
|
|
441
506
|
*/
|
|
@@ -449,7 +514,8 @@ class Range3d extends RangeBase {
|
|
|
449
514
|
Point3dVector3d_1.Point3d.create((p.x - this.low.x) * ax, (p.y - this.low.y) * ay, (p.z - this.low.z) * az, p);
|
|
450
515
|
return true;
|
|
451
516
|
}
|
|
452
|
-
/**
|
|
517
|
+
/**
|
|
518
|
+
* Return an array with the 8 corners on order wth "x varies fastest, then y, then z"
|
|
453
519
|
* * points preallocated in `result` are reused if result.length >= 8.
|
|
454
520
|
* * in reuse case, result.length is trimmed to 8
|
|
455
521
|
*/
|
|
@@ -474,10 +540,11 @@ class Range3d extends RangeBase {
|
|
|
474
540
|
Point3dVector3d_1.Point3d.create(this.low.x, this.low.y, this.high.z),
|
|
475
541
|
Point3dVector3d_1.Point3d.create(this.high.x, this.low.y, this.high.z),
|
|
476
542
|
Point3dVector3d_1.Point3d.create(this.low.x, this.high.y, this.high.z),
|
|
477
|
-
Point3dVector3d_1.Point3d.create(this.high.x, this.high.y, this.high.z)
|
|
543
|
+
Point3dVector3d_1.Point3d.create(this.high.x, this.high.y, this.high.z),
|
|
478
544
|
];
|
|
479
545
|
}
|
|
480
|
-
/**
|
|
546
|
+
/**
|
|
547
|
+
* Return an array with indices of the corners of a face
|
|
481
548
|
* * face 0 has negative x normal
|
|
482
549
|
* * face 1 has positive x normal
|
|
483
550
|
* * face 2 has negative y normal
|
|
@@ -528,12 +595,18 @@ class Range3d extends RangeBase {
|
|
|
528
595
|
return 0.0;
|
|
529
596
|
return Math.max(this.low.maxAbs(), this.high.maxAbs());
|
|
530
597
|
}
|
|
531
|
-
/**
|
|
532
|
-
get isAlmostZeroX() {
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
/**
|
|
536
|
-
get
|
|
598
|
+
/** Returns true if the x direction size is nearly zero */
|
|
599
|
+
get isAlmostZeroX() {
|
|
600
|
+
return Geometry_1.Geometry.isSmallMetricDistance(this.xLength());
|
|
601
|
+
}
|
|
602
|
+
/** Returns true if the y direction size is nearly zero */
|
|
603
|
+
get isAlmostZeroY() {
|
|
604
|
+
return Geometry_1.Geometry.isSmallMetricDistance(this.yLength());
|
|
605
|
+
}
|
|
606
|
+
/** Returns true if the z direction size is nearly zero */
|
|
607
|
+
get isAlmostZeroZ() {
|
|
608
|
+
return Geometry_1.Geometry.isSmallMetricDistance(this.zLength());
|
|
609
|
+
}
|
|
537
610
|
/** Test if a point given as x,y,z is within the range. */
|
|
538
611
|
containsXYZ(x, y, z) {
|
|
539
612
|
return x >= this.low.x
|
|
@@ -543,7 +616,7 @@ class Range3d extends RangeBase {
|
|
|
543
616
|
&& y <= this.high.y
|
|
544
617
|
&& z <= this.high.z;
|
|
545
618
|
}
|
|
546
|
-
/** Test if a point given as x,y is within the range
|
|
619
|
+
/** Test if a point given as x,y is within the range (ignoring z of range). */
|
|
547
620
|
containsXY(x, y) {
|
|
548
621
|
return x >= this.low.x
|
|
549
622
|
&& y >= this.low.y
|
|
@@ -551,7 +624,9 @@ class Range3d extends RangeBase {
|
|
|
551
624
|
&& y <= this.high.y;
|
|
552
625
|
}
|
|
553
626
|
/** Test if a point is within the range. */
|
|
554
|
-
containsPoint(point) {
|
|
627
|
+
containsPoint(point) {
|
|
628
|
+
return this.containsXYZ(point.x, point.y, point.z);
|
|
629
|
+
}
|
|
555
630
|
/** Test if the x,y coordinates of a point are within the range. */
|
|
556
631
|
containsPointXY(point) {
|
|
557
632
|
return point.x >= this.low.x
|
|
@@ -590,7 +665,7 @@ class Range3d extends RangeBase {
|
|
|
590
665
|
return RangeBase._EXTREME_POSITIVE;
|
|
591
666
|
return Math.min(Geometry_1.Geometry.hypotenuseXYZ(RangeBase.coordinateToRangeAbsoluteDistance(point.x, this.low.x, this.high.x), RangeBase.coordinateToRangeAbsoluteDistance(point.y, this.low.y, this.high.y), RangeBase.coordinateToRangeAbsoluteDistance(point.z, this.low.z, this.high.z)), RangeBase._EXTREME_POSITIVE);
|
|
592
667
|
}
|
|
593
|
-
/**
|
|
668
|
+
/** Returns 0 if the ranges have any overlap, otherwise the shortest absolute distance from one to the other. */
|
|
594
669
|
distanceToRange(other) {
|
|
595
670
|
return Math.min(Geometry_1.Geometry.hypotenuseXYZ(RangeBase.rangeToRangeAbsoluteDistance(this.low.x, this.high.x, other.low.x, other.high.x), RangeBase.rangeToRangeAbsoluteDistance(this.low.y, this.high.y, other.low.y, other.high.y), RangeBase.rangeToRangeAbsoluteDistance(this.low.z, this.high.z, other.low.z, other.high.z)), RangeBase._EXTREME_POSITIVE);
|
|
596
671
|
}
|
|
@@ -675,7 +750,8 @@ class Range3d extends RangeBase {
|
|
|
675
750
|
this.extendXYZ(other.high.x, other.high.y, other.high.z);
|
|
676
751
|
}
|
|
677
752
|
}
|
|
678
|
-
/**
|
|
753
|
+
/**
|
|
754
|
+
* In each direction look at the difference between this range limit and that of interiorRange.
|
|
679
755
|
* * If this range is larger, expand it by extrapolationFactor.
|
|
680
756
|
*/
|
|
681
757
|
extendWhenLarger(other, extrapolationFactor) {
|
|
@@ -704,7 +780,7 @@ class Range3d extends RangeBase {
|
|
|
704
780
|
return Range3d.createXYZXYZOrCorrectToNull(Math.min(this.low.x, other.low.x), Math.min(this.low.y, other.low.y), Math.min(this.low.z, other.low.z), Math.max(this.high.x, other.high.x), Math.max(this.high.y, other.high.y), Math.max(this.high.z, other.high.z), result);
|
|
705
781
|
}
|
|
706
782
|
/**
|
|
707
|
-
*
|
|
783
|
+
* Move low and high points by scaleFactor around the center point.
|
|
708
784
|
* @param scaleFactor scale factor applied to low, high distance from center.
|
|
709
785
|
*/
|
|
710
786
|
scaleAboutCenterInPlace(scaleFactor) {
|
|
@@ -723,7 +799,7 @@ class Range3d extends RangeBase {
|
|
|
723
799
|
}
|
|
724
800
|
}
|
|
725
801
|
/**
|
|
726
|
-
*
|
|
802
|
+
* Move all limits by a fixed amount.
|
|
727
803
|
* * positive delta expands the range size
|
|
728
804
|
* * negative delta reduces the range size
|
|
729
805
|
* * if any dimension reduces below zero size, the whole range becomes null
|
|
@@ -737,7 +813,8 @@ class Range3d extends RangeBase {
|
|
|
737
813
|
return Transform_1.Transform.createOriginAndMatrix(Point3dVector3d_1.Point3d.create(this.low.x, this.low.y, this.low.z), Matrix3d_1.Matrix3d.createRowValues(this.high.x - this.low.x, 0, 0, 0, this.high.y - this.low.y, 0, 0, 0, this.high.z - this.low.z), result);
|
|
738
814
|
}
|
|
739
815
|
/**
|
|
740
|
-
* Creates an NPC to world transformation to go from 000...111 to the globally aligned cube with diagonally
|
|
816
|
+
* Creates an NPC to world transformation to go from 000...111 to the globally aligned cube with diagonally
|
|
817
|
+
* opposite corners that are the
|
|
741
818
|
* min and max of this range. The diagonal component for any degenerate direction is 1.
|
|
742
819
|
*/
|
|
743
820
|
getNpcToWorldRangeTransform(result) {
|
|
@@ -751,7 +828,9 @@ class Range3d extends RangeBase {
|
|
|
751
828
|
matrix.coffs[8] = 1;
|
|
752
829
|
return transform;
|
|
753
830
|
}
|
|
754
|
-
/**
|
|
831
|
+
/**
|
|
832
|
+
* Ensure that the length of each dimension of this AxisAlignedBox3d is at least a minimum size. If not, expand
|
|
833
|
+
* to minimum about the center.
|
|
755
834
|
* @param min The minimum length for each dimension.
|
|
756
835
|
*/
|
|
757
836
|
ensureMinLengths(min = .001) {
|
|
@@ -781,7 +860,7 @@ exports.Range3d = Range3d;
|
|
|
781
860
|
* @public
|
|
782
861
|
*/
|
|
783
862
|
class Range1d extends RangeBase {
|
|
784
|
-
/**
|
|
863
|
+
/** Reset the low and high to null range state. */
|
|
785
864
|
setNull() {
|
|
786
865
|
this.low = RangeBase._EXTREME_POSITIVE;
|
|
787
866
|
this.high = RangeBase._EXTREME_NEGATIVE;
|
|
@@ -805,10 +884,13 @@ class Range1d extends RangeBase {
|
|
|
805
884
|
return (Geometry_1.Geometry.isSameCoordinate(this.low, other.low) && Geometry_1.Geometry.isSameCoordinate(this.high, other.high))
|
|
806
885
|
|| (this.isNull && other.isNull);
|
|
807
886
|
}
|
|
808
|
-
/**
|
|
809
|
-
setFrom(other) {
|
|
810
|
-
|
|
811
|
-
|
|
887
|
+
/** Copy contents from other Range1d. */
|
|
888
|
+
setFrom(other) {
|
|
889
|
+
this.low = other.low;
|
|
890
|
+
this.high = other.high;
|
|
891
|
+
}
|
|
892
|
+
/**
|
|
893
|
+
* Convert from a JSON object of one of these forms:
|
|
812
894
|
* * Any array of numbers: `[value,value, value]`
|
|
813
895
|
* * An object with low and high as properties: `{low:lowValue, high: highValue}`
|
|
814
896
|
*/
|
|
@@ -833,16 +915,20 @@ class Range1d extends RangeBase {
|
|
|
833
915
|
result.setFromJSON(json);
|
|
834
916
|
return result;
|
|
835
917
|
}
|
|
836
|
-
/**
|
|
918
|
+
/**
|
|
919
|
+
* Convert to a JSON object of form
|
|
837
920
|
* ```
|
|
838
921
|
* [lowValue,highValue]
|
|
839
922
|
* ```
|
|
840
923
|
*/
|
|
841
|
-
toJSON() {
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
|
|
924
|
+
toJSON() {
|
|
925
|
+
if (this.isNull)
|
|
926
|
+
return new Array();
|
|
927
|
+
else
|
|
928
|
+
return [this.low, this.high];
|
|
929
|
+
}
|
|
930
|
+
/**
|
|
931
|
+
* Return a new Range1d with contents of this.
|
|
846
932
|
* @param result optional result.
|
|
847
933
|
*/
|
|
848
934
|
clone(result) {
|
|
@@ -850,7 +936,8 @@ class Range1d extends RangeBase {
|
|
|
850
936
|
result.setDirect(this.low, this.high);
|
|
851
937
|
return result;
|
|
852
938
|
}
|
|
853
|
-
/**
|
|
939
|
+
/**
|
|
940
|
+
* Return a new Range1d with contents of this.
|
|
854
941
|
* @param result optional result.
|
|
855
942
|
*/
|
|
856
943
|
static createFrom(other, result) {
|
|
@@ -858,7 +945,8 @@ class Range1d extends RangeBase {
|
|
|
858
945
|
result.setDirect(other.low, other.high);
|
|
859
946
|
return result;
|
|
860
947
|
}
|
|
861
|
-
/**
|
|
948
|
+
/**
|
|
949
|
+
* Create a range with no content.
|
|
862
950
|
* @param result optional result.
|
|
863
951
|
*/
|
|
864
952
|
static createNull(result) {
|
|
@@ -866,7 +954,8 @@ class Range1d extends RangeBase {
|
|
|
866
954
|
result.setNull();
|
|
867
955
|
return result;
|
|
868
956
|
}
|
|
869
|
-
/**
|
|
957
|
+
/**
|
|
958
|
+
* Create a range with `delta` added to low and high
|
|
870
959
|
* * If `this` is a null range, return a null range.
|
|
871
960
|
*/
|
|
872
961
|
cloneTranslated(delta, result) {
|
|
@@ -881,7 +970,9 @@ class Range1d extends RangeBase {
|
|
|
881
970
|
* Set this range to be a single value.
|
|
882
971
|
* @param x value to use as both low and high.
|
|
883
972
|
*/
|
|
884
|
-
setX(x) {
|
|
973
|
+
setX(x) {
|
|
974
|
+
this.low = this.high = x;
|
|
975
|
+
}
|
|
885
976
|
/** Create a single point box */
|
|
886
977
|
static createX(x, result) {
|
|
887
978
|
result = result ? result : new this();
|
|
@@ -903,10 +994,12 @@ class Range1d extends RangeBase {
|
|
|
903
994
|
this.high = x0;
|
|
904
995
|
}
|
|
905
996
|
}
|
|
997
|
+
/** Check if low is 0 and high is 1 */
|
|
906
998
|
get isExact01() {
|
|
907
999
|
return this.low === 0.0 && this.high === 1.0;
|
|
908
1000
|
}
|
|
909
|
-
/**
|
|
1001
|
+
/**
|
|
1002
|
+
* Create a box from two values. Values are reversed if needed
|
|
910
1003
|
* @param xA first value
|
|
911
1004
|
* @param xB second value
|
|
912
1005
|
*/
|
|
@@ -915,7 +1008,8 @@ class Range1d extends RangeBase {
|
|
|
915
1008
|
result.setDirect(Math.min(xA, xB), Math.max(xA, xB));
|
|
916
1009
|
return result;
|
|
917
1010
|
}
|
|
918
|
-
/**
|
|
1011
|
+
/**
|
|
1012
|
+
* Create a box from two values, but null range if the values are reversed
|
|
919
1013
|
* @param xA first value
|
|
920
1014
|
* @param xB second value
|
|
921
1015
|
*/
|
|
@@ -926,7 +1020,8 @@ class Range1d extends RangeBase {
|
|
|
926
1020
|
result.setDirect(Math.min(xA, xB), Math.max(xA, xB));
|
|
927
1021
|
return result;
|
|
928
1022
|
}
|
|
929
|
-
/**
|
|
1023
|
+
/**
|
|
1024
|
+
* Create a range containing all the values in an array.
|
|
930
1025
|
* @param values array of points to be contained in the range.
|
|
931
1026
|
* @param result optional result.
|
|
932
1027
|
*/
|
|
@@ -937,13 +1032,14 @@ class Range1d extends RangeBase {
|
|
|
937
1032
|
result.extendX(x);
|
|
938
1033
|
return result;
|
|
939
1034
|
}
|
|
940
|
-
/**
|
|
1035
|
+
/** Extend to include an array of values */
|
|
941
1036
|
extendArray(values) {
|
|
942
1037
|
let x;
|
|
943
1038
|
for (x of values)
|
|
944
1039
|
this.extendX(x);
|
|
945
1040
|
}
|
|
946
|
-
/**
|
|
1041
|
+
/**
|
|
1042
|
+
* Extend to include `values` at indices `beginIndex <= i < endIndex]`
|
|
947
1043
|
* @param values array of values
|
|
948
1044
|
* @param beginIndex first index to include
|
|
949
1045
|
* @param numValue number of values to access
|
|
@@ -962,8 +1058,11 @@ class Range1d extends RangeBase {
|
|
|
962
1058
|
return this.high === this.low;
|
|
963
1059
|
}
|
|
964
1060
|
/** Return the length of the range in the x direction */
|
|
965
|
-
length() {
|
|
966
|
-
|
|
1061
|
+
length() {
|
|
1062
|
+
const a = this.high - this.low;
|
|
1063
|
+
return a > 0.0 ? a : 0.0;
|
|
1064
|
+
}
|
|
1065
|
+
/** Return a point given by fractional positions within the range. This is done with no check for isNull !!! */
|
|
967
1066
|
fractionToPoint(fraction) {
|
|
968
1067
|
return Geometry_1.Geometry.interpolate(this.low, fraction, this.high);
|
|
969
1068
|
}
|
|
@@ -974,7 +1073,9 @@ class Range1d extends RangeBase {
|
|
|
974
1073
|
return Math.max(Math.abs(this.low), Math.abs(this.high));
|
|
975
1074
|
}
|
|
976
1075
|
/** Test if the x direction size is nearly zero */
|
|
977
|
-
get isAlmostZeroLength() {
|
|
1076
|
+
get isAlmostZeroLength() {
|
|
1077
|
+
return Geometry_1.Geometry.isSmallMetricDistance(this.length());
|
|
1078
|
+
}
|
|
978
1079
|
/** Test if a number is within the range. */
|
|
979
1080
|
containsX(x) {
|
|
980
1081
|
return x >= this.low
|
|
@@ -994,7 +1095,6 @@ class Range1d extends RangeBase {
|
|
|
994
1095
|
* * For x1 > x0, that range is null, and the intersection is null.
|
|
995
1096
|
* * For x0 <= x1, the input is a non-null range.
|
|
996
1097
|
* * The intersection range replaces the contents of this.
|
|
997
|
-
*
|
|
998
1098
|
*/
|
|
999
1099
|
intersectRangeXXInPlace(x0, x1) {
|
|
1000
1100
|
if (x1 < x0 || x1 < this.low || x0 > this.high) {
|
|
@@ -1007,7 +1107,7 @@ class Range1d extends RangeBase {
|
|
|
1007
1107
|
this.low = x0;
|
|
1008
1108
|
}
|
|
1009
1109
|
}
|
|
1010
|
-
/**
|
|
1110
|
+
/** Returns 0 if the ranges have any overlap, otherwise the shortest absolute distance from one to the other. */
|
|
1011
1111
|
distanceToRange(other) {
|
|
1012
1112
|
return RangeBase.rangeToRangeAbsoluteDistance(this.low, this.high, other.low, other.high);
|
|
1013
1113
|
}
|
|
@@ -1059,7 +1159,7 @@ class Range1d extends RangeBase {
|
|
|
1059
1159
|
return Range1d.createXX(Math.min(this.low, other.low), Math.max(this.high, other.high), result);
|
|
1060
1160
|
}
|
|
1061
1161
|
/**
|
|
1062
|
-
*
|
|
1162
|
+
* Move low and high points by scaleFactor around the center point.
|
|
1063
1163
|
* @param scaleFactor scale factor applied to low, high distance from center.
|
|
1064
1164
|
*/
|
|
1065
1165
|
scaleAboutCenterInPlace(scaleFactor) {
|
|
@@ -1072,7 +1172,7 @@ class Range1d extends RangeBase {
|
|
|
1072
1172
|
}
|
|
1073
1173
|
}
|
|
1074
1174
|
/**
|
|
1075
|
-
*
|
|
1175
|
+
* Move all limits by a fixed amount.
|
|
1076
1176
|
* * positive delta expands the range size
|
|
1077
1177
|
* * negative delta reduces the range size
|
|
1078
1178
|
* * if any dimension reduces below zero size, the whole range becomes null
|
|
@@ -1082,13 +1182,14 @@ class Range1d extends RangeBase {
|
|
|
1082
1182
|
this.setDirect(this.low - delta, this.high + delta, true);
|
|
1083
1183
|
}
|
|
1084
1184
|
/**
|
|
1085
|
-
*
|
|
1185
|
+
* Clip this range to a linear half space condition
|
|
1086
1186
|
* * if `limitA > limitB` the limit space is empty
|
|
1087
1187
|
* * make this range null
|
|
1088
1188
|
* * return false;
|
|
1089
1189
|
* * otherwise (i.e `limitA <= limitB`)
|
|
1090
1190
|
* * solve `a + u * f = limitA' and `a + u * f = limitA`
|
|
1091
|
-
* * if unable to solve (i.e. u near zero), `a` alone determines whether to (a) leave this interval unchanged or
|
|
1191
|
+
* * if unable to solve (i.e. u near zero), `a` alone determines whether to (a) leave this interval unchanged or
|
|
1192
|
+
* (b) reduce to nothing.
|
|
1092
1193
|
* * the `f` values are an interval in the space of this `Range1d`
|
|
1093
1194
|
* * restrict the range to that interval (i.e intersect existing (low,high) with the fraction interval.
|
|
1094
1195
|
* * return true if the range is non-null after the clip.
|
|
@@ -1097,7 +1198,6 @@ class Range1d extends RangeBase {
|
|
|
1097
1198
|
* @param limitA crossing value, assumed in range relation with limitB
|
|
1098
1199
|
* @param limitB crossing value, assumed in range relation with limitB
|
|
1099
1200
|
* @param limitIsHigh true if the limit is an upper limit on mapped values.
|
|
1100
|
-
*
|
|
1101
1201
|
*/
|
|
1102
1202
|
clipLinearMapToInterval(a, u, limitA, limitB) {
|
|
1103
1203
|
// f = (limit - a) / u
|
|
@@ -1137,7 +1237,7 @@ exports.Range1d = Range1d;
|
|
|
1137
1237
|
* @public
|
|
1138
1238
|
*/
|
|
1139
1239
|
class Range2d extends RangeBase {
|
|
1140
|
-
/**
|
|
1240
|
+
/** Reset the low and high to null range state. */
|
|
1141
1241
|
setNull() {
|
|
1142
1242
|
this.low.x = RangeBase._EXTREME_POSITIVE;
|
|
1143
1243
|
this.low.y = RangeBase._EXTREME_POSITIVE;
|
|
@@ -1145,9 +1245,13 @@ class Range2d extends RangeBase {
|
|
|
1145
1245
|
this.high.y = RangeBase._EXTREME_NEGATIVE;
|
|
1146
1246
|
}
|
|
1147
1247
|
/** Flatten the low and high coordinates of any json object with low.x .. high.y into an array of 4 doubles */
|
|
1148
|
-
static toFloat64Array(val) {
|
|
1248
|
+
static toFloat64Array(val) {
|
|
1249
|
+
return Float64Array.of(val.low.x, val.low.y, val.high.x, val.high.y);
|
|
1250
|
+
}
|
|
1149
1251
|
/** Flatten the low and high coordinates of this instance into an array of 4 doubles */
|
|
1150
|
-
toFloat64Array() {
|
|
1252
|
+
toFloat64Array() {
|
|
1253
|
+
return Range2d.toFloat64Array(this);
|
|
1254
|
+
}
|
|
1151
1255
|
/**
|
|
1152
1256
|
* Construct a Range2d from an array of double-precision values
|
|
1153
1257
|
* @param f64 the array, which should contain exactly 4 values in this order: lowX, lowY, highX, highY
|
|
@@ -1159,12 +1263,15 @@ class Range2d extends RangeBase {
|
|
|
1159
1263
|
return new this(f64[0], f64[1], f64[2], f64[3]);
|
|
1160
1264
|
}
|
|
1161
1265
|
/**
|
|
1162
|
-
* Construct a Range2d from an un-typed array. This mostly useful when interpreting ECSQL query results of
|
|
1266
|
+
* Construct a Range2d from an un-typed array. This mostly useful when interpreting ECSQL query results of
|
|
1267
|
+
* the 'blob' type, where you know that that result is a Range3d.
|
|
1163
1268
|
* @param buffer untyped array
|
|
1164
1269
|
* @return a new Range2d object
|
|
1165
1270
|
*/
|
|
1166
|
-
static fromArrayBuffer(buffer) {
|
|
1167
|
-
|
|
1271
|
+
static fromArrayBuffer(buffer) {
|
|
1272
|
+
return this.fromFloat64Array(new Float64Array(buffer));
|
|
1273
|
+
}
|
|
1274
|
+
// explicit constructor - no enforcement of value relationships
|
|
1168
1275
|
constructor(lowX = Range2d._EXTREME_POSITIVE, lowY = Range2d._EXTREME_POSITIVE, highX = Range2d._EXTREME_NEGATIVE, highY = Range2d._EXTREME_NEGATIVE) {
|
|
1169
1276
|
super();
|
|
1170
1277
|
this.low = Point2dVector2d_1.Point2d.create(lowX, lowY);
|
|
@@ -1175,12 +1282,12 @@ class Range2d extends RangeBase {
|
|
|
1175
1282
|
return (this.low.isAlmostEqual(other.low) && this.high.isAlmostEqual(other.high))
|
|
1176
1283
|
|| (this.isNull && other.isNull);
|
|
1177
1284
|
}
|
|
1178
|
-
/**
|
|
1285
|
+
/** Copy all content from any `other` that has low and high xy data. */
|
|
1179
1286
|
setFrom(other) {
|
|
1180
1287
|
this.low.set(other.low.x, other.low.y);
|
|
1181
1288
|
this.high.set(other.high.x, other.high.y);
|
|
1182
1289
|
}
|
|
1183
|
-
/**
|
|
1290
|
+
/** Create a new Range2d from any `other` that has low and high xy data. */
|
|
1184
1291
|
static createFrom(other, result) {
|
|
1185
1292
|
if (result) {
|
|
1186
1293
|
result.setFrom(other);
|
|
@@ -1188,7 +1295,7 @@ class Range2d extends RangeBase {
|
|
|
1188
1295
|
}
|
|
1189
1296
|
return this.createXYXYOrCorrectToNull(other.low.x, other.low.y, other.high.x, other.high.y, result);
|
|
1190
1297
|
}
|
|
1191
|
-
/**
|
|
1298
|
+
/** Treat any array of numbers as numbers to be inserted !!! */
|
|
1192
1299
|
setFromJSON(json) {
|
|
1193
1300
|
this.setNull();
|
|
1194
1301
|
if (Array.isArray(json)) {
|
|
@@ -1207,9 +1314,15 @@ class Range2d extends RangeBase {
|
|
|
1207
1314
|
}
|
|
1208
1315
|
}
|
|
1209
1316
|
/** Freeze this instance (and its members) so it is read-only */
|
|
1210
|
-
freeze() {
|
|
1211
|
-
|
|
1212
|
-
|
|
1317
|
+
freeze() {
|
|
1318
|
+
this.low.freeze();
|
|
1319
|
+
this.high.freeze();
|
|
1320
|
+
return Object.freeze(this);
|
|
1321
|
+
}
|
|
1322
|
+
/** Return json array with two points as produced by `Point2d.toJSON` */
|
|
1323
|
+
toJSON() {
|
|
1324
|
+
return this.isNull ? [] : [this.low.toJSON(), this.high.toJSON()];
|
|
1325
|
+
}
|
|
1213
1326
|
/** Use `setFromJSON` to parse `json` into a new Range2d instance. */
|
|
1214
1327
|
static fromJSON(json) {
|
|
1215
1328
|
const result = new this();
|
|
@@ -1228,13 +1341,13 @@ class Range2d extends RangeBase {
|
|
|
1228
1341
|
this.setNull();
|
|
1229
1342
|
}
|
|
1230
1343
|
}
|
|
1231
|
-
/**
|
|
1344
|
+
/** Return a clone of this range (or copy to optional result) */
|
|
1232
1345
|
clone(result) {
|
|
1233
1346
|
result = result ? result : new this.constructor();
|
|
1234
1347
|
result.setDirect(this.low.x, this.low.y, this.high.x, this.high.y, false);
|
|
1235
1348
|
return result;
|
|
1236
1349
|
}
|
|
1237
|
-
/**
|
|
1350
|
+
/** Create a range with no content. */
|
|
1238
1351
|
static createNull(result) {
|
|
1239
1352
|
result = result ? result : new this();
|
|
1240
1353
|
result.setNull();
|
|
@@ -1284,7 +1397,10 @@ class Range2d extends RangeBase {
|
|
|
1284
1397
|
return this.high.x < this.low.x
|
|
1285
1398
|
|| this.high.y < this.low.y;
|
|
1286
1399
|
}
|
|
1287
|
-
/**
|
|
1400
|
+
/**
|
|
1401
|
+
* Test if the box has high strictly less than low for any of x,y, condition. Note that a range around a
|
|
1402
|
+
* single point is NOT null.
|
|
1403
|
+
*/
|
|
1288
1404
|
static isNull(range) {
|
|
1289
1405
|
return range.high.x < range.low.x
|
|
1290
1406
|
|| range.high.y < range.low.y;
|
|
@@ -1295,28 +1411,55 @@ class Range2d extends RangeBase {
|
|
|
1295
1411
|
&& this.high.y === this.low.y;
|
|
1296
1412
|
}
|
|
1297
1413
|
/** Return the midpoint of the diagonal. No test for null range. */
|
|
1298
|
-
get center() {
|
|
1299
|
-
|
|
1300
|
-
|
|
1301
|
-
/**
|
|
1302
|
-
get
|
|
1303
|
-
|
|
1304
|
-
|
|
1305
|
-
/**
|
|
1306
|
-
get
|
|
1414
|
+
get center() {
|
|
1415
|
+
return this.low.interpolate(.5, this.high);
|
|
1416
|
+
}
|
|
1417
|
+
/** Return the low x coordinate */
|
|
1418
|
+
get xLow() {
|
|
1419
|
+
return this.low.x;
|
|
1420
|
+
}
|
|
1421
|
+
/** Return the low y coordinate */
|
|
1422
|
+
get yLow() {
|
|
1423
|
+
return this.low.y;
|
|
1424
|
+
}
|
|
1425
|
+
/** Return the high x coordinate */
|
|
1426
|
+
get xHigh() {
|
|
1427
|
+
return this.high.x;
|
|
1428
|
+
}
|
|
1429
|
+
/** Return the high y coordinate */
|
|
1430
|
+
get yHigh() {
|
|
1431
|
+
return this.high.y;
|
|
1432
|
+
}
|
|
1307
1433
|
/** Length of the box in the x direction */
|
|
1308
|
-
xLength() {
|
|
1434
|
+
xLength() {
|
|
1435
|
+
const a = this.high.x - this.low.x;
|
|
1436
|
+
return a > 0.0 ? a : 0.0;
|
|
1437
|
+
}
|
|
1309
1438
|
/** Length of the box in the y direction */
|
|
1310
|
-
yLength() {
|
|
1311
|
-
|
|
1312
|
-
|
|
1313
|
-
|
|
1314
|
-
|
|
1315
|
-
|
|
1439
|
+
yLength() {
|
|
1440
|
+
const a = this.high.y - this.low.y;
|
|
1441
|
+
return a > 0.0 ? a : 0.0;
|
|
1442
|
+
}
|
|
1443
|
+
/**
|
|
1444
|
+
* Return the diagonal vector. There is no check for isNull -- if the range isNull(), the vector will have very
|
|
1445
|
+
* large negative coordinates.
|
|
1446
|
+
*/
|
|
1447
|
+
diagonal(result) {
|
|
1448
|
+
return this.low.vectorTo(this.high, result);
|
|
1449
|
+
}
|
|
1450
|
+
/**
|
|
1451
|
+
* Return the point at the specified fraction along the diagonal vector. There is no check for isNull -- if the
|
|
1452
|
+
* range isNull(), the vector will have very large negative coordinates.
|
|
1453
|
+
*/
|
|
1454
|
+
diagonalFractionToPoint(fraction, result) {
|
|
1455
|
+
return this.low.interpolate(fraction, this.high, result);
|
|
1456
|
+
}
|
|
1457
|
+
/** Return a point given by fractional positions on the XY axes. This is done with no check for isNull !!! */
|
|
1316
1458
|
fractionToPoint(fractionX, fractionY, result) {
|
|
1317
1459
|
return this.low.interpolateXY(fractionX, fractionY, this.high, result);
|
|
1318
1460
|
}
|
|
1319
|
-
/**
|
|
1461
|
+
/**
|
|
1462
|
+
* Return an array with the 4 corners.
|
|
1320
1463
|
* * if asLoop is false, 4 corners are "x varies fastest, then y"
|
|
1321
1464
|
* * if asLoop is true, 5 corners are in CCW order WITH CLOSURE
|
|
1322
1465
|
*/
|
|
@@ -1327,13 +1470,13 @@ class Range2d extends RangeBase {
|
|
|
1327
1470
|
Point3dVector3d_1.Point3d.create(this.high.x, this.low.y, z),
|
|
1328
1471
|
Point3dVector3d_1.Point3d.create(this.high.x, this.high.y, z),
|
|
1329
1472
|
Point3dVector3d_1.Point3d.create(this.low.x, this.high.y, z),
|
|
1330
|
-
Point3dVector3d_1.Point3d.create(this.low.x, this.low.y, z)
|
|
1473
|
+
Point3dVector3d_1.Point3d.create(this.low.x, this.low.y, z),
|
|
1331
1474
|
];
|
|
1332
1475
|
return [
|
|
1333
1476
|
Point3dVector3d_1.Point3d.create(this.low.x, this.low.y, z),
|
|
1334
1477
|
Point3dVector3d_1.Point3d.create(this.high.x, this.low.y, z),
|
|
1335
1478
|
Point3dVector3d_1.Point3d.create(this.low.x, this.high.y, z),
|
|
1336
|
-
Point3dVector3d_1.Point3d.create(this.high.x, this.high.y, z)
|
|
1479
|
+
Point3dVector3d_1.Point3d.create(this.high.x, this.high.y, z),
|
|
1337
1480
|
];
|
|
1338
1481
|
}
|
|
1339
1482
|
/** Largest absolute value among any coordinates in the box corners. */
|
|
@@ -1343,10 +1486,14 @@ class Range2d extends RangeBase {
|
|
|
1343
1486
|
return Math.max(this.low.maxAbs(), this.high.maxAbs());
|
|
1344
1487
|
}
|
|
1345
1488
|
/** Test if the x direction size is nearly zero */
|
|
1346
|
-
get isAlmostZeroX() {
|
|
1489
|
+
get isAlmostZeroX() {
|
|
1490
|
+
return Geometry_1.Geometry.isSmallMetricDistance(this.xLength());
|
|
1491
|
+
}
|
|
1347
1492
|
/** Test if the y direction size is nearly zero */
|
|
1348
|
-
get isAlmostZeroY() {
|
|
1349
|
-
|
|
1493
|
+
get isAlmostZeroY() {
|
|
1494
|
+
return Geometry_1.Geometry.isSmallMetricDistance(this.yLength());
|
|
1495
|
+
}
|
|
1496
|
+
/** Test if a point given as x,y is within the range */
|
|
1350
1497
|
containsXY(x, y) {
|
|
1351
1498
|
return x >= this.low.x
|
|
1352
1499
|
&& y >= this.low.y
|
|
@@ -1354,7 +1501,9 @@ class Range2d extends RangeBase {
|
|
|
1354
1501
|
&& y <= this.high.y;
|
|
1355
1502
|
}
|
|
1356
1503
|
/** Test if a point is within the range. */
|
|
1357
|
-
containsPoint(point) {
|
|
1504
|
+
containsPoint(point) {
|
|
1505
|
+
return this.containsXY(point.x, point.y);
|
|
1506
|
+
}
|
|
1358
1507
|
/** Test of other range is within this range */
|
|
1359
1508
|
containsRange(other) {
|
|
1360
1509
|
return other.low.x >= this.low.x
|
|
@@ -1397,7 +1546,9 @@ class Range2d extends RangeBase {
|
|
|
1397
1546
|
this.extendXY(x1, y1);
|
|
1398
1547
|
}
|
|
1399
1548
|
/** Expand this range to include a point. */
|
|
1400
|
-
extendPoint(point) {
|
|
1549
|
+
extendPoint(point) {
|
|
1550
|
+
this.extendXY(point.x, point.y);
|
|
1551
|
+
}
|
|
1401
1552
|
/** Expand this range to include a range. */
|
|
1402
1553
|
extendRange(other) {
|
|
1403
1554
|
if (!Range2d.isNull(other)) {
|
|
@@ -1421,7 +1572,7 @@ class Range2d extends RangeBase {
|
|
|
1421
1572
|
return Range2d.createXYXY(Math.min(this.low.x, other.low.x), Math.min(this.low.y, other.low.y), Math.max(this.high.x, other.high.x), Math.max(this.high.y, other.high.y), result);
|
|
1422
1573
|
}
|
|
1423
1574
|
/**
|
|
1424
|
-
*
|
|
1575
|
+
* Move low and high points by scaleFactor around the center point.
|
|
1425
1576
|
* @param scaleFactor scale factor applied to low, high distance from center.
|
|
1426
1577
|
*/
|
|
1427
1578
|
scaleAboutCenterInPlace(scaleFactor) {
|
|
@@ -1437,7 +1588,7 @@ class Range2d extends RangeBase {
|
|
|
1437
1588
|
}
|
|
1438
1589
|
}
|
|
1439
1590
|
/**
|
|
1440
|
-
*
|
|
1591
|
+
* Move all limits by a fixed amount.
|
|
1441
1592
|
* * positive delta expands the range size
|
|
1442
1593
|
* * negative delta reduces the range size
|
|
1443
1594
|
* * if any dimension reduces below zero size, the whole range becomes null
|
|
@@ -1446,7 +1597,8 @@ class Range2d extends RangeBase {
|
|
|
1446
1597
|
expandInPlace(delta) {
|
|
1447
1598
|
this.setDirect(this.low.x - delta, this.low.y - delta, this.high.x + delta, this.high.y + delta, true);
|
|
1448
1599
|
}
|
|
1449
|
-
/**
|
|
1600
|
+
/**
|
|
1601
|
+
* Return fractional coordinates of point within the range.
|
|
1450
1602
|
* * returns undefined if the range is null.
|
|
1451
1603
|
* * returns undefined if any direction (x,y) has zero length
|
|
1452
1604
|
*/
|