@itwin/core-geometry 4.3.0-dev.9 → 4.3.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 +62 -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
|
@@ -25,14 +25,19 @@ var UVSelect;
|
|
|
25
25
|
(function (UVSelect) {
|
|
26
26
|
/** index of u direction */
|
|
27
27
|
UVSelect[UVSelect["uDirection"] = 0] = "uDirection";
|
|
28
|
-
/**
|
|
28
|
+
/**
|
|
29
|
+
* index of v direction
|
|
30
|
+
* @deprecated in 4.x. Use vDirection instead.
|
|
31
|
+
*/
|
|
29
32
|
UVSelect[UVSelect["VDirection"] = 1] = "VDirection";
|
|
33
|
+
/** index of v direction */
|
|
34
|
+
UVSelect[UVSelect["vDirection"] = 1] = "vDirection";
|
|
30
35
|
})(UVSelect = exports.UVSelect || (exports.UVSelect = {}));
|
|
31
36
|
/**
|
|
32
37
|
* Enumeration of how weights are carried
|
|
33
38
|
* * UnWeighted (0) -- there are no weights
|
|
34
|
-
* * WeightsAlreadyAppliedToCoordinates (1) -- for real point (x,y,z) the homogeneous point
|
|
35
|
-
* * WeightsSeparateFromCoordinates (2) -- for real point (x,y,z) the homogeneous point is (x,y,z,w)
|
|
39
|
+
* * WeightsAlreadyAppliedToCoordinates (1) -- for real point (x,y,z) the homogeneous point (wx,wy,wx,w) is stored as (wx,wy,wz,w)
|
|
40
|
+
* * WeightsSeparateFromCoordinates (2) -- for real point (x,y,z) the homogeneous point (wx,wy,wx,w) is stored as (x,y,z,w)
|
|
36
41
|
* * Note that "internal" computations never use WeightsSeparateFromCoordinates.
|
|
37
42
|
* * WeightsSeparateFromCoordinates is only useful as input or output state in serializer.
|
|
38
43
|
* @public
|
|
@@ -42,13 +47,13 @@ var WeightStyle;
|
|
|
42
47
|
/** There are no weights. */
|
|
43
48
|
WeightStyle[WeightStyle["UnWeighted"] = 0] = "UnWeighted";
|
|
44
49
|
/**
|
|
45
|
-
* * Data is weighted
|
|
46
|
-
* * point with normalized coordinate `[x,y,z]` and weight `w`
|
|
50
|
+
* * Data is weighted.
|
|
51
|
+
* * The point with normalized coordinate `[x,y,z]` and weight `w` is stored as `[x*w,y*w,z*w,w]`
|
|
47
52
|
* */
|
|
48
53
|
WeightStyle[WeightStyle["WeightsAlreadyAppliedToCoordinates"] = 1] = "WeightsAlreadyAppliedToCoordinates";
|
|
49
54
|
/**
|
|
50
|
-
* * Data is weighted
|
|
51
|
-
* * point with normalized coordinate `[x,y,z]` and weight `w`
|
|
55
|
+
* * Data is weighted.
|
|
56
|
+
* * The point with normalized coordinate `[x,y,z]` and weight `w` is stored as `[x,y,z,w]`
|
|
52
57
|
* */
|
|
53
58
|
WeightStyle[WeightStyle["WeightsSeparateFromCoordinates"] = 2] = "WeightsSeparateFromCoordinates";
|
|
54
59
|
})(WeightStyle = exports.WeightStyle || (exports.WeightStyle = {}));
|
|
@@ -79,18 +84,30 @@ class BSpline2dNd extends GeometryQuery_1.GeometryQuery {
|
|
|
79
84
|
return false;
|
|
80
85
|
return true;
|
|
81
86
|
}
|
|
82
|
-
/** Get the Point3d
|
|
87
|
+
/** Get the indexed Point3d.
|
|
83
88
|
* * (IMPORTANT) This assumes this is an xyz surface. Data will be incorrect if this is an xyzw surface.
|
|
89
|
+
* @param i index in [0, numPolesU)
|
|
90
|
+
* @param j index in [0, numPolesV)
|
|
84
91
|
*/
|
|
85
92
|
getPoint3dPole(i, j, result) {
|
|
86
93
|
return Point3dVector3d_1.Point3d.createFromPacked(this.coffs, i + j * this._numPoles[0], result);
|
|
87
94
|
}
|
|
88
|
-
/** Get the Point3d
|
|
95
|
+
/** Get the indexed Point3d, projecting the weight away to get to xyz.
|
|
89
96
|
* * (IMPORTANT) This assumes this is an xyzw surface. Data will be incorrect if this is an xyz surface.
|
|
97
|
+
* @param i index in [0, numPolesU)
|
|
98
|
+
* @param j index in [0, numPolesV)
|
|
90
99
|
*/
|
|
91
100
|
getPoint3dPoleXYZW(i, j, result) {
|
|
92
101
|
return Point3dVector3d_1.Point3d.createFromPackedXYZW(this.coffs, i + j * this._numPoles[0], result);
|
|
93
102
|
}
|
|
103
|
+
/** Get the indexed Point4d.
|
|
104
|
+
* * (IMPORTANT) This assumes this is an xyzw surface. Data will be incorrect if this is an xyz surface.
|
|
105
|
+
* @param i index in [0, numPolesU)
|
|
106
|
+
* @param j index in [0, numPolesV)
|
|
107
|
+
*/
|
|
108
|
+
getPoint4dPole(i, j, result) {
|
|
109
|
+
return Point4d_1.Point4d.createFromPacked(this.coffs, (i + j * this._numPoles[0]) * 4, result);
|
|
110
|
+
}
|
|
94
111
|
/**
|
|
95
112
|
* Return 0 for 0 input, 1 for any nonzero input.
|
|
96
113
|
* @param value numeric value to convert to strict 0 or 1.
|
|
@@ -184,6 +201,7 @@ class BSpline2dNd extends GeometryQuery_1.GeometryQuery {
|
|
|
184
201
|
* * choice of u or v
|
|
185
202
|
* * span index
|
|
186
203
|
* * local fraction within the span.
|
|
204
|
+
* @returns true if and only if output arrays are sufficiently sized
|
|
187
205
|
*/
|
|
188
206
|
spanFractionsToBasisFunctions(select, spanIndex, spanFraction, f, df) {
|
|
189
207
|
spanIndex = Geometry_1.Geometry.clampToStartEnd(spanIndex, 0, this.numSpanUV(select));
|
|
@@ -213,9 +231,15 @@ class BSpline2dNd extends GeometryQuery_1.GeometryQuery {
|
|
|
213
231
|
kU += stepV;
|
|
214
232
|
}
|
|
215
233
|
}
|
|
216
|
-
|
|
217
|
-
|
|
234
|
+
/**
|
|
235
|
+
* sum poles by the weights in the basisBuffer, using poles for given span
|
|
236
|
+
* @deprecated in 4.x. Use sumPoleBufferDerivativesForSpan instead.
|
|
237
|
+
*/
|
|
218
238
|
sumpoleBufferDerivativesForSpan(spanIndexU, spanIndexV) {
|
|
239
|
+
return this.sumPoleBufferDerivativesForSpan(spanIndexU, spanIndexV);
|
|
240
|
+
}
|
|
241
|
+
/** sum derivatives by the weights in the basisBuffer, using poles for given span */
|
|
242
|
+
sumPoleBufferDerivativesForSpan(spanIndexU, spanIndexV) {
|
|
219
243
|
const poleBuffer1U = this._poleBuffer1UV[0];
|
|
220
244
|
const poleBuffer1V = this._poleBuffer1UV[1];
|
|
221
245
|
poleBuffer1U.fill(0);
|
|
@@ -269,7 +293,7 @@ class BSpline2dNd extends GeometryQuery_1.GeometryQuery {
|
|
|
269
293
|
this.knots[0].evaluateBasisFunctions1(knotIndex0U, u, this._basisBufferUV[0], this._basisBuffer1UV[0]);
|
|
270
294
|
this.knots[1].evaluateBasisFunctions1(knotIndex0V, v, this._basisBufferUV[1], this._basisBuffer1UV[1]);
|
|
271
295
|
this.sumPoleBufferForSpan(poleIndex0U, poleIndex0V);
|
|
272
|
-
this.
|
|
296
|
+
this.sumPoleBufferDerivativesForSpan(poleIndex0U, poleIndex0V);
|
|
273
297
|
}
|
|
274
298
|
}
|
|
275
299
|
// Swap numSwap entries in coffs, starting at i0 and i1 (absolute indices -- not blocks)
|
|
@@ -308,31 +332,33 @@ class BSpline2dNd extends GeometryQuery_1.GeometryQuery {
|
|
|
308
332
|
this.knots[select].reflectKnots();
|
|
309
333
|
}
|
|
310
334
|
/**
|
|
311
|
-
*
|
|
335
|
+
* Get the flag indicating the surface might be suitable for having wrapped "closed" interpretation.
|
|
336
|
+
*/
|
|
337
|
+
getWrappable(select) {
|
|
338
|
+
return this.knots[select].wrappable;
|
|
339
|
+
}
|
|
340
|
+
/**
|
|
341
|
+
* Set the flag indicating the surface might be suitable for having wrapped "closed" interpretation.
|
|
312
342
|
*/
|
|
313
343
|
setWrappable(select, value) {
|
|
314
344
|
this.knots[select].wrappable = value;
|
|
315
345
|
}
|
|
316
346
|
/**
|
|
317
|
-
* Test if
|
|
318
|
-
* @param
|
|
319
|
-
* @
|
|
347
|
+
* Test if leading and trailing blocks of points match in a given direction.
|
|
348
|
+
* @param data packed array of points in row-major order (numRows x numColumns x dimension numbers)
|
|
349
|
+
* @param numRows number of rows of points in the array
|
|
350
|
+
* @param numColumns number of columns of points in the array (equal to the number of points in each row)
|
|
351
|
+
* @param dimension point dimension (e.g., 2,3,4)
|
|
352
|
+
* @param blockLength number of leading/trailing points to check
|
|
353
|
+
* @param select 0 to test first/last columns of points; 1 to test first/last rows of points
|
|
354
|
+
* @returns true if coordinates matched
|
|
320
355
|
*/
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
const numV = this.numPolesUV(1);
|
|
328
|
-
const blockSize = this.poleDimension;
|
|
329
|
-
const rowToRowStep = numU * blockSize;
|
|
330
|
-
const degreeU = this.degreeUV(0);
|
|
331
|
-
const degreeV = this.degreeUV(1);
|
|
332
|
-
const data = this.coffs;
|
|
333
|
-
if (select === 0) {
|
|
334
|
-
const numTest = blockSize * degreeU; // degreeU contiguous poles.
|
|
335
|
-
for (let row = 0; row < numV; row++) {
|
|
356
|
+
static isWrappedGrid(data, numRows, numColumns, dimension, blockLength, select) {
|
|
357
|
+
const rowToRowStep = numColumns * dimension;
|
|
358
|
+
if (UVSelect.uDirection === select) {
|
|
359
|
+
// Test the contiguous block at the start/end of each row
|
|
360
|
+
const numTest = dimension * blockLength;
|
|
361
|
+
for (let row = 0; row < numRows; row++) {
|
|
336
362
|
const i0 = row * rowToRowStep;
|
|
337
363
|
const i1 = i0 + rowToRowStep - numTest;
|
|
338
364
|
for (let i = 0; i < numTest; i++) {
|
|
@@ -342,9 +368,9 @@ class BSpline2dNd extends GeometryQuery_1.GeometryQuery {
|
|
|
342
368
|
}
|
|
343
369
|
}
|
|
344
370
|
else {
|
|
345
|
-
// Test the entire multi-row contiguous block
|
|
346
|
-
const numTest =
|
|
347
|
-
const i1 =
|
|
371
|
+
// Test the entire multi-row contiguous block at the start/end of the array
|
|
372
|
+
const numTest = blockLength * rowToRowStep;
|
|
373
|
+
const i1 = numRows * numColumns * dimension - numTest;
|
|
348
374
|
for (let i = 0; i < numTest; i++) {
|
|
349
375
|
if (!Geometry_1.Geometry.isSameCoordinate(data[i], data[i1 + i]))
|
|
350
376
|
return false;
|
|
@@ -352,6 +378,43 @@ class BSpline2dNd extends GeometryQuery_1.GeometryQuery {
|
|
|
352
378
|
}
|
|
353
379
|
return true;
|
|
354
380
|
}
|
|
381
|
+
/**
|
|
382
|
+
* Test if `degree` leading and trailing (one of U or V) blocks match, as if the data is a non-periodic physically closed spline in the selected direction.
|
|
383
|
+
* @param select select U or V direction
|
|
384
|
+
* @returns true if coordinates matched.
|
|
385
|
+
*/
|
|
386
|
+
testClosableGrid(select, mode) {
|
|
387
|
+
if (mode === undefined)
|
|
388
|
+
mode = this.knots[select].wrappable;
|
|
389
|
+
if (mode === KnotVector_1.BSplineWrapMode.OpenByAddingControlPoints) // the last degree poles equal the first degree poles
|
|
390
|
+
return BSpline2dNd.isWrappedGrid(this.coffs, this.numPolesUV(UVSelect.vDirection), this.numPolesUV(UVSelect.uDirection), this.poleDimension, this.degreeUV(select), select);
|
|
391
|
+
if (mode === KnotVector_1.BSplineWrapMode.OpenByRemovingKnots) // the last pole equals the first pole
|
|
392
|
+
return BSpline2dNd.isWrappedGrid(this.coffs, this.numPolesUV(UVSelect.vDirection), this.numPolesUV(UVSelect.uDirection), this.poleDimension, 1, select);
|
|
393
|
+
return false;
|
|
394
|
+
}
|
|
395
|
+
/**
|
|
396
|
+
* Test knots and control points to determine if it is possible to close (aka "wrap") the surface in the selected parametric direction.
|
|
397
|
+
* @param select select U or V direction
|
|
398
|
+
* @return whether the surface can be wrapped in the given parametric direction.
|
|
399
|
+
*/
|
|
400
|
+
isClosable(select) {
|
|
401
|
+
return KnotVector_1.BSplineWrapMode.None !== this.isClosableSurface(select);
|
|
402
|
+
}
|
|
403
|
+
/**
|
|
404
|
+
* Test knots and control points to determine if it is possible to close (aka "wrap") the surface in the selected parametric direction.
|
|
405
|
+
* @param select select U or V direction
|
|
406
|
+
* @return the manner of closing. See `BSplineWrapMode` for particulars of each mode.
|
|
407
|
+
*/
|
|
408
|
+
isClosableSurface(select) {
|
|
409
|
+
const mode = this.knots[select].wrappable;
|
|
410
|
+
if (mode === KnotVector_1.BSplineWrapMode.None)
|
|
411
|
+
return KnotVector_1.BSplineWrapMode.None;
|
|
412
|
+
if (!this.knots[select].testClosable(mode))
|
|
413
|
+
return KnotVector_1.BSplineWrapMode.None;
|
|
414
|
+
if (!this.testClosableGrid(select, mode))
|
|
415
|
+
return KnotVector_1.BSplineWrapMode.None;
|
|
416
|
+
return mode;
|
|
417
|
+
}
|
|
355
418
|
}
|
|
356
419
|
exports.BSpline2dNd = BSpline2dNd;
|
|
357
420
|
/** BSplineSurface3d is a parametric surface in xyz space.
|
|
@@ -393,7 +456,8 @@ class BSplineSurface3d extends BSpline2dNd {
|
|
|
393
456
|
getPointGridJSON() {
|
|
394
457
|
const result = {
|
|
395
458
|
points: PointHelpers_1.Point3dArray.unpackNumbersToNestedArraysIJK(this.coffs, 3, this.numPolesUV(0)),
|
|
396
|
-
weighStyle: WeightStyle.
|
|
459
|
+
weighStyle: WeightStyle.WeightsAlreadyAppliedToCoordinates,
|
|
460
|
+
weightStyle: WeightStyle.UnWeighted,
|
|
397
461
|
numCartesianDimensions: 3,
|
|
398
462
|
};
|
|
399
463
|
return result;
|
|
@@ -405,23 +469,24 @@ class BSplineSurface3d extends BSpline2dNd {
|
|
|
405
469
|
* in classic over-clamped manner
|
|
406
470
|
*/
|
|
407
471
|
copyKnots(select, includeExtraEndKnot) { return this.knots[select].copyKnots(includeExtraEndKnot); }
|
|
408
|
-
/**
|
|
472
|
+
/**
|
|
473
|
+
* Create a bspline surface.
|
|
409
474
|
* * This `create` variant takes control points in a "flattened" array, with
|
|
410
475
|
* points from succeeding U rows packed together in one array. Use `createGrid` if the points are in
|
|
411
476
|
* a row-by-row grid structure
|
|
412
477
|
* * knotArrayU and knotArrayV are optional -- uniform knots are implied if they are omitted (undefined).
|
|
413
|
-
* *
|
|
414
|
-
*
|
|
478
|
+
* * When knots are given, two knot count conditions are recognized:
|
|
479
|
+
* * If poleArray.length + order == knotArray.length, the first and last are assumed to be the
|
|
415
480
|
* extraneous knots of classic clamping.
|
|
416
|
-
*
|
|
481
|
+
* * If poleArray.length + order == knotArray.length + 2, the knots are in modern form that does not have
|
|
417
482
|
* the classic unused first and last knot.
|
|
418
483
|
* @param controlPointArray Array of points, ordered along the U direction.
|
|
419
|
-
* @param numPoleU number of poles in each row
|
|
484
|
+
* @param numPoleU number of poles in each row
|
|
420
485
|
* @param orderU order for the U direction polynomial (`order` is one more than the `degree`. "cubic" polynomial is order 4.)
|
|
421
|
-
* @param
|
|
422
|
-
* @param numPoleV number of
|
|
486
|
+
* @param knotArrayU knots for the V direction. See note above about knot counts.
|
|
487
|
+
* @param numPoleV number of rows of poles
|
|
423
488
|
* @param orderV order for the V direction polynomial (`order` is one more than the `degree`. "cubic" polynomial is order 4.)
|
|
424
|
-
* @param
|
|
489
|
+
* @param knotArrayV knots for the V direction. See note above about knot counts.
|
|
425
490
|
*/
|
|
426
491
|
static create(controlPointArray, numPolesU, orderU, knotArrayU, numPolesV, orderV, knotArrayV) {
|
|
427
492
|
let numPoles = controlPointArray.length;
|
|
@@ -458,40 +523,41 @@ class BSplineSurface3d extends BSpline2dNd {
|
|
|
458
523
|
const surface = new BSplineSurface3d(numPolesU, numPolesV, knotsU, knotsV, coffs);
|
|
459
524
|
return surface;
|
|
460
525
|
}
|
|
461
|
-
/**
|
|
526
|
+
/**
|
|
527
|
+
* Create a bspline surface.
|
|
462
528
|
* * This `create` variant takes control points in a "grid" array, with the points from
|
|
463
|
-
*
|
|
529
|
+
* each grid row `[rowIndex]` being an independent array `points[rowIndex][indexAlongRow][x,y,z]`
|
|
464
530
|
* * knotArrayU and knotArrayV are optional -- uniform knots are implied if they are omitted (undefined).
|
|
465
|
-
* *
|
|
466
|
-
*
|
|
531
|
+
* * When knots are given, two knot count conditions are recognized in each direction:
|
|
532
|
+
* * If poleArray.length + order == knotArray.length, the first and last are assumed to be the
|
|
467
533
|
* extraneous knots of classic clamping.
|
|
468
|
-
*
|
|
534
|
+
* * If poleArray.length + order == knotArray.length + 2, the knots are in modern form that does not have
|
|
469
535
|
* the classic unused first and last knot.
|
|
470
|
-
* @param
|
|
471
|
-
* @param numPoleU number of poles in each row in the U direction.
|
|
536
|
+
* @param points Array of points, ordered along the U direction.
|
|
472
537
|
* @param orderU order for the U direction polynomial (`order` is one more than the `degree`. "cubic" polynomial is order 4.)
|
|
473
|
-
* @param
|
|
474
|
-
* @param numPoleV number of poles in each row in the U direction.
|
|
538
|
+
* @param knotArrayU knots for the V direction. See note above about knot counts.
|
|
475
539
|
* @param orderV order for the V direction polynomial (`order` is one more than the `degree`. "cubic" polynomial is order 4.)
|
|
476
|
-
* @param
|
|
540
|
+
* @param knotArrayV knots for the V direction. See note above about knot counts.
|
|
477
541
|
*/
|
|
478
542
|
static createGrid(points, orderU, knotArrayU, orderV, knotArrayV) {
|
|
479
543
|
const numPolesV = points.length;
|
|
480
544
|
const numPolesU = points[0].length;
|
|
481
545
|
const numPoles = numPolesU * numPolesV;
|
|
546
|
+
if (3 !== points[0][0].length)
|
|
547
|
+
return undefined;
|
|
548
|
+
if (!this.validOrderAndPoleCounts(orderU, numPolesU, orderV, numPolesV, numPoles))
|
|
549
|
+
return undefined;
|
|
482
550
|
// shift knots-of-interest limits for overclamped case ...
|
|
483
551
|
const numKnotsU = knotArrayU ? knotArrayU.length : numPolesU + orderU - 2;
|
|
484
552
|
const numKnotsV = knotArrayV ? knotArrayV.length : numPolesV + orderV - 2;
|
|
485
553
|
const skipFirstAndLastU = (numPolesU + orderU === numKnotsU);
|
|
486
554
|
const skipFirstAndLastV = (numPolesV + orderV === numKnotsV);
|
|
487
|
-
if (!this.validOrderAndPoleCounts(orderU, numPolesU, orderV, numPolesV, numPoles))
|
|
488
|
-
return undefined;
|
|
489
555
|
const knotsU = knotArrayU ?
|
|
490
556
|
KnotVector_1.KnotVector.create(knotArrayU, orderU - 1, skipFirstAndLastU) :
|
|
491
557
|
KnotVector_1.KnotVector.createUniformClamped(numPolesU, orderU - 1, 0.0, 1.0);
|
|
492
558
|
const knotsV = knotArrayV ?
|
|
493
559
|
KnotVector_1.KnotVector.create(knotArrayV, orderV - 1, skipFirstAndLastV) :
|
|
494
|
-
KnotVector_1.KnotVector.createUniformClamped(
|
|
560
|
+
KnotVector_1.KnotVector.createUniformClamped(numPolesV, orderV - 1, 0.0, 1.0);
|
|
495
561
|
const coffs = new Float64Array(3 * numPolesU * numPolesV);
|
|
496
562
|
let i = 0;
|
|
497
563
|
for (const row of points) {
|
|
@@ -501,8 +567,7 @@ class BSplineSurface3d extends BSpline2dNd {
|
|
|
501
567
|
coffs[i++] = xyz[2];
|
|
502
568
|
}
|
|
503
569
|
}
|
|
504
|
-
|
|
505
|
-
return surface;
|
|
570
|
+
return new BSplineSurface3d(numPolesU, numPolesV, knotsU, knotsV, coffs);
|
|
506
571
|
}
|
|
507
572
|
/**
|
|
508
573
|
* Return a complete copy of the bspline surface.
|
|
@@ -557,6 +622,14 @@ class BSplineSurface3d extends BSpline2dNd {
|
|
|
557
622
|
const knotV = this.knots[1].fractionToKnot(fractionV);
|
|
558
623
|
return this.knotToPointAndDerivatives(knotU, knotV, result);
|
|
559
624
|
}
|
|
625
|
+
/** Implementation of the UVSurface interface; allows `PolyfaceBuilder.addUVGridBody` to facet this B-spline surface. */
|
|
626
|
+
uvFractionToPoint(u, v) {
|
|
627
|
+
return this.fractionToPoint(u, v);
|
|
628
|
+
}
|
|
629
|
+
/** Implementation of the UVSurface interface; allows `PolyfaceBuilder.addUVGridBody` to facet this B-spline surface. */
|
|
630
|
+
uvFractionToPointAndTangents(u, v, result) {
|
|
631
|
+
return this.fractionToPointAndDerivatives(u, v, result);
|
|
632
|
+
}
|
|
560
633
|
/** test for identical counts and near-equal coordinates */
|
|
561
634
|
isAlmostEqual(other) {
|
|
562
635
|
if (other instanceof BSplineSurface3d) {
|
|
@@ -600,13 +673,20 @@ class BSplineSurface3dH extends BSpline2dNd {
|
|
|
600
673
|
constructor(numPolesU, numPolesV, knotsU, knotsV, coffs) {
|
|
601
674
|
super(numPolesU, numPolesV, 4, knotsU, knotsV, coffs);
|
|
602
675
|
}
|
|
603
|
-
/**
|
|
676
|
+
/** Unpack the control points to a Point4d array of form [wx,wy,wz,w]. */
|
|
604
677
|
copyPoints4d() { return PointHelpers_1.Point4dArray.unpackToPoint4dArray(this.coffs); }
|
|
605
|
-
/**
|
|
678
|
+
/**
|
|
679
|
+
* Unpack the control points to a Point3d array and an array of weights.
|
|
680
|
+
* @param points output xyz, weighted by default formatter
|
|
681
|
+
* @param weights output weights
|
|
682
|
+
* @param formatter optional xyz formatter. By default, returns a Point3d of form [wx,wy,wz].
|
|
683
|
+
*/
|
|
606
684
|
copyPointsAndWeights(points, weights, formatter = (x, y, z) => Point3dVector3d_1.Point3d.create(x, y, z)) {
|
|
607
685
|
PointHelpers_1.Point4dArray.unpackFloat64ArrayToPointsAndWeights(this.coffs, points, weights, formatter);
|
|
608
686
|
}
|
|
609
|
-
/**
|
|
687
|
+
/**
|
|
688
|
+
* Copy the control points to a packed 3D array.
|
|
689
|
+
* @param unweight if true, output array has form x,y,z; if false, output array has form wx,wy,wz.
|
|
610
690
|
*/
|
|
611
691
|
copyXYZToFloat64Array(unweight) {
|
|
612
692
|
const numPoints = Math.floor(this.coffs.length / 4);
|
|
@@ -628,7 +708,7 @@ class BSplineSurface3dH extends BSpline2dNd {
|
|
|
628
708
|
}
|
|
629
709
|
return result;
|
|
630
710
|
}
|
|
631
|
-
/** unpack from xyzw xyzw ... to packed
|
|
711
|
+
/** unpack from xyzw xyzw ... to packed weights
|
|
632
712
|
*/
|
|
633
713
|
copyWeightsToFloat64Array() {
|
|
634
714
|
const numPoints = Math.floor(this.coffs.length / 4);
|
|
@@ -645,24 +725,23 @@ class BSplineSurface3dH extends BSpline2dNd {
|
|
|
645
725
|
* in classic over-clamped manner
|
|
646
726
|
*/
|
|
647
727
|
copyKnots(select, includeExtraEndKnot) { return this.knots[select].copyKnots(includeExtraEndKnot); }
|
|
648
|
-
/**
|
|
649
|
-
*
|
|
650
|
-
*
|
|
651
|
-
* a deeper grid array structure.
|
|
728
|
+
/**
|
|
729
|
+
* Create a weighted bspline surface, with control points and weights each organized as flattened arrays continuing from one U row to the next.
|
|
730
|
+
* * Use `createGrid` if the control points are in a deeper grid array structure.
|
|
652
731
|
* * knotArrayU and knotArrayV are optional -- uniform knots are implied if they are omitted (undefined).
|
|
653
|
-
* *
|
|
654
|
-
*
|
|
732
|
+
* * When knots are given, two knot count conditions are recognized:
|
|
733
|
+
* * If poleArray.length + order == knotArray.length, the first and last are assumed to be the
|
|
655
734
|
* extraneous knots of classic clamping.
|
|
656
|
-
*
|
|
735
|
+
* * If poleArray.length + order == knotArray.length + 2, the knots are in modern form that does not have
|
|
657
736
|
* the classic unused first and last knot.
|
|
658
|
-
* @param controlPointArray Array of points, ordered along the U direction.
|
|
659
|
-
* @param weightArray array of weights, ordered along the U direction.
|
|
660
|
-
* @param
|
|
737
|
+
* @param controlPointArray Array of [wx,wy,wz] points, ordered along the U direction.
|
|
738
|
+
* @param weightArray array of weights, ordered along the U direction. If undefined, unit weights are installed.
|
|
739
|
+
* @param numPolesU number of poles in each row in the U direction.
|
|
661
740
|
* @param orderU order for the U direction polynomial (`order` is one more than the `degree`. "cubic" polynomial is order 4.)
|
|
662
|
-
* @param
|
|
663
|
-
* @param
|
|
741
|
+
* @param knotArrayU optional knots for the V direction. See note above about knot counts.
|
|
742
|
+
* @param numPolesV number of poles in each column in the V direction (the number of rows).
|
|
664
743
|
* @param orderV order for the V direction polynomial (`order` is one more than the `degree`. "cubic" polynomial is order 4.)
|
|
665
|
-
* @param
|
|
744
|
+
* @param knotArrayV optional knots for the V direction. See note above about knot counts.
|
|
666
745
|
*/
|
|
667
746
|
static create(controlPointArray, weightArray, numPolesU, orderU, knotArrayU, numPolesV, orderV, knotArrayV) {
|
|
668
747
|
const numPoles = numPolesU * numPolesV;
|
|
@@ -678,62 +757,95 @@ class BSplineSurface3dH extends BSpline2dNd {
|
|
|
678
757
|
const knotsV = knotArrayV ?
|
|
679
758
|
KnotVector_1.KnotVector.create(knotArrayV, orderV - 1, skipFirstAndLastV) :
|
|
680
759
|
KnotVector_1.KnotVector.createUniformClamped(numPolesV, orderV - 1, 0.0, 1.0);
|
|
760
|
+
if (undefined === weightArray)
|
|
761
|
+
weightArray = Array(numPoles).fill(1.0); // unit weights
|
|
681
762
|
const coffs = PointHelpers_1.Point4dArray.packPointsAndWeightsToFloat64Array(controlPointArray, weightArray);
|
|
682
763
|
if (coffs === undefined || coffs.length !== 4 * numPolesU * numPolesV)
|
|
683
764
|
return undefined;
|
|
684
765
|
const surface = new BSplineSurface3dH(numPolesU, numPolesV, knotsU, knotsV, coffs);
|
|
685
766
|
return surface;
|
|
686
767
|
}
|
|
687
|
-
/**
|
|
688
|
-
*
|
|
689
|
-
*
|
|
690
|
-
*
|
|
691
|
-
*
|
|
768
|
+
/**
|
|
769
|
+
* Create a bspline surface with given knots.
|
|
770
|
+
* * This `create` variant takes control points in a "grid" array, with the points from
|
|
771
|
+
* each grid row `[rowIndex]` being an independent array `points[rowIndex][indexAlongRow][x,y,z,w]`
|
|
772
|
+
* * knotArrayU and knotArrayV are optional -- uniform knots are implied if they are omitted (undefined).
|
|
773
|
+
* * When knots are given, two count conditions are recognized in each direction:
|
|
774
|
+
* * If poleArray.length + order == knotArray.length, the first and last are assumed to be the
|
|
692
775
|
* extraneous knots of classic clamping.
|
|
693
|
-
*
|
|
694
|
-
*
|
|
776
|
+
* * If poleArray.length + order == knotArray.length + 2, the knots are in modern form that does not have
|
|
777
|
+
* the classic unused first and last knot.
|
|
778
|
+
* @param xyzwGrid Array of points, ordered along the U direction.
|
|
779
|
+
* @param weightStyle how the points are weighted
|
|
780
|
+
* @param orderU order for the U direction polynomial (`order` is one more than the `degree`. "cubic" polynomial is order 4.)
|
|
781
|
+
* @param knotArrayU knots for the V direction. See note above about knot counts.
|
|
782
|
+
* @param orderV order for the V direction polynomial (`order` is one more than the `degree`. "cubic" polynomial is order 4.)
|
|
783
|
+
* @param knotArrayV knots for the V direction. See note above about knot counts.
|
|
695
784
|
*/
|
|
696
785
|
static createGrid(xyzwGrid, weightStyle, orderU, knotArrayU, orderV, knotArrayV) {
|
|
697
786
|
const numPolesV = xyzwGrid.length;
|
|
698
787
|
const numPolesU = xyzwGrid[0].length;
|
|
699
788
|
const numPoles = numPolesU * numPolesV;
|
|
789
|
+
if (4 !== xyzwGrid[0][0].length)
|
|
790
|
+
return undefined;
|
|
700
791
|
if (!this.validOrderAndPoleCounts(orderU, numPolesU, orderV, numPolesV, numPoles))
|
|
701
792
|
return undefined;
|
|
702
|
-
//
|
|
703
|
-
|
|
704
|
-
const
|
|
705
|
-
const
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
const
|
|
709
|
-
|
|
793
|
+
// validate knot counts
|
|
794
|
+
const numKnotsU = knotArrayU ? knotArrayU.length : numPolesU + orderU - 2;
|
|
795
|
+
const numKnotsV = knotArrayV ? knotArrayV.length : numPolesV + orderV - 2;
|
|
796
|
+
const skipFirstAndLastU = (numPolesU + orderU === numKnotsU); // classic over-clamped input knots
|
|
797
|
+
if (!skipFirstAndLastU && numPolesU + orderU !== numKnotsU + 2) // modern knots
|
|
798
|
+
return undefined;
|
|
799
|
+
const skipFirstAndLastV = (numPolesV + orderV === numKnotsV); // classic
|
|
800
|
+
if (!skipFirstAndLastV && numPolesV + orderV !== numKnotsV + 2) // modern
|
|
801
|
+
return undefined;
|
|
802
|
+
const knotsU = knotArrayU ?
|
|
803
|
+
KnotVector_1.KnotVector.create(knotArrayU, orderU - 1, skipFirstAndLastU) :
|
|
804
|
+
KnotVector_1.KnotVector.createUniformClamped(numPolesU, orderU - 1, 0.0, 1.0);
|
|
805
|
+
const knotsV = knotArrayV ?
|
|
806
|
+
KnotVector_1.KnotVector.create(knotArrayV, orderV - 1, skipFirstAndLastV) :
|
|
807
|
+
KnotVector_1.KnotVector.createUniformClamped(numPolesV, orderV - 1, 0.0, 1.0);
|
|
710
808
|
const coffs = new Float64Array(4 * numPoles);
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
for (const
|
|
715
|
-
const
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
809
|
+
let i = 0;
|
|
810
|
+
switch (weightStyle) {
|
|
811
|
+
case WeightStyle.WeightsSeparateFromCoordinates: {
|
|
812
|
+
for (const row of xyzwGrid) {
|
|
813
|
+
for (const point of row) {
|
|
814
|
+
const w = point[3];
|
|
815
|
+
coffs[i++] = point[0] * w;
|
|
816
|
+
coffs[i++] = point[1] * w;
|
|
817
|
+
coffs[i++] = point[2] * w;
|
|
818
|
+
coffs[i++] = point[3];
|
|
819
|
+
}
|
|
720
820
|
}
|
|
821
|
+
break;
|
|
721
822
|
}
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
823
|
+
case WeightStyle.WeightsAlreadyAppliedToCoordinates: {
|
|
824
|
+
for (const row of xyzwGrid) {
|
|
825
|
+
for (const point of row) {
|
|
826
|
+
coffs[i++] = point[0];
|
|
827
|
+
coffs[i++] = point[1];
|
|
828
|
+
coffs[i++] = point[2];
|
|
829
|
+
coffs[i++] = point[3];
|
|
830
|
+
}
|
|
831
|
+
}
|
|
832
|
+
break;
|
|
833
|
+
}
|
|
834
|
+
case WeightStyle.UnWeighted: {
|
|
835
|
+
for (const row of xyzwGrid) {
|
|
836
|
+
for (const point of row) {
|
|
837
|
+
coffs[i++] = point[0];
|
|
838
|
+
coffs[i++] = point[1];
|
|
839
|
+
coffs[i++] = point[2];
|
|
840
|
+
coffs[i++] = 1.0;
|
|
841
|
+
}
|
|
732
842
|
}
|
|
843
|
+
break;
|
|
733
844
|
}
|
|
845
|
+
default:
|
|
846
|
+
return undefined; // unrecognized WeightStyle
|
|
734
847
|
}
|
|
735
|
-
|
|
736
|
-
return surface;
|
|
848
|
+
return new BSplineSurface3dH(numPolesU, numPolesV, knotsU, knotsV, coffs);
|
|
737
849
|
}
|
|
738
850
|
/** Return a deep clone */
|
|
739
851
|
clone() {
|
|
@@ -758,27 +870,30 @@ class BSplineSurface3dH extends BSpline2dNd {
|
|
|
758
870
|
const result = {
|
|
759
871
|
points: PointHelpers_1.Point3dArray.unpackNumbersToNestedArraysIJK(this.coffs, 4, this.numPolesUV(0)),
|
|
760
872
|
numCartesianDimensions: 3,
|
|
873
|
+
weighStyle: WeightStyle.WeightsAlreadyAppliedToCoordinates,
|
|
761
874
|
weightStyle: WeightStyle.WeightsAlreadyAppliedToCoordinates,
|
|
762
875
|
};
|
|
763
876
|
return result;
|
|
764
877
|
}
|
|
765
|
-
/** Evaluate at a position given by a knot value.
|
|
766
|
-
knotToPoint4d(u, v) {
|
|
878
|
+
/** Evaluate at a position given by a knot value. If deweight fails, returns 000. */
|
|
879
|
+
knotToPoint4d(u, v, result) {
|
|
767
880
|
this.evaluateBuffersAtKnot(u, v);
|
|
768
|
-
|
|
881
|
+
result = Point4d_1.Point4d.createFromPacked(this._poleBuffer, 0, result);
|
|
882
|
+
return result ? result : Point4d_1.Point4d.createZero();
|
|
769
883
|
}
|
|
770
884
|
/** Evaluate at a position given by a knot value. */
|
|
771
885
|
knotToPointAndDerivatives(u, v, result) {
|
|
772
886
|
this.evaluateBuffersAtKnot(u, v, 1);
|
|
773
887
|
return Plane3dByOriginAndVectors_1.Plane3dByOriginAndVectors.createOriginAndVectorsWeightedArrays(this._poleBuffer, this._poleBuffer1UV[0], this._poleBuffer1UV[1], result);
|
|
774
888
|
}
|
|
775
|
-
/** Evaluate the Point4d (leaving weights in the point) at given fractional coordinates. */
|
|
776
|
-
fractionToPoint4d(fractionU, fractionV) {
|
|
777
|
-
|
|
889
|
+
/** Evaluate the Point4d (leaving weights in the point) at given fractional coordinates. If deweight fails, returns 000. */
|
|
890
|
+
fractionToPoint4d(fractionU, fractionV, result) {
|
|
891
|
+
result = this.knotToPoint4d(this.knots[0].fractionToKnot(fractionU), this.knots[1].fractionToKnot(fractionV), result);
|
|
892
|
+
return result ? result : Point4d_1.Point4d.createZero();
|
|
778
893
|
}
|
|
779
894
|
/**
|
|
780
|
-
*
|
|
781
|
-
* *
|
|
895
|
+
* Evaluate the surface and return the Cartesian point (weight = 1).
|
|
896
|
+
* * If the surface XYZW point has weight 0, returns 000.
|
|
782
897
|
* @param fractionU u direction fraction
|
|
783
898
|
* @param fractionV v direction fraction
|
|
784
899
|
* @param result optional result
|
|
@@ -811,6 +926,14 @@ class BSplineSurface3dH extends BSpline2dNd {
|
|
|
811
926
|
const knotV = this.knots[1].fractionToKnot(fractionV);
|
|
812
927
|
return this.knotToPointAndDerivatives(knotU, knotV, result);
|
|
813
928
|
}
|
|
929
|
+
/** Implementation of the UVSurface interface; allows `PolyfaceBuilder.addUVGridBody` to facet this B-spline surface. */
|
|
930
|
+
uvFractionToPoint(u, v) {
|
|
931
|
+
return this.fractionToPoint(u, v);
|
|
932
|
+
}
|
|
933
|
+
/** Implementation of the UVSurface interface; allows `PolyfaceBuilder.addUVGridBody` to facet this B-spline surface. */
|
|
934
|
+
uvFractionToPointAndTangents(u, v, result) {
|
|
935
|
+
return this.fractionToPointAndDerivatives(u, v, result);
|
|
936
|
+
}
|
|
814
937
|
/** test for identical counts and near-equal coordinates */
|
|
815
938
|
isAlmostEqual(other) {
|
|
816
939
|
if (other instanceof BSplineSurface3dH) {
|