@itwin/core-geometry 4.3.0-dev.8 → 4.3.0
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 +57 -1
- package/lib/cjs/Geometry.d.ts +14 -2
- package/lib/cjs/Geometry.d.ts.map +1 -1
- package/lib/cjs/Geometry.js +20 -9
- package/lib/cjs/Geometry.js.map +1 -1
- package/lib/cjs/bspline/BSpline1dNd.d.ts +12 -2
- package/lib/cjs/bspline/BSpline1dNd.d.ts.map +1 -1
- package/lib/cjs/bspline/BSpline1dNd.js +27 -17
- package/lib/cjs/bspline/BSpline1dNd.js.map +1 -1
- package/lib/cjs/bspline/BSplineCurve.d.ts +30 -16
- package/lib/cjs/bspline/BSplineCurve.d.ts.map +1 -1
- package/lib/cjs/bspline/BSplineCurve.js +68 -44
- package/lib/cjs/bspline/BSplineCurve.js.map +1 -1
- package/lib/cjs/bspline/BSplineCurve3dH.d.ts +27 -20
- package/lib/cjs/bspline/BSplineCurve3dH.d.ts.map +1 -1
- package/lib/cjs/bspline/BSplineCurve3dH.js +136 -87
- package/lib/cjs/bspline/BSplineCurve3dH.js.map +1 -1
- package/lib/cjs/bspline/BSplineSurface.d.ts +138 -74
- package/lib/cjs/bspline/BSplineSurface.d.ts.map +1 -1
- package/lib/cjs/bspline/BSplineSurface.js +242 -119
- package/lib/cjs/bspline/BSplineSurface.js.map +1 -1
- package/lib/cjs/bspline/Bezier1dNd.d.ts +18 -4
- package/lib/cjs/bspline/Bezier1dNd.d.ts.map +1 -1
- package/lib/cjs/bspline/Bezier1dNd.js +19 -5
- package/lib/cjs/bspline/Bezier1dNd.js.map +1 -1
- package/lib/cjs/bspline/BezierCurve3dH.d.ts.map +1 -1
- package/lib/cjs/bspline/BezierCurve3dH.js +2 -1
- package/lib/cjs/bspline/BezierCurve3dH.js.map +1 -1
- package/lib/cjs/bspline/KnotVector.d.ts +30 -33
- package/lib/cjs/bspline/KnotVector.d.ts.map +1 -1
- package/lib/cjs/bspline/KnotVector.js +76 -69
- package/lib/cjs/bspline/KnotVector.js.map +1 -1
- package/lib/cjs/clipping/ClipUtils.d.ts +32 -5
- package/lib/cjs/clipping/ClipUtils.d.ts.map +1 -1
- package/lib/cjs/clipping/ClipUtils.js +92 -11
- package/lib/cjs/clipping/ClipUtils.js.map +1 -1
- package/lib/cjs/core-geometry.d.ts +0 -2
- package/lib/cjs/core-geometry.d.ts.map +1 -1
- package/lib/cjs/core-geometry.js +0 -2
- package/lib/cjs/core-geometry.js.map +1 -1
- package/lib/cjs/curve/Arc3d.d.ts.map +1 -1
- package/lib/cjs/curve/Arc3d.js +5 -5
- package/lib/cjs/curve/Arc3d.js.map +1 -1
- package/lib/cjs/curve/CurveLocationDetail.d.ts +1 -4
- package/lib/cjs/curve/CurveLocationDetail.d.ts.map +1 -1
- package/lib/cjs/curve/CurveLocationDetail.js +4 -10
- package/lib/cjs/curve/CurveLocationDetail.js.map +1 -1
- package/lib/cjs/curve/CurveOps.d.ts +4 -5
- package/lib/cjs/curve/CurveOps.d.ts.map +1 -1
- package/lib/cjs/curve/CurveOps.js +1 -1
- package/lib/cjs/curve/CurveOps.js.map +1 -1
- package/lib/cjs/curve/CurveTypes.d.ts +14 -2
- package/lib/cjs/curve/CurveTypes.d.ts.map +1 -1
- package/lib/cjs/curve/CurveTypes.js.map +1 -1
- package/lib/cjs/curve/LineString3d.d.ts +3 -2
- package/lib/cjs/curve/LineString3d.d.ts.map +1 -1
- package/lib/cjs/curve/LineString3d.js +1 -0
- package/lib/cjs/curve/LineString3d.js.map +1 -1
- package/lib/cjs/curve/PointString3d.d.ts +2 -1
- package/lib/cjs/curve/PointString3d.d.ts.map +1 -1
- package/lib/cjs/curve/PointString3d.js.map +1 -1
- package/lib/cjs/curve/RegionOps.d.ts +5 -11
- package/lib/cjs/curve/RegionOps.d.ts.map +1 -1
- package/lib/cjs/curve/RegionOps.js.map +1 -1
- package/lib/cjs/curve/internalContexts/CurveCurveCloseApproachXY.d.ts +15 -9
- package/lib/cjs/curve/internalContexts/CurveCurveCloseApproachXY.d.ts.map +1 -1
- package/lib/cjs/curve/internalContexts/CurveCurveCloseApproachXY.js +68 -56
- package/lib/cjs/curve/internalContexts/CurveCurveCloseApproachXY.js.map +1 -1
- package/lib/cjs/curve/internalContexts/CurveCurveIntersectXY.d.ts +14 -16
- package/lib/cjs/curve/internalContexts/CurveCurveIntersectXY.d.ts.map +1 -1
- package/lib/cjs/curve/internalContexts/CurveCurveIntersectXY.js +51 -69
- package/lib/cjs/curve/internalContexts/CurveCurveIntersectXY.js.map +1 -1
- package/lib/cjs/curve/internalContexts/CurveCurveIntersectXYZ.d.ts.map +1 -1
- package/lib/cjs/curve/internalContexts/CurveCurveIntersectXYZ.js +3 -2
- package/lib/cjs/curve/internalContexts/CurveCurveIntersectXYZ.js.map +1 -1
- package/lib/cjs/curve/internalContexts/MultiChainCollector.d.ts +2 -3
- package/lib/cjs/curve/internalContexts/MultiChainCollector.d.ts.map +1 -1
- package/lib/cjs/curve/internalContexts/MultiChainCollector.js.map +1 -1
- package/lib/cjs/curve/internalContexts/PolygonOffsetContext.d.ts +4 -4
- package/lib/cjs/curve/internalContexts/PolygonOffsetContext.d.ts.map +1 -1
- package/lib/cjs/curve/internalContexts/PolygonOffsetContext.js +38 -36
- package/lib/cjs/curve/internalContexts/PolygonOffsetContext.js.map +1 -1
- package/lib/cjs/geometry3d/Angle.d.ts +0 -1
- package/lib/cjs/geometry3d/Angle.d.ts.map +1 -1
- package/lib/cjs/geometry3d/Angle.js +0 -1
- package/lib/cjs/geometry3d/Angle.js.map +1 -1
- package/lib/cjs/geometry3d/CoincidentGeometryOps.d.ts +21 -5
- package/lib/cjs/geometry3d/CoincidentGeometryOps.d.ts.map +1 -1
- package/lib/cjs/geometry3d/CoincidentGeometryOps.js +71 -45
- package/lib/cjs/geometry3d/CoincidentGeometryOps.js.map +1 -1
- package/lib/cjs/geometry3d/Matrix3d.d.ts +20 -13
- package/lib/cjs/geometry3d/Matrix3d.d.ts.map +1 -1
- package/lib/cjs/geometry3d/Matrix3d.js +28 -21
- package/lib/cjs/geometry3d/Matrix3d.js.map +1 -1
- package/lib/cjs/geometry3d/Point3dVector3d.d.ts +11 -2
- package/lib/cjs/geometry3d/Point3dVector3d.d.ts.map +1 -1
- package/lib/cjs/geometry3d/Point3dVector3d.js +16 -5
- package/lib/cjs/geometry3d/Point3dVector3d.js.map +1 -1
- package/lib/cjs/geometry3d/PointHelpers.d.ts +58 -20
- package/lib/cjs/geometry3d/PointHelpers.d.ts.map +1 -1
- package/lib/cjs/geometry3d/PointHelpers.js +213 -62
- package/lib/cjs/geometry3d/PointHelpers.js.map +1 -1
- package/lib/cjs/geometry3d/Segment1d.d.ts +5 -1
- package/lib/cjs/geometry3d/Segment1d.d.ts.map +1 -1
- package/lib/cjs/geometry3d/Segment1d.js +11 -7
- package/lib/cjs/geometry3d/Segment1d.js.map +1 -1
- package/lib/cjs/geometry3d/Transform.d.ts +4 -5
- package/lib/cjs/geometry3d/Transform.d.ts.map +1 -1
- package/lib/cjs/geometry3d/Transform.js +4 -5
- package/lib/cjs/geometry3d/Transform.js.map +1 -1
- package/lib/cjs/geometry4d/Point4d.d.ts +13 -0
- package/lib/cjs/geometry4d/Point4d.d.ts.map +1 -1
- package/lib/cjs/geometry4d/Point4d.js +21 -0
- package/lib/cjs/geometry4d/Point4d.js.map +1 -1
- package/lib/cjs/numerics/BezierPolynomials.d.ts +88 -64
- package/lib/cjs/numerics/BezierPolynomials.d.ts.map +1 -1
- package/lib/cjs/numerics/BezierPolynomials.js +92 -73
- package/lib/cjs/numerics/BezierPolynomials.js.map +1 -1
- package/lib/cjs/numerics/Newton.d.ts +143 -61
- package/lib/cjs/numerics/Newton.d.ts.map +1 -1
- package/lib/cjs/numerics/Newton.js +233 -66
- package/lib/cjs/numerics/Newton.js.map +1 -1
- package/lib/cjs/numerics/PascalCoefficients.d.ts +8 -12
- package/lib/cjs/numerics/PascalCoefficients.d.ts.map +1 -1
- package/lib/cjs/numerics/PascalCoefficients.js +10 -12
- package/lib/cjs/numerics/PascalCoefficients.js.map +1 -1
- package/lib/cjs/numerics/Polynomials.d.ts +6 -10
- package/lib/cjs/numerics/Polynomials.d.ts.map +1 -1
- package/lib/cjs/numerics/Polynomials.js +6 -10
- package/lib/cjs/numerics/Polynomials.js.map +1 -1
- package/lib/cjs/polyface/PolyfaceBuilder.d.ts +3 -0
- package/lib/cjs/polyface/PolyfaceBuilder.d.ts.map +1 -1
- package/lib/cjs/polyface/PolyfaceBuilder.js +13 -2
- package/lib/cjs/polyface/PolyfaceBuilder.js.map +1 -1
- package/lib/cjs/polyface/PolyfaceData.d.ts +1 -1
- package/lib/cjs/polyface/PolyfaceData.js +1 -1
- package/lib/cjs/polyface/PolyfaceData.js.map +1 -1
- package/lib/cjs/polyface/PolyfaceQuery.d.ts +38 -11
- package/lib/cjs/polyface/PolyfaceQuery.d.ts.map +1 -1
- package/lib/cjs/polyface/PolyfaceQuery.js +93 -16
- package/lib/cjs/polyface/PolyfaceQuery.js.map +1 -1
- package/lib/cjs/serialization/BGFBReader.d.ts +10 -10
- package/lib/cjs/serialization/BGFBReader.d.ts.map +1 -1
- package/lib/cjs/serialization/BGFBReader.js +69 -42
- package/lib/cjs/serialization/BGFBReader.js.map +1 -1
- package/lib/cjs/serialization/BGFBWriter.d.ts +8 -8
- package/lib/cjs/serialization/BGFBWriter.d.ts.map +1 -1
- package/lib/cjs/serialization/BGFBWriter.js +80 -55
- package/lib/cjs/serialization/BGFBWriter.js.map +1 -1
- package/lib/cjs/serialization/GeometrySamples.d.ts.map +1 -1
- package/lib/cjs/serialization/GeometrySamples.js +6 -8
- package/lib/cjs/serialization/GeometrySamples.js.map +1 -1
- package/lib/cjs/serialization/IModelJsonSchema.d.ts +8 -14
- package/lib/cjs/serialization/IModelJsonSchema.d.ts.map +1 -1
- package/lib/cjs/serialization/IModelJsonSchema.js +85 -259
- package/lib/cjs/serialization/IModelJsonSchema.js.map +1 -1
- package/lib/cjs/serialization/SerializationHelpers.d.ts +109 -0
- package/lib/cjs/serialization/SerializationHelpers.d.ts.map +1 -0
- package/lib/cjs/serialization/SerializationHelpers.js +591 -0
- package/lib/cjs/serialization/SerializationHelpers.js.map +1 -0
- package/lib/cjs/topology/Graph.d.ts +399 -366
- package/lib/cjs/topology/Graph.d.ts.map +1 -1
- package/lib/cjs/topology/Graph.js +531 -464
- package/lib/cjs/topology/Graph.js.map +1 -1
- package/lib/cjs/topology/MaskManager.d.ts +8 -9
- package/lib/cjs/topology/MaskManager.d.ts.map +1 -1
- package/lib/cjs/topology/MaskManager.js +11 -12
- package/lib/cjs/topology/MaskManager.js.map +1 -1
- package/lib/esm/Geometry.d.ts +14 -2
- package/lib/esm/Geometry.d.ts.map +1 -1
- package/lib/esm/Geometry.js +20 -9
- package/lib/esm/Geometry.js.map +1 -1
- package/lib/esm/bspline/BSpline1dNd.d.ts +12 -2
- package/lib/esm/bspline/BSpline1dNd.d.ts.map +1 -1
- package/lib/esm/bspline/BSpline1dNd.js +27 -17
- package/lib/esm/bspline/BSpline1dNd.js.map +1 -1
- package/lib/esm/bspline/BSplineCurve.d.ts +30 -16
- package/lib/esm/bspline/BSplineCurve.d.ts.map +1 -1
- package/lib/esm/bspline/BSplineCurve.js +68 -44
- package/lib/esm/bspline/BSplineCurve.js.map +1 -1
- package/lib/esm/bspline/BSplineCurve3dH.d.ts +27 -20
- package/lib/esm/bspline/BSplineCurve3dH.d.ts.map +1 -1
- package/lib/esm/bspline/BSplineCurve3dH.js +137 -88
- package/lib/esm/bspline/BSplineCurve3dH.js.map +1 -1
- package/lib/esm/bspline/BSplineSurface.d.ts +138 -74
- package/lib/esm/bspline/BSplineSurface.d.ts.map +1 -1
- package/lib/esm/bspline/BSplineSurface.js +242 -119
- package/lib/esm/bspline/BSplineSurface.js.map +1 -1
- package/lib/esm/bspline/Bezier1dNd.d.ts +18 -4
- package/lib/esm/bspline/Bezier1dNd.d.ts.map +1 -1
- package/lib/esm/bspline/Bezier1dNd.js +19 -5
- package/lib/esm/bspline/Bezier1dNd.js.map +1 -1
- package/lib/esm/bspline/BezierCurve3dH.d.ts.map +1 -1
- package/lib/esm/bspline/BezierCurve3dH.js +2 -1
- package/lib/esm/bspline/BezierCurve3dH.js.map +1 -1
- package/lib/esm/bspline/KnotVector.d.ts +30 -33
- package/lib/esm/bspline/KnotVector.d.ts.map +1 -1
- package/lib/esm/bspline/KnotVector.js +76 -69
- package/lib/esm/bspline/KnotVector.js.map +1 -1
- package/lib/esm/clipping/ClipUtils.d.ts +32 -5
- package/lib/esm/clipping/ClipUtils.d.ts.map +1 -1
- package/lib/esm/clipping/ClipUtils.js +92 -11
- package/lib/esm/clipping/ClipUtils.js.map +1 -1
- package/lib/esm/core-geometry.d.ts +0 -2
- package/lib/esm/core-geometry.d.ts.map +1 -1
- package/lib/esm/core-geometry.js +0 -2
- package/lib/esm/core-geometry.js.map +1 -1
- package/lib/esm/curve/Arc3d.d.ts.map +1 -1
- package/lib/esm/curve/Arc3d.js +5 -5
- package/lib/esm/curve/Arc3d.js.map +1 -1
- package/lib/esm/curve/CurveLocationDetail.d.ts +1 -4
- package/lib/esm/curve/CurveLocationDetail.d.ts.map +1 -1
- package/lib/esm/curve/CurveLocationDetail.js +4 -10
- package/lib/esm/curve/CurveLocationDetail.js.map +1 -1
- package/lib/esm/curve/CurveOps.d.ts +4 -5
- package/lib/esm/curve/CurveOps.d.ts.map +1 -1
- package/lib/esm/curve/CurveOps.js +1 -1
- package/lib/esm/curve/CurveOps.js.map +1 -1
- package/lib/esm/curve/CurveTypes.d.ts +14 -2
- package/lib/esm/curve/CurveTypes.d.ts.map +1 -1
- package/lib/esm/curve/CurveTypes.js.map +1 -1
- package/lib/esm/curve/LineString3d.d.ts +3 -2
- package/lib/esm/curve/LineString3d.d.ts.map +1 -1
- package/lib/esm/curve/LineString3d.js +1 -0
- package/lib/esm/curve/LineString3d.js.map +1 -1
- package/lib/esm/curve/PointString3d.d.ts +2 -1
- package/lib/esm/curve/PointString3d.d.ts.map +1 -1
- package/lib/esm/curve/PointString3d.js.map +1 -1
- package/lib/esm/curve/RegionOps.d.ts +5 -11
- package/lib/esm/curve/RegionOps.d.ts.map +1 -1
- package/lib/esm/curve/RegionOps.js.map +1 -1
- package/lib/esm/curve/internalContexts/CurveCurveCloseApproachXY.d.ts +15 -9
- package/lib/esm/curve/internalContexts/CurveCurveCloseApproachXY.d.ts.map +1 -1
- package/lib/esm/curve/internalContexts/CurveCurveCloseApproachXY.js +69 -57
- package/lib/esm/curve/internalContexts/CurveCurveCloseApproachXY.js.map +1 -1
- package/lib/esm/curve/internalContexts/CurveCurveIntersectXY.d.ts +14 -16
- package/lib/esm/curve/internalContexts/CurveCurveIntersectXY.d.ts.map +1 -1
- package/lib/esm/curve/internalContexts/CurveCurveIntersectXY.js +51 -68
- package/lib/esm/curve/internalContexts/CurveCurveIntersectXY.js.map +1 -1
- package/lib/esm/curve/internalContexts/CurveCurveIntersectXYZ.d.ts.map +1 -1
- package/lib/esm/curve/internalContexts/CurveCurveIntersectXYZ.js +3 -2
- package/lib/esm/curve/internalContexts/CurveCurveIntersectXYZ.js.map +1 -1
- package/lib/esm/curve/internalContexts/MultiChainCollector.d.ts +2 -3
- package/lib/esm/curve/internalContexts/MultiChainCollector.d.ts.map +1 -1
- package/lib/esm/curve/internalContexts/MultiChainCollector.js.map +1 -1
- package/lib/esm/curve/internalContexts/PolygonOffsetContext.d.ts +4 -4
- package/lib/esm/curve/internalContexts/PolygonOffsetContext.d.ts.map +1 -1
- package/lib/esm/curve/internalContexts/PolygonOffsetContext.js +38 -36
- package/lib/esm/curve/internalContexts/PolygonOffsetContext.js.map +1 -1
- package/lib/esm/geometry3d/Angle.d.ts +0 -1
- package/lib/esm/geometry3d/Angle.d.ts.map +1 -1
- package/lib/esm/geometry3d/Angle.js +0 -1
- package/lib/esm/geometry3d/Angle.js.map +1 -1
- package/lib/esm/geometry3d/CoincidentGeometryOps.d.ts +21 -5
- package/lib/esm/geometry3d/CoincidentGeometryOps.d.ts.map +1 -1
- package/lib/esm/geometry3d/CoincidentGeometryOps.js +71 -45
- package/lib/esm/geometry3d/CoincidentGeometryOps.js.map +1 -1
- package/lib/esm/geometry3d/Matrix3d.d.ts +20 -13
- package/lib/esm/geometry3d/Matrix3d.d.ts.map +1 -1
- package/lib/esm/geometry3d/Matrix3d.js +28 -21
- package/lib/esm/geometry3d/Matrix3d.js.map +1 -1
- package/lib/esm/geometry3d/Point3dVector3d.d.ts +11 -2
- package/lib/esm/geometry3d/Point3dVector3d.d.ts.map +1 -1
- package/lib/esm/geometry3d/Point3dVector3d.js +16 -5
- package/lib/esm/geometry3d/Point3dVector3d.js.map +1 -1
- package/lib/esm/geometry3d/PointHelpers.d.ts +58 -20
- package/lib/esm/geometry3d/PointHelpers.d.ts.map +1 -1
- package/lib/esm/geometry3d/PointHelpers.js +213 -62
- package/lib/esm/geometry3d/PointHelpers.js.map +1 -1
- package/lib/esm/geometry3d/Segment1d.d.ts +5 -1
- package/lib/esm/geometry3d/Segment1d.d.ts.map +1 -1
- package/lib/esm/geometry3d/Segment1d.js +11 -7
- package/lib/esm/geometry3d/Segment1d.js.map +1 -1
- package/lib/esm/geometry3d/Transform.d.ts +4 -5
- package/lib/esm/geometry3d/Transform.d.ts.map +1 -1
- package/lib/esm/geometry3d/Transform.js +4 -5
- package/lib/esm/geometry3d/Transform.js.map +1 -1
- package/lib/esm/geometry4d/Point4d.d.ts +13 -0
- package/lib/esm/geometry4d/Point4d.d.ts.map +1 -1
- package/lib/esm/geometry4d/Point4d.js +21 -0
- package/lib/esm/geometry4d/Point4d.js.map +1 -1
- package/lib/esm/numerics/BezierPolynomials.d.ts +88 -64
- package/lib/esm/numerics/BezierPolynomials.d.ts.map +1 -1
- package/lib/esm/numerics/BezierPolynomials.js +92 -73
- package/lib/esm/numerics/BezierPolynomials.js.map +1 -1
- package/lib/esm/numerics/Newton.d.ts +143 -61
- package/lib/esm/numerics/Newton.d.ts.map +1 -1
- package/lib/esm/numerics/Newton.js +229 -65
- package/lib/esm/numerics/Newton.js.map +1 -1
- package/lib/esm/numerics/PascalCoefficients.d.ts +8 -12
- package/lib/esm/numerics/PascalCoefficients.d.ts.map +1 -1
- package/lib/esm/numerics/PascalCoefficients.js +10 -12
- package/lib/esm/numerics/PascalCoefficients.js.map +1 -1
- package/lib/esm/numerics/Polynomials.d.ts +6 -10
- package/lib/esm/numerics/Polynomials.d.ts.map +1 -1
- package/lib/esm/numerics/Polynomials.js +6 -10
- package/lib/esm/numerics/Polynomials.js.map +1 -1
- package/lib/esm/polyface/PolyfaceBuilder.d.ts +3 -0
- package/lib/esm/polyface/PolyfaceBuilder.d.ts.map +1 -1
- package/lib/esm/polyface/PolyfaceBuilder.js +13 -2
- package/lib/esm/polyface/PolyfaceBuilder.js.map +1 -1
- package/lib/esm/polyface/PolyfaceData.d.ts +1 -1
- package/lib/esm/polyface/PolyfaceData.js +1 -1
- package/lib/esm/polyface/PolyfaceData.js.map +1 -1
- package/lib/esm/polyface/PolyfaceQuery.d.ts +38 -11
- package/lib/esm/polyface/PolyfaceQuery.d.ts.map +1 -1
- package/lib/esm/polyface/PolyfaceQuery.js +93 -16
- package/lib/esm/polyface/PolyfaceQuery.js.map +1 -1
- package/lib/esm/serialization/BGFBReader.d.ts +10 -10
- package/lib/esm/serialization/BGFBReader.d.ts.map +1 -1
- package/lib/esm/serialization/BGFBReader.js +69 -42
- package/lib/esm/serialization/BGFBReader.js.map +1 -1
- package/lib/esm/serialization/BGFBWriter.d.ts +8 -8
- package/lib/esm/serialization/BGFBWriter.d.ts.map +1 -1
- package/lib/esm/serialization/BGFBWriter.js +80 -55
- package/lib/esm/serialization/BGFBWriter.js.map +1 -1
- package/lib/esm/serialization/GeometrySamples.d.ts.map +1 -1
- package/lib/esm/serialization/GeometrySamples.js +7 -9
- package/lib/esm/serialization/GeometrySamples.js.map +1 -1
- package/lib/esm/serialization/IModelJsonSchema.d.ts +8 -14
- package/lib/esm/serialization/IModelJsonSchema.d.ts.map +1 -1
- package/lib/esm/serialization/IModelJsonSchema.js +86 -260
- package/lib/esm/serialization/IModelJsonSchema.js.map +1 -1
- package/lib/esm/serialization/SerializationHelpers.d.ts +109 -0
- package/lib/esm/serialization/SerializationHelpers.d.ts.map +1 -0
- package/lib/esm/serialization/SerializationHelpers.js +588 -0
- package/lib/esm/serialization/SerializationHelpers.js.map +1 -0
- package/lib/esm/topology/Graph.d.ts +399 -366
- package/lib/esm/topology/Graph.d.ts.map +1 -1
- package/lib/esm/topology/Graph.js +531 -464
- package/lib/esm/topology/Graph.js.map +1 -1
- package/lib/esm/topology/MaskManager.d.ts +8 -9
- package/lib/esm/topology/MaskManager.d.ts.map +1 -1
- package/lib/esm/topology/MaskManager.js +11 -12
- package/lib/esm/topology/MaskManager.js.map +1 -1
- package/package.json +3 -4
|
@@ -18,7 +18,7 @@ export declare class NumberArray {
|
|
|
18
18
|
/** Return true if arrays have identical counts and equal entries (using `!==` comparison) */
|
|
19
19
|
static isExactEqual(dataA: any[] | Float64Array | undefined, dataB: any[] | Float64Array | undefined): boolean;
|
|
20
20
|
/** Return true if arrays have identical counts and entries equal within tolerance */
|
|
21
|
-
static isAlmostEqual(dataA: number[] | Float64Array | undefined, dataB: number[] | Float64Array | undefined, tolerance
|
|
21
|
+
static isAlmostEqual(dataA: number[] | Float64Array | undefined, dataB: number[] | Float64Array | undefined, tolerance?: number): boolean;
|
|
22
22
|
/** return the sum of numbers in an array. Note that "PreciseSum" may be more accurate. */
|
|
23
23
|
static sum(data: number[] | Float64Array): number;
|
|
24
24
|
/** test if coordinate x appears (to tolerance by `Geometry.isSameCoordinate`) in this array of numbers */
|
|
@@ -42,8 +42,23 @@ export declare class NumberArray {
|
|
|
42
42
|
* @param step max permitted step
|
|
43
43
|
*/
|
|
44
44
|
static createArrayWithMaxStepSize(low: number, high: number, step: number): number[];
|
|
45
|
-
/**
|
|
45
|
+
/** Copy numbers from variant sources to number[]. */
|
|
46
46
|
static create(source: number[] | Float64Array): number[];
|
|
47
|
+
/** Copy number[][]. */
|
|
48
|
+
static copy2d(source: number[][]): number[][];
|
|
49
|
+
/** Copy number[][][]. */
|
|
50
|
+
static copy3d(source: number[][][]): number[][][];
|
|
51
|
+
/** Copy numbers from Float64Array to number[][].
|
|
52
|
+
* @param numPerBlock block size
|
|
53
|
+
*/
|
|
54
|
+
static unpack2d(source: Float64Array, numPerBlock: number): number[][] | undefined;
|
|
55
|
+
/** Copy numbers from Float64Array to number[][][].
|
|
56
|
+
* @param numPerRow row size
|
|
57
|
+
* @param numPerBlock block size
|
|
58
|
+
*/
|
|
59
|
+
static unpack3d(source: Float64Array, numPerRow: number, numPerBlock: number): number[][][] | undefined;
|
|
60
|
+
/** Copy numbers from 1d/2d/3d array to Float64Array. */
|
|
61
|
+
static pack(source: number[] | number[][] | number[][][]): Float64Array;
|
|
47
62
|
/** Return a copy of the knots array, with multiplicity of first and last knots raised or lowered to expectedMultiplicity. */
|
|
48
63
|
static cloneWithStartAndEndMultiplicity(knots: number[] | undefined, target0: number, target1: number): number[];
|
|
49
64
|
/** Compute the linear combination s of the numbers and scales.
|
|
@@ -96,13 +111,30 @@ export declare class Vector3dArray {
|
|
|
96
111
|
* @public
|
|
97
112
|
*/
|
|
98
113
|
export declare class Point4dArray {
|
|
99
|
-
/**
|
|
114
|
+
/**
|
|
115
|
+
* Copy each weighted point and its corresponding weight into a packed buffer.
|
|
116
|
+
* @param data array of weighted xyz
|
|
117
|
+
* @param weights scalar weight array
|
|
118
|
+
* @param result optional destination array. If insufficiently sized, a new array is returned.
|
|
119
|
+
* @return packed weighted point array
|
|
120
|
+
*/
|
|
100
121
|
static packPointsAndWeightsToFloat64Array(data: Point3d[] | Float64Array | number[], weights: number[] | Float64Array, result?: Float64Array): Float64Array | undefined;
|
|
101
|
-
/**
|
|
122
|
+
/**
|
|
123
|
+
* Copy 4d points into a packed buffer.
|
|
124
|
+
* @param data array of xyzw
|
|
125
|
+
* @param result optional destination array. If insufficiently sized, a new array is returned.
|
|
126
|
+
* @return packed point array
|
|
127
|
+
*/
|
|
102
128
|
static packToFloat64Array(data: Point4d[], result?: Float64Array): Float64Array;
|
|
103
129
|
/** unpack from ... to array of Point4d */
|
|
104
130
|
static unpackToPoint4dArray(data: Float64Array): Point4d[];
|
|
105
|
-
/**
|
|
131
|
+
/**
|
|
132
|
+
* Unpack packed 4D data to a Point3d array and an array of weights.
|
|
133
|
+
* * `WeightStyle` of `data` is not assumed. If input data is of form [a,b,c,d], default output arrays will have form [a,b,c] and [d].
|
|
134
|
+
* @param data input 4D points (packed)
|
|
135
|
+
* @param points output 3D data
|
|
136
|
+
* @param weights output weights (w portion of input)
|
|
137
|
+
* @param pointFormatter optional xyz formatter. By default, returns a Point3d created from the xyz portion of the input.
|
|
106
138
|
*/
|
|
107
139
|
static unpackFloat64ArrayToPointsAndWeights(data: Float64Array, points: Point3d[], weights: number[], pointFormatter?: (x: number, y: number, z: number) => any): void;
|
|
108
140
|
private static _workPoint4d;
|
|
@@ -112,7 +144,7 @@ export declare class Point4dArray {
|
|
|
112
144
|
* @param xyzw array of x,y,z,w points.
|
|
113
145
|
*/
|
|
114
146
|
static multiplyInPlace(transform: Transform, xyzw: Float64Array): void;
|
|
115
|
-
/**
|
|
147
|
+
/** Test arrays for near equality of all corresponding numeric values, treated as coordinates. */
|
|
116
148
|
static isAlmostEqual(dataA: Point4d[] | Float64Array | undefined, dataB: Point4d[] | Float64Array | undefined): boolean;
|
|
117
149
|
/** return true iff all xyzw points' altitudes are within tolerance of the plane.*/
|
|
118
150
|
static isCloseToPlane(data: Point4d[] | Float64Array, plane: Plane3dByOriginAndUnitNormal, tolerance?: number): boolean;
|
|
@@ -122,8 +154,13 @@ export declare class Point4dArray {
|
|
|
122
154
|
* @public
|
|
123
155
|
*/
|
|
124
156
|
export declare class Point3dArray {
|
|
125
|
-
/**
|
|
126
|
-
|
|
157
|
+
/**
|
|
158
|
+
* Copy 3d points into a packed buffer.
|
|
159
|
+
* @param data array of xyz
|
|
160
|
+
* @param result optional destination array. If insufficiently sized, a new array is returned.
|
|
161
|
+
* @return packed point array
|
|
162
|
+
*/
|
|
163
|
+
static packToFloat64Array(data: Point3d[], result?: Float64Array): Float64Array;
|
|
127
164
|
/**
|
|
128
165
|
* Compute the 8 weights of trilinear mapping
|
|
129
166
|
* By appropriate choice of weights, this can be used for both point and derivative mappings.
|
|
@@ -187,14 +224,15 @@ export declare class Point3dArray {
|
|
|
187
224
|
*/
|
|
188
225
|
static unpackNumbersToNestedArrays(data: Float64Array, numPerBlock: number): any[];
|
|
189
226
|
/**
|
|
190
|
-
*
|
|
227
|
+
* Return a 3-dimensional array containing all the values of `data` in rows of numPerRow blocks of size numPerBlock.
|
|
191
228
|
* @param data simple array of numbers
|
|
192
|
-
* @param numPerBlock number of values in each block
|
|
229
|
+
* @param numPerBlock number of values in each block
|
|
230
|
+
* @param numPerRow number of blocks per row
|
|
193
231
|
*/
|
|
194
232
|
static unpackNumbersToNestedArraysIJK(data: Float64Array, numPerBlock: number, numPerRow: number): any[];
|
|
195
233
|
/** multiply a transform times each x,y,z triple and replace the x,y,z in the packed array */
|
|
196
234
|
static multiplyInPlace(transform: Transform, xyz: Float64Array): void;
|
|
197
|
-
/**
|
|
235
|
+
/** Test arrays for near equality of all corresponding numeric values, treated as coordinates. */
|
|
198
236
|
static isAlmostEqual(dataA: Point3d[] | Float64Array | undefined, dataB: Point3d[] | Float64Array | undefined): boolean;
|
|
199
237
|
/** return simple average of all coordinates. (000 if empty array) */
|
|
200
238
|
static centroid(points: IndexedXYZCollection | Point3d[], result?: Point3d): Point3d;
|
|
@@ -255,18 +293,18 @@ export declare class Point3dArray {
|
|
|
255
293
|
*/
|
|
256
294
|
static cloneDeepXYZPoint3dArrays(data: MultiLineStringDataVariant): any[];
|
|
257
295
|
/**
|
|
258
|
-
*
|
|
259
|
-
* *
|
|
260
|
-
* * false ==>
|
|
261
|
-
* * true ==>
|
|
262
|
-
*
|
|
296
|
+
* Return perpendicular distance from points[indexB] to the segment from points[indexA] to points[indexC].
|
|
297
|
+
* * Extrapolation options when the projection is outside of the fraction range [0,1] are:
|
|
298
|
+
* * false ==> return distance to closest endpoint
|
|
299
|
+
* * true ==> return distance to extended line segment
|
|
300
|
+
* * There is no index checking!
|
|
263
301
|
*/
|
|
264
302
|
static distanceIndexedPointBToSegmentAC(points: Point3d[], indexA: number, indexB: number, indexC: number, extrapolate: boolean): number;
|
|
265
303
|
/** Computes the hull of the XY projection of points.
|
|
266
|
-
*
|
|
267
|
-
*
|
|
268
|
-
*
|
|
269
|
-
*
|
|
304
|
+
* @param points input points, z-coordinates ignored
|
|
305
|
+
* @param hullPoints (output) points on the convex hull (cloned from input points)
|
|
306
|
+
* @param insidePoints (output) points not on the convex hull (cloned from input points)
|
|
307
|
+
* @param addClosurePoint whether to append the first hull point to `hullPoints`
|
|
270
308
|
*/
|
|
271
309
|
static computeConvexHullXY(points: Point3d[], hullPoints: Point3d[], insidePoints: Point3d[], addClosurePoint?: boolean): void;
|
|
272
310
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PointHelpers.d.ts","sourceRoot":"","sources":["../../../src/geometry3d/PointHelpers.ts"],"names":[],"mappings":"AAWA,OAAO,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAC;AAChD,OAAO,EAAE,0BAA0B,EAAE,MAAM,2BAA2B,CAAC;AACvE,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAC9D,OAAO,EAAE,4BAA4B,EAAE,MAAM,gCAAgC,CAAC;AAC9E,OAAO,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAE5C,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AAE3D,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAiBrD;;;GAGG;AACH,qBA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EAAE;IAG1D;;;;OAIG;WACW,sBAAsB,CAAC,MAAM,EAAE,OAAO,EAAE,EAAE,aAAa,EAAE,MAAM,GAAG,OAAO,EAAE;IAczF,mDAAmD;IACnD,OAAO,CAAC,MAAM,CAAC,UAAU;IAEzB;;;OAGG;WACW,yBAAyB,CAAC,IAAI,EAAE,0BAA0B,GAAG,MAAM,EAAE,EAAE;IAKrF;;OAEG;WACW,0BAA0B,CAAC,IAAI,EAAE,QAAQ,EAAE,GAAG,MAAM,EAAE,EAAE;IAoBtE;;OAEG;WACW,2BAA2B,CAAC,IAAI,EAAE,QAAQ,EAAE,GAAG,YAAY;IAqBzE;;;OAGG;WACW,yBAAyB,CAAC,IAAI,EAAE,0BAA0B,GAAG,GAAG,EAAE;IAMhF;;;;;;OAMG;WACW,gCAAgC,CAAC,MAAM,EAAE,OAAO,EAAE,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,WAAW,EAAE,OAAO,GAAG,MAAM;IAoB/I;;;;;OAKG;WACW,mBAAmB,CAAC,MAAM,EAAE,OAAO,EAAE,EAAE,UAAU,EAAE,OAAO,EAAE,EAAE,YAAY,EAAE,OAAO,EAAE,EAAE,eAAe,GAAE,OAAe;IAiDrI;;;OAGG;WACW,YAAY,CAAC,IAAI,EAAE,OAAO,EAAE,GAAG;QAAE,SAAS,EAAE,OAAO,CAAC;QAAC,SAAS,EAAE,OAAO,CAAC;QAAC,SAAS,EAAE,OAAO,CAAC;QAAC,SAAS,EAAE,OAAO,CAAA;KAAE,GAAG,SAAS;CAc5I"}
|
|
@@ -65,12 +65,12 @@ export class NumberArray {
|
|
|
65
65
|
return (dataA === undefined && dataB === undefined);
|
|
66
66
|
}
|
|
67
67
|
/** Return true if arrays have identical counts and entries equal within tolerance */
|
|
68
|
-
static isAlmostEqual(dataA, dataB, tolerance) {
|
|
68
|
+
static isAlmostEqual(dataA, dataB, tolerance = Geometry.smallMetricDistance) {
|
|
69
69
|
if (dataA && dataB) {
|
|
70
70
|
if (dataA.length !== dataB.length)
|
|
71
71
|
return false;
|
|
72
72
|
for (let i = 0; i < dataA.length; i++)
|
|
73
|
-
if (Math.abs(dataA[i] - dataB[i])
|
|
73
|
+
if (Math.abs(dataA[i] - dataB[i]) > tolerance)
|
|
74
74
|
return false;
|
|
75
75
|
return true;
|
|
76
76
|
}
|
|
@@ -156,13 +156,97 @@ export class NumberArray {
|
|
|
156
156
|
result.push(high);
|
|
157
157
|
return result;
|
|
158
158
|
}
|
|
159
|
-
/**
|
|
159
|
+
/** Copy numbers from variant sources to number[]. */
|
|
160
160
|
static create(source) {
|
|
161
161
|
const result = [];
|
|
162
162
|
for (const q of source)
|
|
163
163
|
result.push(q);
|
|
164
164
|
return result;
|
|
165
165
|
}
|
|
166
|
+
/** Copy number[][]. */
|
|
167
|
+
static copy2d(source) {
|
|
168
|
+
const result = [];
|
|
169
|
+
for (const row of source) {
|
|
170
|
+
const newRow = [];
|
|
171
|
+
for (const entry of row)
|
|
172
|
+
newRow.push(entry);
|
|
173
|
+
result.push(newRow);
|
|
174
|
+
}
|
|
175
|
+
return result;
|
|
176
|
+
}
|
|
177
|
+
/** Copy number[][][]. */
|
|
178
|
+
static copy3d(source) {
|
|
179
|
+
const result = [];
|
|
180
|
+
for (const row of source) {
|
|
181
|
+
const newRow = [];
|
|
182
|
+
for (const block of row) {
|
|
183
|
+
const newBlock = [];
|
|
184
|
+
for (const entry of block)
|
|
185
|
+
newBlock.push(entry);
|
|
186
|
+
newRow.push(newBlock);
|
|
187
|
+
}
|
|
188
|
+
result.push(newRow);
|
|
189
|
+
}
|
|
190
|
+
return result;
|
|
191
|
+
}
|
|
192
|
+
/** Copy numbers from Float64Array to number[][].
|
|
193
|
+
* @param numPerBlock block size
|
|
194
|
+
*/
|
|
195
|
+
static unpack2d(source, numPerBlock) {
|
|
196
|
+
if (numPerBlock < 1)
|
|
197
|
+
return undefined;
|
|
198
|
+
return Point3dArray.unpackNumbersToNestedArrays(source, numPerBlock);
|
|
199
|
+
}
|
|
200
|
+
/** Copy numbers from Float64Array to number[][][].
|
|
201
|
+
* @param numPerRow row size
|
|
202
|
+
* @param numPerBlock block size
|
|
203
|
+
*/
|
|
204
|
+
static unpack3d(source, numPerRow, numPerBlock) {
|
|
205
|
+
if (numPerBlock < 1 || numPerRow < 1)
|
|
206
|
+
return undefined;
|
|
207
|
+
return Point3dArray.unpackNumbersToNestedArraysIJK(source, numPerBlock, numPerRow);
|
|
208
|
+
}
|
|
209
|
+
/** Copy numbers from 1d/2d/3d array to Float64Array. */
|
|
210
|
+
static pack(source) {
|
|
211
|
+
const numRows = source.length;
|
|
212
|
+
let numPerRow = 0;
|
|
213
|
+
let numPerBlock = 0;
|
|
214
|
+
let numCoords = 0;
|
|
215
|
+
if (numRows > 0) {
|
|
216
|
+
numCoords = numRows;
|
|
217
|
+
if (Array.isArray(source[0])) {
|
|
218
|
+
numPerRow = source[0].length;
|
|
219
|
+
if (numPerRow > 0) {
|
|
220
|
+
numCoords *= numPerRow;
|
|
221
|
+
if (Array.isArray(source[0][0])) {
|
|
222
|
+
numPerBlock = source[0][0].length;
|
|
223
|
+
if (numPerBlock > 0)
|
|
224
|
+
numCoords *= numPerBlock;
|
|
225
|
+
}
|
|
226
|
+
}
|
|
227
|
+
}
|
|
228
|
+
}
|
|
229
|
+
const result = new Float64Array(numCoords);
|
|
230
|
+
if (numPerBlock > 0) {
|
|
231
|
+
const src3d = source;
|
|
232
|
+
for (let i = 0, c = 0; i < numRows; ++i)
|
|
233
|
+
for (let j = 0; j < numPerRow; ++j)
|
|
234
|
+
for (let k = 0; k < numPerBlock; ++k)
|
|
235
|
+
result[c++] = src3d[i][j][k];
|
|
236
|
+
}
|
|
237
|
+
else if (numPerRow > 0) {
|
|
238
|
+
const src2d = source;
|
|
239
|
+
for (let i = 0, c = 0; i < numRows; ++i)
|
|
240
|
+
for (let j = 0; j < numPerRow; ++j)
|
|
241
|
+
result[c++] = src2d[i][j];
|
|
242
|
+
}
|
|
243
|
+
else if (numRows > 0) {
|
|
244
|
+
const src1d = source;
|
|
245
|
+
for (let i = 0, c = 0; i < numRows; ++i)
|
|
246
|
+
result[c++] = src1d[i];
|
|
247
|
+
}
|
|
248
|
+
return result;
|
|
249
|
+
}
|
|
166
250
|
/** Return a copy of the knots array, with multiplicity of first and last knots raised or lowered to expectedMultiplicity. */
|
|
167
251
|
static cloneWithStartAndEndMultiplicity(knots, target0, target1) {
|
|
168
252
|
const result = [];
|
|
@@ -293,16 +377,23 @@ export class Vector3dArray {
|
|
|
293
377
|
* @public
|
|
294
378
|
*/
|
|
295
379
|
class Point4dArray {
|
|
296
|
-
/**
|
|
380
|
+
/**
|
|
381
|
+
* Copy each weighted point and its corresponding weight into a packed buffer.
|
|
382
|
+
* @param data array of weighted xyz
|
|
383
|
+
* @param weights scalar weight array
|
|
384
|
+
* @param result optional destination array. If insufficiently sized, a new array is returned.
|
|
385
|
+
* @return packed weighted point array
|
|
386
|
+
*/
|
|
297
387
|
static packPointsAndWeightsToFloat64Array(data, weights, result) {
|
|
388
|
+
let points;
|
|
298
389
|
if (Array.isArray(data) && data[0] instanceof Point3d) {
|
|
299
|
-
|
|
390
|
+
points = data;
|
|
300
391
|
if (points.length !== weights.length)
|
|
301
392
|
return undefined;
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
for (k = 0; k < points.length; k++) {
|
|
393
|
+
const numValues = 4 * points.length;
|
|
394
|
+
if (!result || result.length < numValues)
|
|
395
|
+
result = new Float64Array(numValues);
|
|
396
|
+
for (let i = 0, k = 0; k < points.length; k++) {
|
|
306
397
|
result[i++] = points[k].x;
|
|
307
398
|
result[i++] = points[k].y;
|
|
308
399
|
result[i++] = points[k].z;
|
|
@@ -310,28 +401,32 @@ class Point4dArray {
|
|
|
310
401
|
}
|
|
311
402
|
return result;
|
|
312
403
|
}
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
result[i++] = weights[k];
|
|
327
|
-
}
|
|
328
|
-
return result;
|
|
404
|
+
points = data;
|
|
405
|
+
const numPoints = weights.length;
|
|
406
|
+
if (points.length !== 3 * numPoints)
|
|
407
|
+
return undefined;
|
|
408
|
+
const numValues1 = 4 * numPoints;
|
|
409
|
+
if (!result || result.length < numValues1)
|
|
410
|
+
result = new Float64Array(numValues1);
|
|
411
|
+
for (let i = 0, k = 0; k < numPoints; k++) {
|
|
412
|
+
const k0 = 3 * k;
|
|
413
|
+
result[i++] = points[k0];
|
|
414
|
+
result[i++] = points[k0 + 1];
|
|
415
|
+
result[i++] = points[k0 + 2];
|
|
416
|
+
result[i++] = weights[k];
|
|
329
417
|
}
|
|
330
|
-
return
|
|
418
|
+
return result;
|
|
331
419
|
}
|
|
332
|
-
/**
|
|
420
|
+
/**
|
|
421
|
+
* Copy 4d points into a packed buffer.
|
|
422
|
+
* @param data array of xyzw
|
|
423
|
+
* @param result optional destination array. If insufficiently sized, a new array is returned.
|
|
424
|
+
* @return packed point array
|
|
425
|
+
*/
|
|
333
426
|
static packToFloat64Array(data, result) {
|
|
334
|
-
|
|
427
|
+
const numValues = 4 * data.length;
|
|
428
|
+
if (!result || result.length < numValues)
|
|
429
|
+
result = new Float64Array(numValues);
|
|
335
430
|
let i = 0;
|
|
336
431
|
for (const p of data) {
|
|
337
432
|
result[i++] = p.x;
|
|
@@ -349,7 +444,13 @@ class Point4dArray {
|
|
|
349
444
|
}
|
|
350
445
|
return result;
|
|
351
446
|
}
|
|
352
|
-
/**
|
|
447
|
+
/**
|
|
448
|
+
* Unpack packed 4D data to a Point3d array and an array of weights.
|
|
449
|
+
* * `WeightStyle` of `data` is not assumed. If input data is of form [a,b,c,d], default output arrays will have form [a,b,c] and [d].
|
|
450
|
+
* @param data input 4D points (packed)
|
|
451
|
+
* @param points output 3D data
|
|
452
|
+
* @param weights output weights (w portion of input)
|
|
453
|
+
* @param pointFormatter optional xyz formatter. By default, returns a Point3d created from the xyz portion of the input.
|
|
353
454
|
*/
|
|
354
455
|
static unpackFloat64ArrayToPointsAndWeights(data, points, weights, pointFormatter = (x, y, z) => Point3d.create(x, y, z)) {
|
|
355
456
|
points.length = 0;
|
|
@@ -375,21 +476,36 @@ class Point4dArray {
|
|
|
375
476
|
xyzw[i + 3] = xyzw1.w;
|
|
376
477
|
}
|
|
377
478
|
}
|
|
378
|
-
/**
|
|
479
|
+
/** Test arrays for near equality of all corresponding numeric values, treated as coordinates. */
|
|
379
480
|
static isAlmostEqual(dataA, dataB) {
|
|
380
481
|
if (dataA && dataB) {
|
|
381
|
-
if (dataA.length !== dataB.length)
|
|
382
|
-
return false;
|
|
383
482
|
if (dataA instanceof Float64Array && dataB instanceof Float64Array) {
|
|
483
|
+
if (dataA.length !== dataB.length)
|
|
484
|
+
return false;
|
|
384
485
|
for (let i = 0; i < dataA.length; i++)
|
|
385
486
|
if (!Geometry.isSameCoordinate(dataA[i], dataB[i]))
|
|
386
487
|
return false;
|
|
387
488
|
}
|
|
388
489
|
else if (Array.isArray(dataA) && Array.isArray(dataB)) {
|
|
490
|
+
if (dataA.length !== dataB.length)
|
|
491
|
+
return false;
|
|
389
492
|
for (let i = 0; i < dataA.length; i++)
|
|
390
493
|
if (!dataA[i].isAlmostEqual(dataB[i]))
|
|
391
494
|
return false;
|
|
392
495
|
}
|
|
496
|
+
else { // different types
|
|
497
|
+
const points = dataA instanceof Float64Array ? dataB : dataA;
|
|
498
|
+
const numbers = dataA instanceof Float64Array ? dataA : dataB;
|
|
499
|
+
if (numbers.length !== points.length * 4)
|
|
500
|
+
return false;
|
|
501
|
+
for (let iPoint = 0; iPoint < points.length; ++iPoint) {
|
|
502
|
+
if (!Geometry.isSameCoordinate(points[iPoint].x, numbers[4 * iPoint]) ||
|
|
503
|
+
!Geometry.isSameCoordinate(points[iPoint].y, numbers[4 * iPoint + 1]) ||
|
|
504
|
+
!Geometry.isSameCoordinate(points[iPoint].z, numbers[4 * iPoint + 2]) ||
|
|
505
|
+
!Geometry.isSameCoordinate(points[iPoint].w, numbers[4 * iPoint + 3]))
|
|
506
|
+
return false;
|
|
507
|
+
}
|
|
508
|
+
}
|
|
393
509
|
return true;
|
|
394
510
|
}
|
|
395
511
|
// if both are null it is equal, otherwise unequal
|
|
@@ -420,9 +536,16 @@ export { Point4dArray };
|
|
|
420
536
|
* @public
|
|
421
537
|
*/
|
|
422
538
|
class Point3dArray {
|
|
423
|
-
/**
|
|
424
|
-
|
|
425
|
-
|
|
539
|
+
/**
|
|
540
|
+
* Copy 3d points into a packed buffer.
|
|
541
|
+
* @param data array of xyz
|
|
542
|
+
* @param result optional destination array. If insufficiently sized, a new array is returned.
|
|
543
|
+
* @return packed point array
|
|
544
|
+
*/
|
|
545
|
+
static packToFloat64Array(data, result) {
|
|
546
|
+
const numValues = 3 * data.length;
|
|
547
|
+
if (!result || result.length < numValues)
|
|
548
|
+
result = new Float64Array(numValues);
|
|
426
549
|
let i = 0;
|
|
427
550
|
for (const p of data) {
|
|
428
551
|
result[i++] = p.x;
|
|
@@ -558,9 +681,10 @@ class Point3dArray {
|
|
|
558
681
|
return result;
|
|
559
682
|
}
|
|
560
683
|
/**
|
|
561
|
-
*
|
|
684
|
+
* Return a 3-dimensional array containing all the values of `data` in rows of numPerRow blocks of size numPerBlock.
|
|
562
685
|
* @param data simple array of numbers
|
|
563
|
-
* @param numPerBlock number of values in each block
|
|
686
|
+
* @param numPerBlock number of values in each block
|
|
687
|
+
* @param numPerRow number of blocks per row
|
|
564
688
|
*/
|
|
565
689
|
static unpackNumbersToNestedArraysIJK(data, numPerBlock, numPerRow) {
|
|
566
690
|
const result = [];
|
|
@@ -596,21 +720,35 @@ class Point3dArray {
|
|
|
596
720
|
xyz[i + 2] = xyz1.z;
|
|
597
721
|
}
|
|
598
722
|
}
|
|
599
|
-
/**
|
|
723
|
+
/** Test arrays for near equality of all corresponding numeric values, treated as coordinates. */
|
|
600
724
|
static isAlmostEqual(dataA, dataB) {
|
|
601
725
|
if (dataA && dataB) {
|
|
602
|
-
if (dataA.length !== dataB.length)
|
|
603
|
-
return false;
|
|
604
726
|
if (dataA instanceof Float64Array && dataB instanceof Float64Array) {
|
|
727
|
+
if (dataA.length !== dataB.length)
|
|
728
|
+
return false;
|
|
605
729
|
for (let i = 0; i < dataA.length; i++)
|
|
606
730
|
if (!Geometry.isSameCoordinate(dataA[i], dataB[i]))
|
|
607
731
|
return false;
|
|
608
732
|
}
|
|
609
733
|
else if (Array.isArray(dataA) && Array.isArray(dataB)) {
|
|
734
|
+
if (dataA.length !== dataB.length)
|
|
735
|
+
return false;
|
|
610
736
|
for (let i = 0; i < dataA.length; i++)
|
|
611
737
|
if (!dataA[i].isAlmostEqual(dataB[i]))
|
|
612
738
|
return false;
|
|
613
739
|
}
|
|
740
|
+
else { // different types
|
|
741
|
+
const points = dataA instanceof Float64Array ? dataB : dataA;
|
|
742
|
+
const numbers = dataA instanceof Float64Array ? dataA : dataB;
|
|
743
|
+
if (numbers.length !== points.length * 3)
|
|
744
|
+
return false;
|
|
745
|
+
for (let iPoint = 0; iPoint < points.length; ++iPoint) {
|
|
746
|
+
if (!Geometry.isSameCoordinate(points[iPoint].x, numbers[3 * iPoint]) ||
|
|
747
|
+
!Geometry.isSameCoordinate(points[iPoint].y, numbers[3 * iPoint + 1]) ||
|
|
748
|
+
!Geometry.isSameCoordinate(points[iPoint].z, numbers[3 * iPoint + 2]))
|
|
749
|
+
return false;
|
|
750
|
+
}
|
|
751
|
+
}
|
|
614
752
|
return true;
|
|
615
753
|
}
|
|
616
754
|
// if both are null it is equal, otherwise unequal
|
|
@@ -819,7 +957,16 @@ class Point3dArray {
|
|
|
819
957
|
result.push([p.x, p.y, p.z]);
|
|
820
958
|
}
|
|
821
959
|
else if (Array.isArray(p)) {
|
|
822
|
-
|
|
960
|
+
const x = p.length > 0 ? p[0] : 0.0;
|
|
961
|
+
const y = p.length > 1 ? p[1] : 0.0;
|
|
962
|
+
const z = p.length > 2 ? p[2] : 0.0;
|
|
963
|
+
result.push([x, y, z]);
|
|
964
|
+
}
|
|
965
|
+
else {
|
|
966
|
+
const x = p.x !== undefined ? p.x : 0.0;
|
|
967
|
+
const y = p.y !== undefined ? p.y : 0.0;
|
|
968
|
+
const z = p.z !== undefined ? p.z : 0.0;
|
|
969
|
+
result.push([x, y, z]);
|
|
823
970
|
}
|
|
824
971
|
}
|
|
825
972
|
return result;
|
|
@@ -837,9 +984,14 @@ class Point3dArray {
|
|
|
837
984
|
result[i++] = p.z;
|
|
838
985
|
}
|
|
839
986
|
else if (Array.isArray(p)) {
|
|
840
|
-
result[i++] = p[0];
|
|
841
|
-
result[i++] = p[1];
|
|
842
|
-
result[i++] = p.length > 2 ? p[2] : 0.0;
|
|
987
|
+
result[i++] = p.length > 0 ? p[0] : 0.0;
|
|
988
|
+
result[i++] = p.length > 1 ? p[1] : 0.0;
|
|
989
|
+
result[i++] = p.length > 2 ? p[2] : 0.0;
|
|
990
|
+
}
|
|
991
|
+
else {
|
|
992
|
+
result[i++] = p.x !== undefined ? p.x : 0.0;
|
|
993
|
+
result[i++] = p.y !== undefined ? p.y : 0.0;
|
|
994
|
+
result[i++] = p.z !== undefined ? p.z : 0.0;
|
|
843
995
|
}
|
|
844
996
|
}
|
|
845
997
|
return result;
|
|
@@ -854,37 +1006,36 @@ class Point3dArray {
|
|
|
854
1006
|
return collector.claimResult();
|
|
855
1007
|
}
|
|
856
1008
|
/**
|
|
857
|
-
*
|
|
858
|
-
* *
|
|
859
|
-
* * false ==>
|
|
860
|
-
* * true ==>
|
|
861
|
-
*
|
|
1009
|
+
* Return perpendicular distance from points[indexB] to the segment from points[indexA] to points[indexC].
|
|
1010
|
+
* * Extrapolation options when the projection is outside of the fraction range [0,1] are:
|
|
1011
|
+
* * false ==> return distance to closest endpoint
|
|
1012
|
+
* * true ==> return distance to extended line segment
|
|
1013
|
+
* * There is no index checking!
|
|
862
1014
|
*/
|
|
863
1015
|
static distanceIndexedPointBToSegmentAC(points, indexA, indexB, indexC, extrapolate) {
|
|
864
1016
|
const vectorU = Vector3d.createStartEnd(points[indexA], points[indexC]);
|
|
865
1017
|
const vectorV = Vector3d.createStartEnd(points[indexA], points[indexB]);
|
|
866
1018
|
const uDotU = vectorU.dotProduct(vectorU);
|
|
867
1019
|
const uDotV = vectorU.dotProduct(vectorV);
|
|
868
|
-
|
|
1020
|
+
const fraction = Geometry.conditionalDivideFraction(uDotV, uDotU);
|
|
869
1021
|
if (fraction === undefined)
|
|
870
|
-
|
|
1022
|
+
return vectorV.magnitude(); // AC is degenerate; return ||B-A||
|
|
871
1023
|
if (!extrapolate) {
|
|
872
1024
|
if (fraction > 1.0)
|
|
873
|
-
|
|
1025
|
+
return points[indexB].distance(points[indexC]); // return ||B-C||
|
|
874
1026
|
if (fraction < 0.0)
|
|
875
|
-
|
|
1027
|
+
return vectorV.magnitude(); // return ||B-A||
|
|
876
1028
|
}
|
|
877
|
-
|
|
878
|
-
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
return Math.sqrt(h2);
|
|
1029
|
+
// return distance to projection on (extended) segment
|
|
1030
|
+
const h2 = vectorV.magnitudeSquared() - fraction * fraction * uDotU;
|
|
1031
|
+
// h2 should never be negative except for quirky tolerance...
|
|
1032
|
+
return h2 <= 0.0 ? 0.0 : Math.sqrt(h2);
|
|
882
1033
|
}
|
|
883
1034
|
/** Computes the hull of the XY projection of points.
|
|
884
|
-
*
|
|
885
|
-
*
|
|
886
|
-
*
|
|
887
|
-
*
|
|
1035
|
+
* @param points input points, z-coordinates ignored
|
|
1036
|
+
* @param hullPoints (output) points on the convex hull (cloned from input points)
|
|
1037
|
+
* @param insidePoints (output) points not on the convex hull (cloned from input points)
|
|
1038
|
+
* @param addClosurePoint whether to append the first hull point to `hullPoints`
|
|
888
1039
|
*/
|
|
889
1040
|
static computeConvexHullXY(points, hullPoints, insidePoints, addClosurePoint = false) {
|
|
890
1041
|
hullPoints.length = 0;
|