@itwin/core-geometry 4.3.0-dev.9 → 4.4.0-dev.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +38 -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
|
@@ -8,39 +8,35 @@
|
|
|
8
8
|
import { Geometry } from "../Geometry";
|
|
9
9
|
import { NumberArray } from "../geometry3d/PointHelpers";
|
|
10
10
|
/**
|
|
11
|
-
*
|
|
12
|
-
*
|
|
13
|
-
* OpenByAddingControlPoints (1) ==> wrapped by adding poles
|
|
14
|
-
* OpenByRemovingKnots (2) ==> wrapped by deleting extreme knots.
|
|
11
|
+
* B-spline curve and surface types in this library are non-periodic. But they can be created from legacy periodic data.
|
|
12
|
+
* This enumeration lists the possible ways a B-spline object can have been created from legacy periodic data.
|
|
15
13
|
* @public
|
|
16
14
|
*/
|
|
17
15
|
export var BSplineWrapMode;
|
|
18
16
|
(function (BSplineWrapMode) {
|
|
19
|
-
/** No conversion
|
|
17
|
+
/** No conversion performed. */
|
|
20
18
|
BSplineWrapMode[BSplineWrapMode["None"] = 0] = "None";
|
|
21
|
-
/**
|
|
22
|
-
* *
|
|
23
|
-
* *
|
|
19
|
+
/** The B-spline was opened up by adding degree wrap-around control points to the legacy periodic data.
|
|
20
|
+
* * This is typical of B-splines constructed with maximum (degree - 1) continuity.
|
|
21
|
+
* * Knots are unaffected by this conversion.
|
|
24
22
|
*/
|
|
25
23
|
BSplineWrapMode[BSplineWrapMode["OpenByAddingControlPoints"] = 1] = "OpenByAddingControlPoints";
|
|
26
|
-
/**
|
|
27
|
-
* *
|
|
28
|
-
* *
|
|
24
|
+
/** The B-spline was opened up by removing degree extreme knots from the legacy periodic data.
|
|
25
|
+
* * This is typical of rational B-spline curves representing full circles and ellipses.
|
|
26
|
+
* * Poles are unaffected by this conversion.
|
|
29
27
|
*/
|
|
30
28
|
BSplineWrapMode[BSplineWrapMode["OpenByRemovingKnots"] = 2] = "OpenByRemovingKnots";
|
|
31
29
|
})(BSplineWrapMode || (BSplineWrapMode = {}));
|
|
32
30
|
/**
|
|
33
|
-
* Array of non-decreasing numbers acting as a knot array for
|
|
31
|
+
* Array of non-decreasing numbers acting as a knot array for B-splines.
|
|
34
32
|
*
|
|
35
33
|
* * Essential identity: numKnots = numPoles + order - 2 = numPoles + degree - 1
|
|
36
|
-
* * Various
|
|
37
|
-
*
|
|
38
|
-
* * This class uses the "order-1" convention.
|
|
39
|
-
* * This class provides queries to convert among spanIndex and knotIndex
|
|
34
|
+
* * Various B-spline libraries have confusion over how many "end knots" are needed. Many libraries (including MicroStation and Parasolid)
|
|
35
|
+
* demand order knots at each end for clamping. But only order-1 are really needed. This class uses the order-1 convention.
|
|
40
36
|
* * A span is a single interval of the knots.
|
|
41
|
-
* * The left knot of span {k} is knot {k+degree-1}
|
|
42
|
-
* * This class provides queries to convert among spanFraction, fraction of knot range, and knot
|
|
43
|
-
* *
|
|
37
|
+
* * The left knot of span {k} is knot {k+degree-1}.
|
|
38
|
+
* * This class provides queries to convert among spanIndex, knotIndex, spanFraction, fraction of knot range, and knot.
|
|
39
|
+
* * Core computations (evaluateBasisFunctions) have leftKnotIndex and global knot value as inputs. Callers need to
|
|
44
40
|
* know their primary values (global knot, spanFraction).
|
|
45
41
|
* @public
|
|
46
42
|
*/
|
|
@@ -53,7 +49,7 @@ class KnotVector {
|
|
|
53
49
|
get leftKnotIndex() { return this.degree - 1; }
|
|
54
50
|
/** Return the index of the rightmost knot of the active interval */
|
|
55
51
|
get rightKnotIndex() { return this.knots.length - this.degree; }
|
|
56
|
-
/** Whether
|
|
52
|
+
/** Whether this KnotVector was created by converting legacy periodic data during deserialization. The conversion used is specified by BSplineWrapMode, and is reversed at serialization time. */
|
|
57
53
|
get wrappable() { return this._wrapMode === undefined ? BSplineWrapMode.None : this._wrapMode; }
|
|
58
54
|
set wrappable(value) { this._wrapMode = value; }
|
|
59
55
|
/** Return the number of bezier spans. Note that this includes zero-length spans if there are repeated knots. */
|
|
@@ -68,7 +64,7 @@ class KnotVector {
|
|
|
68
64
|
constructor(knots, degree, wrapMode) {
|
|
69
65
|
this.degree = degree;
|
|
70
66
|
this._wrapMode = wrapMode;
|
|
71
|
-
// default values to satisfy compiler -- real values
|
|
67
|
+
// default values to satisfy compiler -- real values happen in setupFixedValues, or final else defers to user
|
|
72
68
|
this._knot0 = 0.0;
|
|
73
69
|
this._knot1 = 1.0;
|
|
74
70
|
// satisfy the initialize checker ..
|
|
@@ -88,43 +84,43 @@ class KnotVector {
|
|
|
88
84
|
/** copy degree and knots to a new KnotVector. */
|
|
89
85
|
clone() { return new KnotVector(this.knots, this.degree, this.wrappable); }
|
|
90
86
|
setupFixedValues() {
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
87
|
+
if (this.degree > 0 && this.knots.length > this.degree) {
|
|
88
|
+
this._knot0 = this.knots[this.degree - 1];
|
|
89
|
+
this._knot1 = this.knots[this.knots.length - this.degree];
|
|
90
|
+
}
|
|
94
91
|
}
|
|
95
92
|
/** Return the total knot distance from beginning to end. */
|
|
96
93
|
get knotLength01() { return this._knot1 - this._knot0; }
|
|
97
94
|
/**
|
|
98
|
-
* Returns true if all numeric values have wraparound conditions
|
|
99
|
-
* @param mode optional test mode. If undefined, use
|
|
95
|
+
* Returns true if all numeric values have wraparound conditions that allow the knots to be closed with specified wrap mode.
|
|
96
|
+
* @param mode optional test mode. If undefined, use this.wrappable.
|
|
100
97
|
*/
|
|
101
98
|
testClosable(mode) {
|
|
102
99
|
if (mode === undefined)
|
|
103
100
|
mode = this.wrappable;
|
|
101
|
+
const degree = this.degree;
|
|
104
102
|
const leftKnotIndex = this.leftKnotIndex;
|
|
105
103
|
const rightKnotIndex = this.rightKnotIndex;
|
|
106
|
-
const period = this.rightKnot - this.leftKnot;
|
|
107
|
-
const degree = this.degree;
|
|
108
|
-
const indexDelta = rightKnotIndex - leftKnotIndex;
|
|
109
|
-
// maximum continuity mode . . .
|
|
110
104
|
if (mode === BSplineWrapMode.OpenByAddingControlPoints) {
|
|
111
|
-
|
|
105
|
+
// maximum continuity mode: we expect degree periodically extended knots at each end
|
|
106
|
+
const period = this.rightKnot - this.leftKnot;
|
|
107
|
+
const indexDelta = rightKnotIndex - leftKnotIndex;
|
|
108
|
+
for (let k0 = 0; k0 < leftKnotIndex + degree; k0++) {
|
|
112
109
|
const k1 = k0 + indexDelta;
|
|
113
|
-
if (
|
|
110
|
+
if (Math.abs(this.knots[k0] + period - this.knots[k1]) >= KnotVector.knotTolerance)
|
|
114
111
|
return false;
|
|
115
112
|
}
|
|
116
113
|
return true;
|
|
117
114
|
}
|
|
118
|
-
// arc mode ...
|
|
119
115
|
if (mode === BSplineWrapMode.OpenByRemovingKnots) {
|
|
120
|
-
// we expect
|
|
116
|
+
// legacy periodic mode: we expect multiplicity degree knots at each end
|
|
121
117
|
const numRepeated = degree - 1;
|
|
122
|
-
const leftKnot = this.
|
|
123
|
-
const rightKnot = this.
|
|
118
|
+
const leftKnot = this.leftKnot;
|
|
119
|
+
const rightKnot = this.rightKnot;
|
|
124
120
|
for (let i = 0; i < numRepeated; i++) {
|
|
125
|
-
if (
|
|
121
|
+
if (Math.abs(leftKnot - this.knots[leftKnotIndex - i - 1]) >= KnotVector.knotTolerance)
|
|
126
122
|
return false;
|
|
127
|
-
if (
|
|
123
|
+
if (Math.abs(rightKnot - this.knots[rightKnotIndex + i + 1]) >= KnotVector.knotTolerance)
|
|
128
124
|
return false;
|
|
129
125
|
}
|
|
130
126
|
return true;
|
|
@@ -206,7 +202,7 @@ class KnotVector {
|
|
|
206
202
|
}
|
|
207
203
|
this.setupFixedValues();
|
|
208
204
|
}
|
|
209
|
-
/**
|
|
205
|
+
/** Set knots to input array (CAPTURED) */
|
|
210
206
|
setKnotsCapture(knots) {
|
|
211
207
|
this.knots = knots;
|
|
212
208
|
this.setupFixedValues();
|
|
@@ -300,19 +296,22 @@ class KnotVector {
|
|
|
300
296
|
* Evaluate basis functions f[] at knot value u.
|
|
301
297
|
*
|
|
302
298
|
* @param u knot value for evaluation
|
|
303
|
-
* @param f array of order basis function values
|
|
299
|
+
* @param f preallocated output array of order basis function values
|
|
300
|
+
* @returns true if and only if output array is sufficiently sized
|
|
304
301
|
*/
|
|
305
302
|
evaluateBasisFunctions(knotIndex0, u, f) {
|
|
303
|
+
if (f.length < this.degree + 1)
|
|
304
|
+
return false;
|
|
306
305
|
f[0] = 1.0;
|
|
307
306
|
if (this.degree < 1)
|
|
308
|
-
return;
|
|
307
|
+
return true;
|
|
309
308
|
// direct compute for linear part ...
|
|
310
309
|
const u0 = this.knots[knotIndex0];
|
|
311
310
|
const u1 = this.knots[knotIndex0 + 1];
|
|
312
311
|
f[1] = (u - u0) / (u1 - u0);
|
|
313
312
|
f[0] = 1.0 - f[1];
|
|
314
313
|
if (this.degree < 2)
|
|
315
|
-
return;
|
|
314
|
+
return true;
|
|
316
315
|
for (let depth = 1; depth < this.degree; depth++) {
|
|
317
316
|
let kLeft = knotIndex0 - depth;
|
|
318
317
|
let kRight = kLeft + depth + 1;
|
|
@@ -328,20 +327,28 @@ class KnotVector {
|
|
|
328
327
|
}
|
|
329
328
|
f[depth + 1] = gCarry;
|
|
330
329
|
}
|
|
330
|
+
return true;
|
|
331
331
|
}
|
|
332
332
|
/**
|
|
333
333
|
* Evaluate basis functions f[], derivatives df[], and optional second derivatives ddf[] at knot value u.
|
|
334
334
|
*
|
|
335
335
|
* @param u knot value for evaluation
|
|
336
|
-
* @param f array of order basis function values
|
|
337
|
-
* @param df array of order basis derivative values
|
|
338
|
-
* @param ddf array of order basis second derivative values
|
|
336
|
+
* @param f preallocated output array of order basis function values
|
|
337
|
+
* @param df preallocated output array of order basis derivative values
|
|
338
|
+
* @param ddf optional preallocated output array of order basis second derivative values
|
|
339
|
+
* @returns true if and only if output arrays are sufficiently sized
|
|
339
340
|
*/
|
|
340
341
|
evaluateBasisFunctions1(knotIndex0, u, f, df, ddf) {
|
|
342
|
+
if (f.length < this.degree + 1)
|
|
343
|
+
return false;
|
|
344
|
+
if (df.length < this.degree + 1)
|
|
345
|
+
return false;
|
|
346
|
+
if (ddf && ddf.length < this.degree + 1)
|
|
347
|
+
return false;
|
|
341
348
|
f[0] = 1.0;
|
|
342
349
|
df[0] = 0.0;
|
|
343
350
|
if (this.degree < 1)
|
|
344
|
-
return;
|
|
351
|
+
return true;
|
|
345
352
|
// direct compute for linear part ...
|
|
346
353
|
const u0 = this.knots[knotIndex0];
|
|
347
354
|
const u1 = this.knots[knotIndex0 + 1];
|
|
@@ -357,7 +364,7 @@ class KnotVector {
|
|
|
357
364
|
ddf[1] = 0.0;
|
|
358
365
|
}
|
|
359
366
|
if (this.degree < 2)
|
|
360
|
-
return;
|
|
367
|
+
return true;
|
|
361
368
|
for (let depth = 1; depth < this.degree; depth++) {
|
|
362
369
|
let kLeft = knotIndex0 - depth;
|
|
363
370
|
let kRight = kLeft + depth + 1;
|
|
@@ -399,6 +406,7 @@ class KnotVector {
|
|
|
399
406
|
if (ddf)
|
|
400
407
|
ddf[depth + 1] = ddgCarry;
|
|
401
408
|
}
|
|
409
|
+
return true;
|
|
402
410
|
}
|
|
403
411
|
/** Find the knot span bracketing knots[i] <= u < knots[i+1] and return i.
|
|
404
412
|
* * If u has no such bracket, return the smaller index of the closest nontrivial bracket.
|
|
@@ -450,38 +458,37 @@ class KnotVector {
|
|
|
450
458
|
this.knots[i] = a + (b - this.knots[i]);
|
|
451
459
|
this.knots.reverse();
|
|
452
460
|
}
|
|
453
|
-
/**
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
const
|
|
459
|
-
const
|
|
460
|
-
const rightIndex = this.rightKnotIndex;
|
|
461
|
-
const a0 = this.leftKnot;
|
|
462
|
-
const a1 = this.rightKnot;
|
|
461
|
+
/** Return a simple array form of the knots. Optionally replicate the first and last in classic over-clamped manner. */
|
|
462
|
+
static copyKnots(knots, degree, includeExtraEndKnot, wrapMode) {
|
|
463
|
+
const isExtraEndKnotPeriodic = (includeExtraEndKnot && wrapMode === BSplineWrapMode.OpenByAddingControlPoints);
|
|
464
|
+
const leftIndex = degree - 1;
|
|
465
|
+
const rightIndex = knots.length - degree;
|
|
466
|
+
const a0 = knots[leftIndex];
|
|
467
|
+
const a1 = knots[rightIndex];
|
|
463
468
|
const delta = a1 - a0;
|
|
464
|
-
const degree = this.degree;
|
|
465
469
|
const values = [];
|
|
466
470
|
if (includeExtraEndKnot) {
|
|
467
|
-
if (
|
|
468
|
-
values.push(
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
values.push(this.knots[0]);
|
|
472
|
-
}
|
|
471
|
+
if (isExtraEndKnotPeriodic)
|
|
472
|
+
values.push(knots[rightIndex - degree] - delta);
|
|
473
|
+
else
|
|
474
|
+
values.push(knots[0]);
|
|
473
475
|
}
|
|
474
|
-
for (const u of
|
|
476
|
+
for (const u of knots) {
|
|
475
477
|
values.push(u);
|
|
478
|
+
}
|
|
476
479
|
if (includeExtraEndKnot) {
|
|
477
|
-
if (
|
|
478
|
-
values.push(
|
|
479
|
-
}
|
|
480
|
+
if (isExtraEndKnotPeriodic)
|
|
481
|
+
values.push(knots[leftIndex + degree] + delta);
|
|
480
482
|
else
|
|
481
|
-
values.push(
|
|
483
|
+
values.push(knots[knots.length - 1]);
|
|
482
484
|
}
|
|
483
485
|
return values;
|
|
484
486
|
}
|
|
487
|
+
/** Return a simple array form of the knots. Optionally replicate the first and last in classic over-clamped manner. */
|
|
488
|
+
copyKnots(includeExtraEndKnot) {
|
|
489
|
+
const wrapMode = (includeExtraEndKnot && this.testClosable()) ? this.wrappable : undefined;
|
|
490
|
+
return KnotVector.copyKnots(this.knots, this.degree, includeExtraEndKnot, wrapMode);
|
|
491
|
+
}
|
|
485
492
|
}
|
|
486
493
|
/** tolerance for considering two knots to be the same. */
|
|
487
494
|
KnotVector.knotTolerance = 1.0e-9;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"KnotVector.js","sourceRoot":"","sources":["../../../src/bspline/KnotVector.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAEH,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AACvC,OAAO,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC;AAEzD;;;;;;GAMG;AACH,MAAM,CAAN,IAAY,eAaX;AAbD,WAAY,eAAe;IACzB,gCAAgC;IAChC,qDAAQ,CAAA;IACR;;;OAGG;IACH,+FAA6B,CAAA;IAC7B;;;OAGG;IACH,mFAAuB,CAAA;AACzB,CAAC,EAbW,eAAe,KAAf,eAAe,QAa1B;AACD;;;;;;;;;;;;;;GAcG;AACH,MAAa,UAAU;IAWrB,+FAA+F;IAC/F,IAAW,QAAQ,KAAK,OAAO,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC;IAC7C,gGAAgG;IAChG,IAAW,SAAS,KAAK,OAAO,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC;IAC9C,mEAAmE;IACnE,IAAW,aAAa,KAAK,OAAO,IAAI,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC;IACtD,oEAAoE;IACpE,IAAW,cAAc,KAAK,OAAO,IAAI,CAAC,KAAK,CAAC,MAAM,GAAG,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC;IACvE,mLAAmL;IACnL,IAAW,SAAS,KAAK,OAAO,IAAI,CAAC,SAAS,KAAK,SAAS,CAAC,CAAC,C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M,MAAM,GAAa,EAAE,CAAC;QAC5B,IAAI,mBAAmB,EAAE;YACvB,IAAI,IAAI,EAAE;gBACR,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,UAAU,GAAG,MAAM,CAAC,GAAG,KAAK,CAAC,CAAC;aACtD;iBAAM;gBACL,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;aAC5B;SACF;QACD,KAAK,MAAM,CAAC,IAAI,IAAI,CAAC,KAAK;YAAE,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;QAC3C,IAAI,mBAAmB,EAAE;YACvB,IAAI,IAAI,EAAE;gBACR,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,SAAS,GAAG,MAAM,CAAC,GAAG,KAAK,CAAC,CAAC;aACrD;;gBACC,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC;SAC1C;QACD,OAAO,MAAM,CAAC;IAChB,CAAC;;AA7aD,0DAA0D;AACnC,wBAAa,GAAG,MAAM,CAAC;SAVnC,UAAU","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module Bspline\r\n */\r\n\r\nimport { Geometry } from \"../Geometry\";\r\nimport { NumberArray } from \"../geometry3d/PointHelpers\";\r\n\r\n/**\r\n * Enumeration of the possible ways of converting a \"periodic\" knot vector to an open knot vector.\r\n * None (0) ==> no wrap possible\r\n * OpenByAddingControlPoints (1) ==> wrapped by adding poles\r\n * OpenByRemovingKnots (2) ==> wrapped by deleting extreme knots.\r\n * @public\r\n */\r\nexport enum BSplineWrapMode {\r\n /** No conversion to periodic */\r\n None = 0,\r\n /** Convert to periodic by removing control points. This is typical for closed bcurve constructed by control points with maximum continuity.\r\n * * Knots stay the same in open and periodic form.\r\n * * Periodic form omits {degree} control points.\r\n */\r\n OpenByAddingControlPoints = 1,\r\n /** Convert to periodic by adding special knots. This is typical of closed bcurve constructed as exact circular or elliptic arc\r\n * * 2 knots on each end are omitted in open form\r\n * * poles stay the same.\r\n */\r\n OpenByRemovingKnots = 2,\r\n}\r\n/**\r\n * Array of non-decreasing numbers acting as a knot array for bsplines.\r\n *\r\n * * Essential identity: numKnots = numPoles + order - 2 = numPoles + degree - 1\r\n * * Various bspline libraries have confusion over how many \"end knots\" are needed. \"Many\" libraries (including MicroStation)\r\n * incorrectly demand \"order\" knots at each end for clamping. But only \"order - 1\" are really needed.\r\n * * This class uses the \"order-1\" convention.\r\n * * This class provides queries to convert among spanIndex and knotIndex\r\n * * A span is a single interval of the knots.\r\n * * The left knot of span {k} is knot {k+degree-1}\r\n * * This class provides queries to convert among spanFraction, fraction of knot range, and knot\r\n * * core computations (evaluateBasisFunctions) have leftKnotIndex and global knot value as inputs. Callers need to\r\n * know their primary values (global knot, spanFraction).\r\n * @public\r\n */\r\nexport class KnotVector {\r\n /** The simple array of knot values. */\r\n public knots: Float64Array;\r\n /** Return the degree of basis functions defined in these knots. */\r\n public degree: number;\r\n private _knot0: number;\r\n private _knot1: number;\r\n\r\n private _wrapMode?: BSplineWrapMode;\r\n /** tolerance for considering two knots to be the same. */\r\n public static readonly knotTolerance = 1.0e-9;\r\n /** Return the leftmost knot value (of the active interval, ignoring unclamped leading knots)*/\r\n public get leftKnot() { return this._knot0; }\r\n /** Return the rightmost knot value (of the active interval, ignoring unclamped leading knots)*/\r\n public get rightKnot() { return this._knot1; }\r\n /** Return the index of the leftmost knot of the active interval */\r\n public get leftKnotIndex() { return this.degree - 1; }\r\n /** Return the index of the rightmost knot of the active interval */\r\n public get rightKnotIndex() { return this.knots.length - this.degree; }\r\n /** Whether the bspline was created by adding poles into \"closed\" structure. This is used by serialize/deserialize to mark knotVector's that were converted from periodic style. */\r\n public get wrappable() { return this._wrapMode === undefined ? BSplineWrapMode.None : this._wrapMode; }\r\n public set wrappable(value: BSplineWrapMode) { this._wrapMode = value; }\r\n /** Return the number of bezier spans. Note that this includes zero-length spans if there are repeated knots. */\r\n public get numSpans() { return this.rightKnotIndex - this.leftKnotIndex; }\r\n /**\r\n *\r\n * * If knots is a number array or Float64Array, the those values become the local knot array.\r\n * * If knots is a simple number, the local knot array is allocated to that size but left as zeros.\r\n * @param knots\r\n * @param degree\r\n */\r\n private constructor(knots: number[] | Float64Array | number, degree: number, wrapMode?: BSplineWrapMode) {\r\n this.degree = degree;\r\n this._wrapMode = wrapMode;\r\n // default values to satisfy compiler -- real values hapn setupFixedValues or final else defers to user\r\n this._knot0 = 0.0;\r\n this._knot1 = 1.0;\r\n // satisfy the initialize checker ..\r\n if (Array.isArray(knots)) { // remark: This ctor is private. The callers (as of April 2019) do not use this path.\r\n this.knots = new Float64Array(knots.length);\r\n this.setKnots(knots);\r\n this.setupFixedValues();\r\n } else if (knots instanceof Float64Array) {\r\n this.knots = knots.slice();\r\n this.setupFixedValues();\r\n } else { // caller is responsible for filling array separately ...\r\n this.knots = new Float64Array(knots);\r\n }\r\n }\r\n /** copy degree and knots to a new KnotVector. */\r\n public clone(): KnotVector { return new KnotVector(this.knots, this.degree, this.wrappable); }\r\n private setupFixedValues() {\r\n // These should be read-only . ..\r\n this._knot0 = this.knots[this.degree - 1];\r\n this._knot1 = this.knots[this.knots.length - this.degree];\r\n }\r\n /** Return the total knot distance from beginning to end. */\r\n public get knotLength01(): number { return this._knot1 - this._knot0; }\r\n /**\r\n * Returns true if all numeric values have wraparound conditions for \"closed\" knotVector with specified wrap mode\r\n * @param mode optional test mode. If undefined, use the this.wrappable.\r\n */\r\n public testClosable(mode?: BSplineWrapMode): boolean {\r\n if (mode === undefined)\r\n mode = this.wrappable;\r\n const leftKnotIndex = this.leftKnotIndex;\r\n const rightKnotIndex = this.rightKnotIndex;\r\n const period = this.rightKnot - this.leftKnot;\r\n const degree = this.degree;\r\n const indexDelta = rightKnotIndex - leftKnotIndex;\r\n // maximum continuity mode . . .\r\n if (mode === BSplineWrapMode.OpenByAddingControlPoints) {\r\n for (let k0 = leftKnotIndex - degree + 1; k0 < leftKnotIndex + degree - 1; k0++) {\r\n const k1 = k0 + indexDelta;\r\n if (!Geometry.isSameCoordinate(this.knots[k0] + period, this.knots[k1]))\r\n return false;\r\n }\r\n return true;\r\n }\r\n // arc mode ...\r\n if (mode === BSplineWrapMode.OpenByRemovingKnots) {\r\n // we expect {degree} replicated knots at each end . . .\r\n const numRepeated = degree - 1;\r\n const leftKnot = this.knots[leftKnotIndex];\r\n const rightKnot = this.knots[rightKnotIndex];\r\n for (let i = 0; i < numRepeated; i++) {\r\n if (!Geometry.isSameCoordinate(leftKnot, this.knots[leftKnotIndex - i - 1]))\r\n return false;\r\n if (!Geometry.isSameCoordinate(rightKnot, this.knots[rightKnotIndex + i + 1]))\r\n return false;\r\n }\r\n return true;\r\n }\r\n\r\n return false;\r\n }\r\n /** Test matching degree and knot values */\r\n public isAlmostEqual(other: KnotVector): boolean {\r\n if (this.degree !== other.degree) return false;\r\n return NumberArray.isAlmostEqual(this.knots, other.knots, KnotVector.knotTolerance);\r\n }\r\n\r\n /** Compute the multiplicity of the input knot, or zero if not a knot. */\r\n public getKnotMultiplicity(knot: number): number {\r\n let m = 0;\r\n for (const k of this.knots) {\r\n if (Math.abs(k - knot) < KnotVector.knotTolerance)\r\n ++m;\r\n else if (knot < k)\r\n break;\r\n }\r\n return m;\r\n }\r\n\r\n /** Compute the multiplicity of the knot at the given index. */\r\n public getKnotMultiplicityAtIndex(knotIndex: number): number {\r\n let m = 0;\r\n if (knotIndex >= 0 && knotIndex < this.knots.length) {\r\n const knot = this.knots[knotIndex];\r\n ++m; // count this knot\r\n for (let i = knotIndex - 1; i >= 0; --i) {\r\n const k = this.knots[i];\r\n if (Math.abs(k - knot) < KnotVector.knotTolerance)\r\n ++m; // found multiple to left of knot\r\n else if (knot > k)\r\n break;\r\n }\r\n for (let i = knotIndex + 1; i < this.knots.length; ++i) {\r\n const k = this.knots[i];\r\n if (Math.abs(k - knot) < KnotVector.knotTolerance)\r\n ++m; // found multiple to right of knot\r\n else if (knot < k)\r\n break;\r\n }\r\n }\r\n return m;\r\n }\r\n\r\n /** Transform knots to span [0,1].\r\n * @returns false if and only if this.knotLength01 is trivial\r\n */\r\n public normalize(): boolean {\r\n if (this.knotLength01 < KnotVector.knotTolerance)\r\n return false;\r\n const divisor = 1.0 / this.knotLength01;\r\n const leftKnot = this.leftKnot;\r\n for (let i = 0; i < this.knots.length; ++i)\r\n this.knots[i] = (this.knots[i] - leftKnot) * divisor;\r\n // explicitly set rightKnot and its multiples to 1.0 to avoid round-off\r\n for (let i = this.rightKnotIndex - 1; i > this.leftKnotIndex && (this.knots[i] === this.knots[this.rightKnotIndex]); --i) this.knots[i] = 1.0;\r\n for (let i = this.rightKnotIndex + 1; i < this.knots.length && (this.knots[i] === this.knots[this.rightKnotIndex]); ++i) this.knots[i] = 1.0;\r\n this.knots[this.rightKnotIndex] = 1.0;\r\n this.setupFixedValues();\r\n return true;\r\n }\r\n\r\n /** install knot values from an array, optionally ignoring first and last.\r\n */\r\n public setKnots(knots: number[] | Float64Array, skipFirstAndLast?: boolean) {\r\n const numAllocate = skipFirstAndLast ? knots.length - 2 : knots.length;\r\n if (numAllocate !== this.knots.length)\r\n this.knots = new Float64Array(numAllocate);\r\n if (skipFirstAndLast) {\r\n for (let i = 1; i + 1 < knots.length; i++)\r\n this.knots[i - 1] = knots[i];\r\n\r\n } else {\r\n for (let i = 0; i < knots.length; i++)\r\n this.knots[i] = knots[i];\r\n }\r\n this.setupFixedValues();\r\n }\r\n\r\n /** install knot values from an array, optionally ignoring first and last. */\r\n public setKnotsCapture(knots: Float64Array) {\r\n this.knots = knots;\r\n this.setupFixedValues();\r\n }\r\n\r\n /**\r\n * Create knot vector with {degree-1} replicated knots at start and end, and uniform knots between.\r\n * @param numPoles Number of poles\r\n * @param degree degree of polynomial\r\n * @param a0 left knot value for active interval\r\n * @param a1 right knot value for active interval\r\n */\r\n public static createUniformClamped(numPoles: number, degree: number, a0: number, a1: number): KnotVector {\r\n const knots = new KnotVector(numPoles + degree - 1, degree);\r\n let k = 0;\r\n for (let m = 0; m < degree; m++)knots.knots[k++] = a0;\r\n const du = 1.0 / (numPoles - degree);\r\n for (let i = 1; i + degree < numPoles; i++)\r\n knots.knots[k++] = a0 + i * du * (a1 - a0);\r\n for (let m = 0; m < degree; m++)knots.knots[k++] = a1;\r\n knots.setupFixedValues();\r\n return knots;\r\n }\r\n /**\r\n * Create knot vector with wraparound knots at start and end, and uniform knots between.\r\n * @param numInterval number of intervals in knot space. (NOT POLE COUNT)\r\n * @param degree degree of polynomial\r\n * @param a0 left knot value for active interval\r\n * @param a1 right knot value for active interval\r\n */\r\n public static createUniformWrapped(numInterval: number, degree: number, a0: number, a1: number): KnotVector {\r\n const knots = new KnotVector(numInterval + 2 * degree - 1, degree);\r\n const du = 1.0 / numInterval;\r\n for (let i = 1 - degree, k = 0; i < numInterval + degree; i++, k++) {\r\n knots.knots[k] = Geometry.interpolate(a0, i * du, a1);\r\n }\r\n knots.setupFixedValues();\r\n return knots;\r\n }\r\n\r\n /**\r\n * Create knot vector with given knot values and degree.\r\n * @param knotArray knot values\r\n * @param degree degree of polynomial\r\n * @param skipFirstAndLast true to skip copying the first and last knot values.\r\n */\r\n public static create(knotArray: number[] | Float64Array, degree: number, skipFirstAndLast?: boolean): KnotVector {\r\n const numAllocate = skipFirstAndLast ? knotArray.length - 2 : knotArray.length;\r\n const knots = new KnotVector(numAllocate, degree);\r\n knots.setKnots(knotArray, skipFirstAndLast);\r\n return knots;\r\n }\r\n\r\n /**\r\n * Return the average of degree consecutive knots beginning at knotIndex.\r\n */\r\n public grevilleKnot(knotIndex: number): number {\r\n if (knotIndex < 0) return this.leftKnot;\r\n if (knotIndex > this.rightKnotIndex) return this.rightKnot;\r\n let sum = 0.0;\r\n for (let i = knotIndex; i < knotIndex + this.degree; i++)\r\n sum += this.knots[i];\r\n return sum / this.degree;\r\n }\r\n /** Return an array sized for a set of the basis function values. */\r\n public createBasisArray(): Float64Array { return new Float64Array(this.degree + 1); }\r\n /** Convert localFraction within the interval following an indexed knot to a knot value. */\r\n public baseKnotFractionToKnot(knotIndex0: number, localFraction: number): number {\r\n const knot0 = this.knots[knotIndex0];\r\n localFraction = Geometry.clamp(localFraction, 0, 1);\r\n return knot0 + localFraction * (this.knots[knotIndex0 + 1] - knot0);\r\n }\r\n /** Convert localFraction within an indexed bezier span to a knot value. */\r\n public spanFractionToKnot(spanIndex: number, localFraction: number): number {\r\n const k = this.spanIndexToLeftKnotIndex(spanIndex);\r\n localFraction = Geometry.clamp(localFraction, 0, 1);\r\n return this.knots[k] + localFraction * (this.knots[k + 1] - this.knots[k]);\r\n }\r\n /** Convert localFraction within an indexed bezier span to fraction of active knot range. */\r\n public spanFractionToFraction(spanIndex: number, localFraction: number): number {\r\n const knot = this.spanFractionToKnot(spanIndex, localFraction);\r\n return (knot - this.leftKnot) / (this.rightKnot - this.leftKnot);\r\n }\r\n /** Return fraction of active knot range to knot value. */\r\n public fractionToKnot(fraction: number): number {\r\n fraction = Geometry.clamp(fraction, 0, 1); // B-splines are not extendable\r\n return Geometry.interpolate(this.knots[this.degree - 1], fraction, this.knots[this.knots.length - this.degree]);\r\n }\r\n /**\r\n * Evaluate basis functions f[] at knot value u.\r\n *\r\n * @param u knot value for evaluation\r\n * @param f array of order basis function values\r\n */\r\n public evaluateBasisFunctions(knotIndex0: number, u: number, f: Float64Array) {\r\n f[0] = 1.0;\r\n if (this.degree < 1) return;\r\n // direct compute for linear part ...\r\n const u0 = this.knots[knotIndex0];\r\n const u1 = this.knots[knotIndex0 + 1];\r\n f[1] = (u - u0) / (u1 - u0);\r\n f[0] = 1.0 - f[1];\r\n if (this.degree < 2) return;\r\n\r\n for (let depth = 1; depth < this.degree; depth++) {\r\n let kLeft = knotIndex0 - depth;\r\n let kRight = kLeft + depth + 1;\r\n let gCarry = 0.0;\r\n for (let step = 0; step <= depth; step++) {\r\n const tLeft = this.knots[kLeft++];\r\n const tRight = this.knots[kRight++];\r\n const fraction = (u - tLeft) / (tRight - tLeft);\r\n const g1 = f[step] * fraction;\r\n const g0 = f[step] * (1.0 - fraction);\r\n f[step] = gCarry + g0;\r\n gCarry = g1;\r\n }\r\n f[depth + 1] = gCarry;\r\n }\r\n }\r\n\r\n /**\r\n * Evaluate basis functions f[], derivatives df[], and optional second derivatives ddf[] at knot value u.\r\n *\r\n * @param u knot value for evaluation\r\n * @param f array of order basis function values\r\n * @param df array of order basis derivative values\r\n * @param ddf array of order basis second derivative values\r\n */\r\n public evaluateBasisFunctions1(knotIndex0: number, u: number, f: Float64Array, df: Float64Array, ddf?: Float64Array) {\r\n f[0] = 1.0; df[0] = 0.0;\r\n if (this.degree < 1) return;\r\n // direct compute for linear part ...\r\n const u0 = this.knots[knotIndex0];\r\n const u1 = this.knots[knotIndex0 + 1];\r\n // ah = 1/(u1-u0) is the derivative of fraction0\r\n // (-ah) is the derivative of fraction1.\r\n let ah = 1.0 / (u1 - u0);\r\n f[1] = (u - u0) * ah;\r\n f[0] = 1.0 - f[1];\r\n df[0] = -ah; df[1] = ah;\r\n if (ddf) { // first derivative started constant, second derivative started zero.\r\n ddf[0] = 0.0; ddf[1] = 0.0;\r\n }\r\n if (this.degree < 2) return;\r\n for (let depth = 1; depth < this.degree; depth++) {\r\n let kLeft = knotIndex0 - depth;\r\n let kRight = kLeft + depth + 1;\r\n let gCarry = 0.0;\r\n let dgCarry = 0.0;\r\n let ddgCarry = 0.0;\r\n // f, df, ddf, are each row vectors with product of `step` linear terms.\r\n // f is multiplied on the right by matrix V. Each row has 2 nonzero entries (which sum to 1) (0,0,1-fraction, fraction,0,0,0)\r\n // Each row of the derivative dV is two entries (0,0, -1/h, 1/h,0,0,0)\r\n // Hence fnew = f * V\r\n // dfnew = df * V + f * dV\r\n // ddfnew = ddf * V + df*dV + df * dV + f * ddV\r\n // but ddV is zero so\r\n // ddfnew = ddf * V + 2 * df * dV\r\n for (let step = 0; step <= depth; step++) {\r\n const tLeft = this.knots[kLeft++];\r\n const tRight = this.knots[kRight++];\r\n ah = 1.0 / (tRight - tLeft);\r\n const fraction = (u - tLeft) * ah;\r\n const fraction1 = 1.0 - fraction;\r\n const g1 = f[step] * fraction;\r\n const g0 = f[step] * fraction1;\r\n const dg1 = df[step] * fraction + f[step] * ah;\r\n const dg0 = df[step] * fraction1 - f[step] * ah;\r\n const dfSave = 2.0 * df[step] * ah;\r\n f[step] = gCarry + g0;\r\n df[step] = dgCarry + dg0;\r\n gCarry = g1;\r\n dgCarry = dg1;\r\n if (ddf) { // do the backward reference to df before rewriting df !!!\r\n const ddg1 = ddf[step] * fraction + dfSave;\r\n const ddg0 = ddf[step] * fraction1 - dfSave;\r\n ddf[step] = ddgCarry + ddg0;\r\n ddgCarry = ddg1;\r\n }\r\n }\r\n f[depth + 1] = gCarry;\r\n df[depth + 1] = dgCarry;\r\n if (ddf)\r\n ddf[depth + 1] = ddgCarry;\r\n }\r\n }\r\n /** Find the knot span bracketing knots[i] <= u < knots[i+1] and return i.\r\n * * If u has no such bracket, return the smaller index of the closest nontrivial bracket.\r\n * @param u value to bracket\r\n */\r\n public knotToLeftKnotIndex(u: number): number {\r\n for (let i = this.leftKnotIndex; i < this.rightKnotIndex; ++i) {\r\n if (u < this.knots[i + 1])\r\n return i;\r\n }\r\n // for u >= rightKnot, return left index of last nontrivial span\r\n for (let i = this.rightKnotIndex; i > this.leftKnotIndex; --i) {\r\n if (this.knots[i] - this.knots[i - 1] >= KnotVector.knotTolerance)\r\n return i - 1;\r\n }\r\n return this.rightKnotIndex - 1; // shouldn't get here\r\n }\r\n /**\r\n * Given a span index, return the index of the knot at its left.\r\n * @param spanIndex index of span\r\n */\r\n public spanIndexToLeftKnotIndex(spanIndex: number): number {\r\n const d = this.degree;\r\n if (spanIndex <= 0.0) return d - 1;\r\n return Math.min(spanIndex + d - 1, this.knots.length - d - 1);\r\n }\r\n /** Return the knot interval length of indexed bezier span. */\r\n public spanIndexToSpanLength(spanIndex: number): number {\r\n const k = this.spanIndexToLeftKnotIndex(spanIndex);\r\n return this.knots[k + 1] - this.knots[k];\r\n }\r\n /**\r\n * Given a span index, test if it is within range and has nonzero length.\r\n * * note that a false return does not imply there are no more spans. This may be a double knot (zero length span) followed by more real spans\r\n * @param spanIndex index of span to test.\r\n */\r\n public isIndexOfRealSpan(spanIndex: number): boolean {\r\n if (spanIndex >= 0 && spanIndex < this.numSpans)\r\n return !Geometry.isSmallMetricDistance(this.spanIndexToSpanLength(spanIndex));\r\n return false;\r\n }\r\n /** Reflect all knots so `leftKnot` and `rightKnot` are maintained but interval lengths reverse. */\r\n public reflectKnots() {\r\n const a = this.leftKnot;\r\n const b = this.rightKnot;\r\n const numKnots = this.knots.length;\r\n for (let i = 0; i < numKnots; i++)\r\n this.knots[i] = a + (b - this.knots[i]);\r\n this.knots.reverse();\r\n }\r\n /**\r\n * return a simple array form of the knots. optionally replicate the first and last\r\n * in classic over-clamped manner\r\n */\r\n public copyKnots(includeExtraEndKnot: boolean): number[] {\r\n const wrap = this.wrappable === BSplineWrapMode.OpenByAddingControlPoints && this.testClosable();\r\n const leftIndex = this.leftKnotIndex;\r\n const rightIndex = this.rightKnotIndex;\r\n const a0 = this.leftKnot;\r\n const a1 = this.rightKnot;\r\n const delta = a1 - a0;\r\n const degree = this.degree;\r\n const values: number[] = [];\r\n if (includeExtraEndKnot) {\r\n if (wrap) {\r\n values.push(this.knots[rightIndex - degree] - delta);\r\n } else {\r\n values.push(this.knots[0]);\r\n }\r\n }\r\n for (const u of this.knots) values.push(u);\r\n if (includeExtraEndKnot) {\r\n if (wrap) {\r\n values.push(this.knots[leftIndex + degree] + delta);\r\n } else\r\n values.push(values[values.length - 1]);\r\n }\r\n return values;\r\n }\r\n}\r\n"]}
|
|
1
|
+
{"version":3,"file":"KnotVector.js","sourceRoot":"","sources":["../../../src/bspline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CAAC;QACzC,MAAM,EAAE,GAAG,KAAK,CAAC,SAAS,CAAC,CAAC;QAC5B,MAAM,EAAE,GAAG,KAAK,CAAC,UAAU,CAAC,CAAC;QAC7B,MAAM,KAAK,GAAG,EAAE,GAAG,EAAE,CAAC;QACtB,MAAM,MAAM,GAAa,EAAE,CAAC;QAC5B,IAAI,mBAAmB,EAAE;YACvB,IAAI,sBAAsB;gBACxB,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,UAAU,GAAG,MAAM,CAAC,GAAG,KAAK,CAAC,CAAC;;gBAEhD,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;SACzB;QACD,KAAK,MAAM,CAAC,IAAI,KAAK,EAAE;YACrB,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;SAChB;QACD,IAAI,mBAAmB,EAAE;YACvB,IAAI,sBAAsB;gBACxB,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,SAAS,GAAG,MAAM,CAAC,GAAG,KAAK,CAAC,CAAC;;gBAE/C,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC;SACxC;QACD,OAAO,MAAM,CAAC;IAChB,CAAC;IAED,uHAAuH;IAChH,SAAS,CAAC,mBAA4B;QAC3C,MAAM,QAAQ,GAAG,CAAC,mBAAmB,IAAI,IAAI,CAAC,YAAY,EAAE,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC,SAAS,CAAC;QAC3F,OAAO,UAAU,CAAC,SAAS,CAAC,IAAI,CAAC,KAAK,EAAE,IAAI,CAAC,MAAM,EAAE,mBAAmB,EAAE,QAAQ,CAAC,CAAC;IACtF,CAAC;;AA/bD,0DAA0D;AACnC,wBAAa,GAAG,MAAM,CAAC;SAVnC,UAAU","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module Bspline\r\n */\r\n\r\nimport { Geometry } from \"../Geometry\";\r\nimport { NumberArray } from \"../geometry3d/PointHelpers\";\r\n\r\n/**\r\n * B-spline curve and surface types in this library are non-periodic. But they can be created from legacy periodic data.\r\n * This enumeration lists the possible ways a B-spline object can have been created from legacy periodic data.\r\n * @public\r\n */\r\nexport enum BSplineWrapMode {\r\n /** No conversion performed. */\r\n None = 0,\r\n /** The B-spline was opened up by adding degree wrap-around control points to the legacy periodic data.\r\n * * This is typical of B-splines constructed with maximum (degree - 1) continuity.\r\n * * Knots are unaffected by this conversion.\r\n */\r\n OpenByAddingControlPoints = 1,\r\n /** The B-spline was opened up by removing degree extreme knots from the legacy periodic data.\r\n * * This is typical of rational B-spline curves representing full circles and ellipses.\r\n * * Poles are unaffected by this conversion.\r\n */\r\n OpenByRemovingKnots = 2,\r\n}\r\n/**\r\n * Array of non-decreasing numbers acting as a knot array for B-splines.\r\n *\r\n * * Essential identity: numKnots = numPoles + order - 2 = numPoles + degree - 1\r\n * * Various B-spline libraries have confusion over how many \"end knots\" are needed. Many libraries (including MicroStation and Parasolid)\r\n * demand order knots at each end for clamping. But only order-1 are really needed. This class uses the order-1 convention.\r\n * * A span is a single interval of the knots.\r\n * * The left knot of span {k} is knot {k+degree-1}.\r\n * * This class provides queries to convert among spanIndex, knotIndex, spanFraction, fraction of knot range, and knot.\r\n * * Core computations (evaluateBasisFunctions) have leftKnotIndex and global knot value as inputs. Callers need to\r\n * know their primary values (global knot, spanFraction).\r\n * @public\r\n */\r\nexport class KnotVector {\r\n /** The simple array of knot values. */\r\n public knots: Float64Array;\r\n /** Return the degree of basis functions defined in these knots. */\r\n public degree: number;\r\n private _knot0: number;\r\n private _knot1: number;\r\n\r\n private _wrapMode?: BSplineWrapMode;\r\n /** tolerance for considering two knots to be the same. */\r\n public static readonly knotTolerance = 1.0e-9;\r\n /** Return the leftmost knot value (of the active interval, ignoring unclamped leading knots)*/\r\n public get leftKnot() { return this._knot0; }\r\n /** Return the rightmost knot value (of the active interval, ignoring unclamped leading knots)*/\r\n public get rightKnot() { return this._knot1; }\r\n /** Return the index of the leftmost knot of the active interval */\r\n public get leftKnotIndex() { return this.degree - 1; }\r\n /** Return the index of the rightmost knot of the active interval */\r\n public get rightKnotIndex() { return this.knots.length - this.degree; }\r\n /** Whether this KnotVector was created by converting legacy periodic data during deserialization. The conversion used is specified by BSplineWrapMode, and is reversed at serialization time. */\r\n public get wrappable() { return this._wrapMode === undefined ? BSplineWrapMode.None : this._wrapMode; }\r\n public set wrappable(value: BSplineWrapMode) { this._wrapMode = value; }\r\n /** Return the number of bezier spans. Note that this includes zero-length spans if there are repeated knots. */\r\n public get numSpans() { return this.rightKnotIndex - this.leftKnotIndex; }\r\n /**\r\n *\r\n * * If knots is a number array or Float64Array, the those values become the local knot array.\r\n * * If knots is a simple number, the local knot array is allocated to that size but left as zeros.\r\n * @param knots\r\n * @param degree\r\n */\r\n private constructor(knots: number[] | Float64Array | number, degree: number, wrapMode?: BSplineWrapMode) {\r\n this.degree = degree;\r\n this._wrapMode = wrapMode;\r\n // default values to satisfy compiler -- real values happen in setupFixedValues, or final else defers to user\r\n this._knot0 = 0.0;\r\n this._knot1 = 1.0;\r\n // satisfy the initialize checker ..\r\n if (Array.isArray(knots)) { // remark: This ctor is private. The callers (as of April 2019) do not use this path.\r\n this.knots = new Float64Array(knots.length);\r\n this.setKnots(knots);\r\n this.setupFixedValues();\r\n } else if (knots instanceof Float64Array) {\r\n this.knots = knots.slice();\r\n this.setupFixedValues();\r\n } else { // caller is responsible for filling array separately ...\r\n this.knots = new Float64Array(knots);\r\n }\r\n }\r\n /** copy degree and knots to a new KnotVector. */\r\n public clone(): KnotVector { return new KnotVector(this.knots, this.degree, this.wrappable); }\r\n private setupFixedValues() {\r\n if (this.degree > 0 && this.knots.length > this.degree) {\r\n this._knot0 = this.knots[this.degree - 1];\r\n this._knot1 = this.knots[this.knots.length - this.degree];\r\n }\r\n }\r\n /** Return the total knot distance from beginning to end. */\r\n public get knotLength01(): number { return this._knot1 - this._knot0; }\r\n /**\r\n * Returns true if all numeric values have wraparound conditions that allow the knots to be closed with specified wrap mode.\r\n * @param mode optional test mode. If undefined, use this.wrappable.\r\n */\r\n public testClosable(mode?: BSplineWrapMode): boolean {\r\n if (mode === undefined)\r\n mode = this.wrappable;\r\n const degree = this.degree;\r\n const leftKnotIndex = this.leftKnotIndex;\r\n const rightKnotIndex = this.rightKnotIndex;\r\n if (mode === BSplineWrapMode.OpenByAddingControlPoints) {\r\n // maximum continuity mode: we expect degree periodically extended knots at each end\r\n const period = this.rightKnot - this.leftKnot;\r\n const indexDelta = rightKnotIndex - leftKnotIndex;\r\n for (let k0 = 0; k0 < leftKnotIndex + degree; k0++) {\r\n const k1 = k0 + indexDelta;\r\n if (Math.abs(this.knots[k0] + period - this.knots[k1]) >= KnotVector.knotTolerance)\r\n return false;\r\n }\r\n return true;\r\n }\r\n if (mode === BSplineWrapMode.OpenByRemovingKnots) {\r\n // legacy periodic mode: we expect multiplicity degree knots at each end\r\n const numRepeated = degree - 1;\r\n const leftKnot = this.leftKnot;\r\n const rightKnot = this.rightKnot;\r\n for (let i = 0; i < numRepeated; i++) {\r\n if (Math.abs(leftKnot - this.knots[leftKnotIndex - i - 1]) >= KnotVector.knotTolerance)\r\n return false;\r\n if (Math.abs(rightKnot - this.knots[rightKnotIndex + i + 1]) >= KnotVector.knotTolerance)\r\n return false;\r\n }\r\n return true;\r\n }\r\n return false;\r\n }\r\n /** Test matching degree and knot values */\r\n public isAlmostEqual(other: KnotVector): boolean {\r\n if (this.degree !== other.degree) return false;\r\n return NumberArray.isAlmostEqual(this.knots, other.knots, KnotVector.knotTolerance);\r\n }\r\n\r\n /** Compute the multiplicity of the input knot, or zero if not a knot. */\r\n public getKnotMultiplicity(knot: number): number {\r\n let m = 0;\r\n for (const k of this.knots) {\r\n if (Math.abs(k - knot) < KnotVector.knotTolerance)\r\n ++m;\r\n else if (knot < k)\r\n break;\r\n }\r\n return m;\r\n }\r\n\r\n /** Compute the multiplicity of the knot at the given index. */\r\n public getKnotMultiplicityAtIndex(knotIndex: number): number {\r\n let m = 0;\r\n if (knotIndex >= 0 && knotIndex < this.knots.length) {\r\n const knot = this.knots[knotIndex];\r\n ++m; // count this knot\r\n for (let i = knotIndex - 1; i >= 0; --i) {\r\n const k = this.knots[i];\r\n if (Math.abs(k - knot) < KnotVector.knotTolerance)\r\n ++m; // found multiple to left of knot\r\n else if (knot > k)\r\n break;\r\n }\r\n for (let i = knotIndex + 1; i < this.knots.length; ++i) {\r\n const k = this.knots[i];\r\n if (Math.abs(k - knot) < KnotVector.knotTolerance)\r\n ++m; // found multiple to right of knot\r\n else if (knot < k)\r\n break;\r\n }\r\n }\r\n return m;\r\n }\r\n\r\n /** Transform knots to span [0,1].\r\n * @returns false if and only if this.knotLength01 is trivial\r\n */\r\n public normalize(): boolean {\r\n if (this.knotLength01 < KnotVector.knotTolerance)\r\n return false;\r\n const divisor = 1.0 / this.knotLength01;\r\n const leftKnot = this.leftKnot;\r\n for (let i = 0; i < this.knots.length; ++i)\r\n this.knots[i] = (this.knots[i] - leftKnot) * divisor;\r\n // explicitly set rightKnot and its multiples to 1.0 to avoid round-off\r\n for (let i = this.rightKnotIndex - 1; i > this.leftKnotIndex && (this.knots[i] === this.knots[this.rightKnotIndex]); --i) this.knots[i] = 1.0;\r\n for (let i = this.rightKnotIndex + 1; i < this.knots.length && (this.knots[i] === this.knots[this.rightKnotIndex]); ++i) this.knots[i] = 1.0;\r\n this.knots[this.rightKnotIndex] = 1.0;\r\n this.setupFixedValues();\r\n return true;\r\n }\r\n\r\n /** install knot values from an array, optionally ignoring first and last.\r\n */\r\n public setKnots(knots: number[] | Float64Array, skipFirstAndLast?: boolean) {\r\n const numAllocate = skipFirstAndLast ? knots.length - 2 : knots.length;\r\n if (numAllocate !== this.knots.length)\r\n this.knots = new Float64Array(numAllocate);\r\n if (skipFirstAndLast) {\r\n for (let i = 1; i + 1 < knots.length; i++)\r\n this.knots[i - 1] = knots[i];\r\n\r\n } else {\r\n for (let i = 0; i < knots.length; i++)\r\n this.knots[i] = knots[i];\r\n }\r\n this.setupFixedValues();\r\n }\r\n\r\n /** Set knots to input array (CAPTURED) */\r\n public setKnotsCapture(knots: Float64Array) {\r\n this.knots = knots;\r\n this.setupFixedValues();\r\n }\r\n\r\n /**\r\n * Create knot vector with {degree-1} replicated knots at start and end, and uniform knots between.\r\n * @param numPoles Number of poles\r\n * @param degree degree of polynomial\r\n * @param a0 left knot value for active interval\r\n * @param a1 right knot value for active interval\r\n */\r\n public static createUniformClamped(numPoles: number, degree: number, a0: number, a1: number): KnotVector {\r\n const knots = new KnotVector(numPoles + degree - 1, degree);\r\n let k = 0;\r\n for (let m = 0; m < degree; m++)knots.knots[k++] = a0;\r\n const du = 1.0 / (numPoles - degree);\r\n for (let i = 1; i + degree < numPoles; i++)\r\n knots.knots[k++] = a0 + i * du * (a1 - a0);\r\n for (let m = 0; m < degree; m++)knots.knots[k++] = a1;\r\n knots.setupFixedValues();\r\n return knots;\r\n }\r\n /**\r\n * Create knot vector with wraparound knots at start and end, and uniform knots between.\r\n * @param numInterval number of intervals in knot space. (NOT POLE COUNT)\r\n * @param degree degree of polynomial\r\n * @param a0 left knot value for active interval\r\n * @param a1 right knot value for active interval\r\n */\r\n public static createUniformWrapped(numInterval: number, degree: number, a0: number, a1: number): KnotVector {\r\n const knots = new KnotVector(numInterval + 2 * degree - 1, degree);\r\n const du = 1.0 / numInterval;\r\n for (let i = 1 - degree, k = 0; i < numInterval + degree; i++, k++) {\r\n knots.knots[k] = Geometry.interpolate(a0, i * du, a1);\r\n }\r\n knots.setupFixedValues();\r\n return knots;\r\n }\r\n\r\n /**\r\n * Create knot vector with given knot values and degree.\r\n * @param knotArray knot values\r\n * @param degree degree of polynomial\r\n * @param skipFirstAndLast true to skip copying the first and last knot values.\r\n */\r\n public static create(knotArray: number[] | Float64Array, degree: number, skipFirstAndLast?: boolean): KnotVector {\r\n const numAllocate = skipFirstAndLast ? knotArray.length - 2 : knotArray.length;\r\n const knots = new KnotVector(numAllocate, degree);\r\n knots.setKnots(knotArray, skipFirstAndLast);\r\n return knots;\r\n }\r\n\r\n /**\r\n * Return the average of degree consecutive knots beginning at knotIndex.\r\n */\r\n public grevilleKnot(knotIndex: number): number {\r\n if (knotIndex < 0) return this.leftKnot;\r\n if (knotIndex > this.rightKnotIndex) return this.rightKnot;\r\n let sum = 0.0;\r\n for (let i = knotIndex; i < knotIndex + this.degree; i++)\r\n sum += this.knots[i];\r\n return sum / this.degree;\r\n }\r\n /** Return an array sized for a set of the basis function values. */\r\n public createBasisArray(): Float64Array { return new Float64Array(this.degree + 1); }\r\n /** Convert localFraction within the interval following an indexed knot to a knot value. */\r\n public baseKnotFractionToKnot(knotIndex0: number, localFraction: number): number {\r\n const knot0 = this.knots[knotIndex0];\r\n localFraction = Geometry.clamp(localFraction, 0, 1);\r\n return knot0 + localFraction * (this.knots[knotIndex0 + 1] - knot0);\r\n }\r\n /** Convert localFraction within an indexed bezier span to a knot value. */\r\n public spanFractionToKnot(spanIndex: number, localFraction: number): number {\r\n const k = this.spanIndexToLeftKnotIndex(spanIndex);\r\n localFraction = Geometry.clamp(localFraction, 0, 1);\r\n return this.knots[k] + localFraction * (this.knots[k + 1] - this.knots[k]);\r\n }\r\n /** Convert localFraction within an indexed bezier span to fraction of active knot range. */\r\n public spanFractionToFraction(spanIndex: number, localFraction: number): number {\r\n const knot = this.spanFractionToKnot(spanIndex, localFraction);\r\n return (knot - this.leftKnot) / (this.rightKnot - this.leftKnot);\r\n }\r\n /** Return fraction of active knot range to knot value. */\r\n public fractionToKnot(fraction: number): number {\r\n fraction = Geometry.clamp(fraction, 0, 1); // B-splines are not extendable\r\n return Geometry.interpolate(this.knots[this.degree - 1], fraction, this.knots[this.knots.length - this.degree]);\r\n }\r\n /**\r\n * Evaluate basis functions f[] at knot value u.\r\n *\r\n * @param u knot value for evaluation\r\n * @param f preallocated output array of order basis function values\r\n * @returns true if and only if output array is sufficiently sized\r\n */\r\n public evaluateBasisFunctions(knotIndex0: number, u: number, f: Float64Array): boolean {\r\n if (f.length < this.degree + 1)\r\n return false;\r\n f[0] = 1.0;\r\n if (this.degree < 1)\r\n return true;\r\n // direct compute for linear part ...\r\n const u0 = this.knots[knotIndex0];\r\n const u1 = this.knots[knotIndex0 + 1];\r\n f[1] = (u - u0) / (u1 - u0);\r\n f[0] = 1.0 - f[1];\r\n if (this.degree < 2)\r\n return true;\r\n for (let depth = 1; depth < this.degree; depth++) {\r\n let kLeft = knotIndex0 - depth;\r\n let kRight = kLeft + depth + 1;\r\n let gCarry = 0.0;\r\n for (let step = 0; step <= depth; step++) {\r\n const tLeft = this.knots[kLeft++];\r\n const tRight = this.knots[kRight++];\r\n const fraction = (u - tLeft) / (tRight - tLeft);\r\n const g1 = f[step] * fraction;\r\n const g0 = f[step] * (1.0 - fraction);\r\n f[step] = gCarry + g0;\r\n gCarry = g1;\r\n }\r\n f[depth + 1] = gCarry;\r\n }\r\n return true;\r\n }\r\n\r\n /**\r\n * Evaluate basis functions f[], derivatives df[], and optional second derivatives ddf[] at knot value u.\r\n *\r\n * @param u knot value for evaluation\r\n * @param f preallocated output array of order basis function values\r\n * @param df preallocated output array of order basis derivative values\r\n * @param ddf optional preallocated output array of order basis second derivative values\r\n * @returns true if and only if output arrays are sufficiently sized\r\n */\r\n public evaluateBasisFunctions1(knotIndex0: number, u: number, f: Float64Array, df: Float64Array, ddf?: Float64Array): boolean {\r\n if (f.length < this.degree + 1)\r\n return false;\r\n if (df.length < this.degree + 1)\r\n return false;\r\n if (ddf && ddf.length < this.degree + 1)\r\n return false;\r\n f[0] = 1.0; df[0] = 0.0;\r\n if (this.degree < 1)\r\n return true;\r\n // direct compute for linear part ...\r\n const u0 = this.knots[knotIndex0];\r\n const u1 = this.knots[knotIndex0 + 1];\r\n // ah = 1/(u1-u0) is the derivative of fraction0\r\n // (-ah) is the derivative of fraction1.\r\n let ah = 1.0 / (u1 - u0);\r\n f[1] = (u - u0) * ah;\r\n f[0] = 1.0 - f[1];\r\n df[0] = -ah; df[1] = ah;\r\n if (ddf) { // first derivative started constant, second derivative started zero.\r\n ddf[0] = 0.0; ddf[1] = 0.0;\r\n }\r\n if (this.degree < 2)\r\n return true;\r\n for (let depth = 1; depth < this.degree; depth++) {\r\n let kLeft = knotIndex0 - depth;\r\n let kRight = kLeft + depth + 1;\r\n let gCarry = 0.0;\r\n let dgCarry = 0.0;\r\n let ddgCarry = 0.0;\r\n // f, df, ddf, are each row vectors with product of `step` linear terms.\r\n // f is multiplied on the right by matrix V. Each row has 2 nonzero entries (which sum to 1) (0,0,1-fraction, fraction,0,0,0)\r\n // Each row of the derivative dV is two entries (0,0, -1/h, 1/h,0,0,0)\r\n // Hence fnew = f * V\r\n // dfnew = df * V + f * dV\r\n // ddfnew = ddf * V + df*dV + df * dV + f * ddV\r\n // but ddV is zero so\r\n // ddfnew = ddf * V + 2 * df * dV\r\n for (let step = 0; step <= depth; step++) {\r\n const tLeft = this.knots[kLeft++];\r\n const tRight = this.knots[kRight++];\r\n ah = 1.0 / (tRight - tLeft);\r\n const fraction = (u - tLeft) * ah;\r\n const fraction1 = 1.0 - fraction;\r\n const g1 = f[step] * fraction;\r\n const g0 = f[step] * fraction1;\r\n const dg1 = df[step] * fraction + f[step] * ah;\r\n const dg0 = df[step] * fraction1 - f[step] * ah;\r\n const dfSave = 2.0 * df[step] * ah;\r\n f[step] = gCarry + g0;\r\n df[step] = dgCarry + dg0;\r\n gCarry = g1;\r\n dgCarry = dg1;\r\n if (ddf) { // do the backward reference to df before rewriting df !!!\r\n const ddg1 = ddf[step] * fraction + dfSave;\r\n const ddg0 = ddf[step] * fraction1 - dfSave;\r\n ddf[step] = ddgCarry + ddg0;\r\n ddgCarry = ddg1;\r\n }\r\n }\r\n f[depth + 1] = gCarry;\r\n df[depth + 1] = dgCarry;\r\n if (ddf)\r\n ddf[depth + 1] = ddgCarry;\r\n }\r\n return true;\r\n }\r\n /** Find the knot span bracketing knots[i] <= u < knots[i+1] and return i.\r\n * * If u has no such bracket, return the smaller index of the closest nontrivial bracket.\r\n * @param u value to bracket\r\n */\r\n public knotToLeftKnotIndex(u: number): number {\r\n for (let i = this.leftKnotIndex; i < this.rightKnotIndex; ++i) {\r\n if (u < this.knots[i + 1])\r\n return i;\r\n }\r\n // for u >= rightKnot, return left index of last nontrivial span\r\n for (let i = this.rightKnotIndex; i > this.leftKnotIndex; --i) {\r\n if (this.knots[i] - this.knots[i - 1] >= KnotVector.knotTolerance)\r\n return i - 1;\r\n }\r\n return this.rightKnotIndex - 1; // shouldn't get here\r\n }\r\n /**\r\n * Given a span index, return the index of the knot at its left.\r\n * @param spanIndex index of span\r\n */\r\n public spanIndexToLeftKnotIndex(spanIndex: number): number {\r\n const d = this.degree;\r\n if (spanIndex <= 0.0) return d - 1;\r\n return Math.min(spanIndex + d - 1, this.knots.length - d - 1);\r\n }\r\n /** Return the knot interval length of indexed bezier span. */\r\n public spanIndexToSpanLength(spanIndex: number): number {\r\n const k = this.spanIndexToLeftKnotIndex(spanIndex);\r\n return this.knots[k + 1] - this.knots[k];\r\n }\r\n /**\r\n * Given a span index, test if it is within range and has nonzero length.\r\n * * note that a false return does not imply there are no more spans. This may be a double knot (zero length span) followed by more real spans\r\n * @param spanIndex index of span to test.\r\n */\r\n public isIndexOfRealSpan(spanIndex: number): boolean {\r\n if (spanIndex >= 0 && spanIndex < this.numSpans)\r\n return !Geometry.isSmallMetricDistance(this.spanIndexToSpanLength(spanIndex));\r\n return false;\r\n }\r\n /** Reflect all knots so `leftKnot` and `rightKnot` are maintained but interval lengths reverse. */\r\n public reflectKnots() {\r\n const a = this.leftKnot;\r\n const b = this.rightKnot;\r\n const numKnots = this.knots.length;\r\n for (let i = 0; i < numKnots; i++)\r\n this.knots[i] = a + (b - this.knots[i]);\r\n this.knots.reverse();\r\n }\r\n\r\n /** Return a simple array form of the knots. Optionally replicate the first and last in classic over-clamped manner. */\r\n public static copyKnots(knots: number[] | Float64Array, degree: number, includeExtraEndKnot?: boolean, wrapMode?: BSplineWrapMode): number[] {\r\n const isExtraEndKnotPeriodic = (includeExtraEndKnot && wrapMode === BSplineWrapMode.OpenByAddingControlPoints);\r\n const leftIndex = degree - 1;\r\n const rightIndex = knots.length - degree;\r\n const a0 = knots[leftIndex];\r\n const a1 = knots[rightIndex];\r\n const delta = a1 - a0;\r\n const values: number[] = [];\r\n if (includeExtraEndKnot) {\r\n if (isExtraEndKnotPeriodic)\r\n values.push(knots[rightIndex - degree] - delta);\r\n else\r\n values.push(knots[0]);\r\n }\r\n for (const u of knots) {\r\n values.push(u);\r\n }\r\n if (includeExtraEndKnot) {\r\n if (isExtraEndKnotPeriodic)\r\n values.push(knots[leftIndex + degree] + delta);\r\n else\r\n values.push(knots[knots.length - 1]);\r\n }\r\n return values;\r\n }\r\n\r\n /** Return a simple array form of the knots. Optionally replicate the first and last in classic over-clamped manner. */\r\n public copyKnots(includeExtraEndKnot: boolean): number[] {\r\n const wrapMode = (includeExtraEndKnot && this.testClosable()) ? this.wrappable : undefined;\r\n return KnotVector.copyKnots(this.knots, this.degree, includeExtraEndKnot, wrapMode);\r\n }\r\n}\r\n"]}
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
* @module CartesianGeometry
|
|
3
3
|
*/
|
|
4
4
|
import { Arc3d } from "../curve/Arc3d";
|
|
5
|
-
import { AnyCurve, AnyRegion } from "../curve/CurveTypes";
|
|
6
5
|
import { AnnounceNumberNumber, AnnounceNumberNumberCurvePrimitive, CurvePrimitive } from "../curve/CurvePrimitive";
|
|
6
|
+
import { AnyCurve, AnyRegion } from "../curve/CurveTypes";
|
|
7
7
|
import { GeometryQuery } from "../curve/GeometryQuery";
|
|
8
8
|
import { GrowableFloat64Array } from "../geometry3d/GrowableFloat64Array";
|
|
9
9
|
import { GrowableXYZArray } from "../geometry3d/GrowableXYZArray";
|
|
@@ -238,17 +238,44 @@ export declare class ClipUtilities {
|
|
|
238
238
|
* @param ignoreInvisiblePlanes if true, do NOT compute a facet for convex set faces marked invisible.
|
|
239
239
|
*/
|
|
240
240
|
static doesConvexClipPlaneSetIntersectRange(convexSet: ConvexClipPlaneSet, range: Range3d, includeConvexSetFaces?: boolean, includeRangeFaces?: boolean, ignoreInvisiblePlanes?: boolean): boolean;
|
|
241
|
+
/**
|
|
242
|
+
* Create a clipper from the transformed range.
|
|
243
|
+
* @param range input range to create clipper from
|
|
244
|
+
* @param transform how to transform the range (NOTE: applied to the range faces without swelling the range volume)
|
|
245
|
+
* @param degeneratePoints optionally populated with the 1 or 2 points defining the transformed range if it is degenerate (all points colinear/coincident); otherwise untouched
|
|
246
|
+
* @returns newly constructed clipper. If no clip planes could be computed, fill `degeneratePoints` and return undefined.
|
|
247
|
+
*/
|
|
248
|
+
private static createClipperFromTransformedRange3d;
|
|
249
|
+
/**
|
|
250
|
+
* Handle pathological cases of range-range intersection, where one of the ranges defines no area or volume (is a line segment or single point).
|
|
251
|
+
* @param range local range to intersect with the point/segment
|
|
252
|
+
* @param points isolated local point, or local segment's start and end
|
|
253
|
+
* @param localToWorld optional transform for output range
|
|
254
|
+
* @param intersection optional range of the intersection, in world coordinates, or null range if no intersection.
|
|
255
|
+
* @returns whether the point/segment intersects the range
|
|
256
|
+
*/
|
|
257
|
+
private static rangeIntersectPointOrSegment;
|
|
241
258
|
/**
|
|
242
259
|
* Test for intersection of two ranges in different local coordinates.
|
|
243
260
|
* * Useful for clash detection of elements in iModels, using their stored (tight) local ranges and placement transforms.
|
|
244
|
-
* @param range0 range in local coordinates
|
|
245
|
-
* @param local0ToWorld placement transform for first
|
|
246
|
-
* @param range1 range in local coordinates
|
|
247
|
-
* @param local1ToWorld placement transform for second
|
|
261
|
+
* @param range0 first range in local coordinates
|
|
262
|
+
* @param local0ToWorld placement transform for first range
|
|
263
|
+
* @param range1 second range in local coordinates
|
|
264
|
+
* @param local1ToWorld placement transform for second range. Assumed to be invertible.
|
|
248
265
|
* @param range1Margin optional signed local distance to expand/contract the second range before intersection. Positive expands.
|
|
249
266
|
* @return whether the local ranges are adjacent or intersect. Also returns false if local1ToWorld is singular.
|
|
250
267
|
*/
|
|
251
268
|
static doLocalRangesIntersect(range0: Range3d, local0ToWorld: Transform, range1: Range3d, local1ToWorld: Transform, range1Margin?: number): boolean;
|
|
269
|
+
/**
|
|
270
|
+
* Compute the range of the intersection between two local (e.g., element-aligned) ranges.
|
|
271
|
+
* @param range0 first range in local coordinates
|
|
272
|
+
* @param local0ToWorld placement transform for first range
|
|
273
|
+
* @param range1 second range in local coordinates
|
|
274
|
+
* @param local1ToWorld placement transform for second range. Assumed to be invertible.
|
|
275
|
+
* @param result optional pre-allocated range to fill and return
|
|
276
|
+
* @return range of the intersection (aligned to world axes). Returns null range if local1ToWorld is singular.
|
|
277
|
+
*/
|
|
278
|
+
static rangeOfIntersectionOfLocalRanges(range0: Range3d, local0ToWorld: Transform, range1: Range3d, local1ToWorld: Transform, result?: Range3d): Range3d;
|
|
252
279
|
/**
|
|
253
280
|
* Test if `obj` is a `Clipper` object.
|
|
254
281
|
* * This is implemented by testing for each of the methods in the `Clipper` interface.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ClipUtils.d.ts","sourceRoot":"","sources":["../../../src/clipping/ClipUtils.ts"],"names":[],"mappings":"AAIA;;GAEG;
|
|
1
|
+
{"version":3,"file":"ClipUtils.d.ts","sourceRoot":"","sources":["../../../src/clipping/ClipUtils.ts"],"names":[],"mappings":"AAIA;;GAEG;AAGH,OAAO,EAAE,KAAK,EAAE,MAAM,gBAAgB,CAAC;AAGvC,OAAO,EAAE,oBAAoB,EAAE,kCAAkC,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AACnH,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAC1D,OAAO,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;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