@itwin/core-geometry 4.1.0-dev.8 → 4.1.0-dev.81
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 +87 -1
- package/lib/cjs/Geometry.js.map +1 -1
- package/lib/cjs/bspline/BSplineCurve.d.ts +1 -1
- package/lib/cjs/bspline/BSplineCurve.d.ts.map +1 -1
- package/lib/cjs/bspline/BSplineCurve.js +2 -2
- package/lib/cjs/bspline/BSplineCurve.js.map +1 -1
- package/lib/cjs/bspline/BSplineSurface.d.ts.map +1 -1
- package/lib/cjs/bspline/BSplineSurface.js +1 -1
- package/lib/cjs/bspline/BSplineSurface.js.map +1 -1
- package/lib/cjs/bspline/BezierCurveBase.d.ts +1 -1
- package/lib/cjs/bspline/BezierCurveBase.d.ts.map +1 -1
- package/lib/cjs/bspline/BezierCurveBase.js +2 -2
- package/lib/cjs/bspline/BezierCurveBase.js.map +1 -1
- package/lib/cjs/bspline/InterpolationCurve3d.js.map +1 -1
- package/lib/cjs/clipping/AlternatingConvexClipTree.d.ts +15 -17
- package/lib/cjs/clipping/AlternatingConvexClipTree.d.ts.map +1 -1
- package/lib/cjs/clipping/AlternatingConvexClipTree.js +24 -20
- package/lib/cjs/clipping/AlternatingConvexClipTree.js.map +1 -1
- package/lib/cjs/clipping/BooleanClipFactory.d.ts +28 -28
- package/lib/cjs/clipping/BooleanClipFactory.d.ts.map +1 -1
- package/lib/cjs/clipping/BooleanClipFactory.js +28 -28
- package/lib/cjs/clipping/BooleanClipFactory.js.map +1 -1
- package/lib/cjs/clipping/BooleanClipNode.d.ts +11 -11
- package/lib/cjs/clipping/BooleanClipNode.d.ts.map +1 -1
- package/lib/cjs/clipping/BooleanClipNode.js +11 -11
- package/lib/cjs/clipping/BooleanClipNode.js.map +1 -1
- package/lib/cjs/clipping/ClipPlane.d.ts +73 -76
- package/lib/cjs/clipping/ClipPlane.d.ts.map +1 -1
- package/lib/cjs/clipping/ClipPlane.js +105 -86
- package/lib/cjs/clipping/ClipPlane.js.map +1 -1
- package/lib/cjs/clipping/ClipPrimitive.d.ts +78 -47
- package/lib/cjs/clipping/ClipPrimitive.d.ts.map +1 -1
- package/lib/cjs/clipping/ClipPrimitive.js +112 -54
- package/lib/cjs/clipping/ClipPrimitive.js.map +1 -1
- package/lib/cjs/clipping/ClipUtils.d.ts +54 -44
- package/lib/cjs/clipping/ClipUtils.d.ts.map +1 -1
- package/lib/cjs/clipping/ClipUtils.js +33 -29
- package/lib/cjs/clipping/ClipUtils.js.map +1 -1
- package/lib/cjs/clipping/ClipVector.d.ts +39 -25
- package/lib/cjs/clipping/ClipVector.d.ts.map +1 -1
- package/lib/cjs/clipping/ClipVector.js +35 -23
- package/lib/cjs/clipping/ClipVector.js.map +1 -1
- package/lib/cjs/clipping/ConvexClipPlaneSet.d.ts +61 -38
- package/lib/cjs/clipping/ConvexClipPlaneSet.d.ts.map +1 -1
- package/lib/cjs/clipping/ConvexClipPlaneSet.js +64 -41
- package/lib/cjs/clipping/ConvexClipPlaneSet.js.map +1 -1
- package/lib/cjs/clipping/UnionOfConvexClipPlaneSets.d.ts +49 -30
- package/lib/cjs/clipping/UnionOfConvexClipPlaneSets.d.ts.map +1 -1
- package/lib/cjs/clipping/UnionOfConvexClipPlaneSets.js +50 -30
- package/lib/cjs/clipping/UnionOfConvexClipPlaneSets.js.map +1 -1
- package/lib/cjs/clipping/internalContexts/LineStringOffsetClipperContext.d.ts +2 -2
- package/lib/cjs/clipping/internalContexts/LineStringOffsetClipperContext.d.ts.map +1 -1
- package/lib/cjs/clipping/internalContexts/LineStringOffsetClipperContext.js +2 -2
- package/lib/cjs/clipping/internalContexts/LineStringOffsetClipperContext.js.map +1 -1
- package/lib/cjs/core-geometry.d.ts +5 -1
- package/lib/cjs/core-geometry.d.ts.map +1 -1
- package/lib/cjs/core-geometry.js +5 -1
- package/lib/cjs/core-geometry.js.map +1 -1
- package/lib/cjs/curve/Arc3d.d.ts +4 -3
- package/lib/cjs/curve/Arc3d.d.ts.map +1 -1
- package/lib/cjs/curve/Arc3d.js +7 -5
- package/lib/cjs/curve/Arc3d.js.map +1 -1
- package/lib/cjs/curve/CurveChainWithDistanceIndex.d.ts +62 -42
- package/lib/cjs/curve/CurveChainWithDistanceIndex.d.ts.map +1 -1
- package/lib/cjs/curve/CurveChainWithDistanceIndex.js +71 -48
- package/lib/cjs/curve/CurveChainWithDistanceIndex.js.map +1 -1
- package/lib/cjs/curve/CurveCollection.d.ts +36 -26
- package/lib/cjs/curve/CurveCollection.d.ts.map +1 -1
- package/lib/cjs/curve/CurveCollection.js +46 -39
- package/lib/cjs/curve/CurveCollection.js.map +1 -1
- package/lib/cjs/curve/CurveCurve.d.ts +6 -2
- package/lib/cjs/curve/CurveCurve.d.ts.map +1 -1
- package/lib/cjs/curve/CurveCurve.js +13 -9
- package/lib/cjs/curve/CurveCurve.js.map +1 -1
- package/lib/cjs/curve/CurveCurveCloseApproachXY.d.ts +74 -68
- package/lib/cjs/curve/CurveCurveCloseApproachXY.d.ts.map +1 -1
- package/lib/cjs/curve/CurveCurveCloseApproachXY.js +100 -108
- package/lib/cjs/curve/CurveCurveCloseApproachXY.js.map +1 -1
- package/lib/cjs/curve/CurveCurveIntersectXY.d.ts +46 -48
- package/lib/cjs/curve/CurveCurveIntersectXY.d.ts.map +1 -1
- package/lib/cjs/curve/CurveCurveIntersectXY.js +72 -61
- package/lib/cjs/curve/CurveCurveIntersectXY.js.map +1 -1
- package/lib/cjs/curve/CurveCurveIntersectXYZ.d.ts +32 -38
- package/lib/cjs/curve/CurveCurveIntersectXYZ.d.ts.map +1 -1
- package/lib/cjs/curve/CurveCurveIntersectXYZ.js +86 -97
- package/lib/cjs/curve/CurveCurveIntersectXYZ.js.map +1 -1
- package/lib/cjs/curve/CurveFactory.d.ts +67 -3
- package/lib/cjs/curve/CurveFactory.d.ts.map +1 -1
- package/lib/cjs/curve/CurveFactory.js +75 -7
- package/lib/cjs/curve/CurveFactory.js.map +1 -1
- package/lib/cjs/curve/CurveLocationDetail.d.ts +6 -6
- package/lib/cjs/curve/CurveLocationDetail.d.ts.map +1 -1
- package/lib/cjs/curve/CurveLocationDetail.js +9 -7
- package/lib/cjs/curve/CurveLocationDetail.js.map +1 -1
- package/lib/cjs/curve/CurveOps.d.ts +77 -0
- package/lib/cjs/curve/CurveOps.d.ts.map +1 -0
- package/lib/cjs/curve/CurveOps.js +160 -0
- package/lib/cjs/curve/CurveOps.js.map +1 -0
- package/lib/cjs/curve/CurvePrimitive.d.ts +26 -18
- package/lib/cjs/curve/CurvePrimitive.d.ts.map +1 -1
- package/lib/cjs/curve/CurvePrimitive.js +4 -3
- package/lib/cjs/curve/CurvePrimitive.js.map +1 -1
- package/lib/cjs/curve/GeometryQuery.d.ts +2 -2
- package/lib/cjs/curve/GeometryQuery.d.ts.map +1 -1
- package/lib/cjs/curve/GeometryQuery.js +2 -2
- package/lib/cjs/curve/GeometryQuery.js.map +1 -1
- package/lib/cjs/curve/LineSegment3d.d.ts +7 -5
- package/lib/cjs/curve/LineSegment3d.d.ts.map +1 -1
- package/lib/cjs/curve/LineSegment3d.js +6 -6
- package/lib/cjs/curve/LineSegment3d.js.map +1 -1
- package/lib/cjs/curve/LineString3d.d.ts +2 -2
- package/lib/cjs/curve/LineString3d.d.ts.map +1 -1
- package/lib/cjs/curve/LineString3d.js +3 -3
- package/lib/cjs/curve/LineString3d.js.map +1 -1
- package/lib/cjs/curve/Loop.d.ts +7 -5
- package/lib/cjs/curve/Loop.d.ts.map +1 -1
- package/lib/cjs/curve/Loop.js +18 -6
- package/lib/cjs/curve/Loop.js.map +1 -1
- package/lib/cjs/curve/OffsetOptions.d.ts +97 -0
- package/lib/cjs/curve/OffsetOptions.d.ts.map +1 -0
- package/lib/cjs/curve/OffsetOptions.js +166 -0
- package/lib/cjs/curve/OffsetOptions.js.map +1 -0
- package/lib/cjs/curve/ParityRegion.d.ts +7 -7
- package/lib/cjs/curve/ParityRegion.d.ts.map +1 -1
- package/lib/cjs/curve/ParityRegion.js +19 -11
- package/lib/cjs/curve/ParityRegion.js.map +1 -1
- package/lib/cjs/curve/Path.d.ts +6 -6
- package/lib/cjs/curve/Path.d.ts.map +1 -1
- package/lib/cjs/curve/Path.js +15 -9
- package/lib/cjs/curve/Path.js.map +1 -1
- package/lib/cjs/curve/ProxyCurve.d.ts +5 -7
- package/lib/cjs/curve/ProxyCurve.d.ts.map +1 -1
- package/lib/cjs/curve/ProxyCurve.js +7 -7
- package/lib/cjs/curve/ProxyCurve.js.map +1 -1
- package/lib/cjs/curve/Query/StrokeCountMap.js.map +1 -1
- package/lib/cjs/curve/RegionOps.d.ts +76 -56
- package/lib/cjs/curve/RegionOps.d.ts.map +1 -1
- package/lib/cjs/curve/RegionOps.js +83 -60
- package/lib/cjs/curve/RegionOps.js.map +1 -1
- package/lib/cjs/curve/RegionOpsClassificationSweeps.js +2 -2
- package/lib/cjs/curve/RegionOpsClassificationSweeps.js.map +1 -1
- package/lib/cjs/curve/StrokeOptions.d.ts.map +1 -1
- package/lib/cjs/curve/StrokeOptions.js +6 -2
- package/lib/cjs/curve/StrokeOptions.js.map +1 -1
- package/lib/cjs/curve/UnionRegion.d.ts +6 -5
- package/lib/cjs/curve/UnionRegion.d.ts.map +1 -1
- package/lib/cjs/curve/UnionRegion.js +17 -8
- package/lib/cjs/curve/UnionRegion.js.map +1 -1
- package/lib/cjs/curve/{ChainCollectorContext.d.ts → internalContexts/ChainCollectorContext.d.ts} +4 -4
- package/lib/cjs/curve/internalContexts/ChainCollectorContext.d.ts.map +1 -0
- package/lib/cjs/curve/{ChainCollectorContext.js → internalContexts/ChainCollectorContext.js} +4 -4
- package/lib/cjs/curve/internalContexts/ChainCollectorContext.js.map +1 -0
- package/lib/cjs/curve/internalContexts/GapSearchContext.d.ts +2 -1
- package/lib/cjs/curve/internalContexts/GapSearchContext.d.ts.map +1 -1
- package/lib/cjs/curve/internalContexts/GapSearchContext.js +6 -2
- package/lib/cjs/curve/internalContexts/GapSearchContext.js.map +1 -1
- package/lib/cjs/curve/internalContexts/MultiChainCollector.d.ts +59 -70
- package/lib/cjs/curve/internalContexts/MultiChainCollector.d.ts.map +1 -1
- package/lib/cjs/curve/internalContexts/MultiChainCollector.js +130 -220
- package/lib/cjs/curve/internalContexts/MultiChainCollector.js.map +1 -1
- package/lib/cjs/curve/internalContexts/PlaneAltitudeRangeContext.d.ts +14 -8
- package/lib/cjs/curve/internalContexts/PlaneAltitudeRangeContext.d.ts.map +1 -1
- package/lib/cjs/curve/internalContexts/PlaneAltitudeRangeContext.js +14 -8
- package/lib/cjs/curve/internalContexts/PlaneAltitudeRangeContext.js.map +1 -1
- package/lib/cjs/curve/internalContexts/PolygonOffsetContext.d.ts +23 -95
- package/lib/cjs/curve/internalContexts/PolygonOffsetContext.d.ts.map +1 -1
- package/lib/cjs/curve/internalContexts/PolygonOffsetContext.js +89 -178
- package/lib/cjs/curve/internalContexts/PolygonOffsetContext.js.map +1 -1
- package/lib/cjs/curve/internalContexts/SumLengthsContext.d.ts.map +1 -1
- package/lib/cjs/curve/internalContexts/SumLengthsContext.js +4 -1
- package/lib/cjs/curve/internalContexts/SumLengthsContext.js.map +1 -1
- package/lib/cjs/curve/spiral/IntegratedSpiral3d.js +1 -1
- package/lib/cjs/curve/spiral/IntegratedSpiral3d.js.map +1 -1
- package/lib/cjs/curve/spiral/TransitionSpiral3d.d.ts +1 -1
- package/lib/cjs/curve/spiral/TransitionSpiral3d.d.ts.map +1 -1
- package/lib/cjs/curve/spiral/TransitionSpiral3d.js +2 -2
- package/lib/cjs/curve/spiral/TransitionSpiral3d.js.map +1 -1
- package/lib/cjs/curve/spiral/XYCurveEvaluator.js +1 -1
- package/lib/cjs/curve/spiral/XYCurveEvaluator.js.map +1 -1
- package/lib/cjs/geometry3d/Angle.d.ts +9 -0
- package/lib/cjs/geometry3d/Angle.d.ts.map +1 -1
- package/lib/cjs/geometry3d/Angle.js +13 -0
- package/lib/cjs/geometry3d/Angle.js.map +1 -1
- package/lib/cjs/geometry3d/AngleSweep.js.map +1 -1
- package/lib/cjs/geometry3d/BarycentricTriangle.js.map +1 -1
- package/lib/cjs/geometry3d/BilinearPatch.d.ts +43 -48
- package/lib/cjs/geometry3d/BilinearPatch.d.ts.map +1 -1
- package/lib/cjs/geometry3d/BilinearPatch.js +51 -55
- package/lib/cjs/geometry3d/BilinearPatch.js.map +1 -1
- package/lib/cjs/geometry3d/Ellipsoid.d.ts +1 -1
- package/lib/cjs/geometry3d/Ellipsoid.js +1 -1
- package/lib/cjs/geometry3d/Ellipsoid.js.map +1 -1
- package/lib/cjs/geometry3d/FrameBuilder.d.ts.map +1 -1
- package/lib/cjs/geometry3d/FrameBuilder.js +13 -11
- package/lib/cjs/geometry3d/FrameBuilder.js.map +1 -1
- package/lib/cjs/geometry3d/GeometryHandler.d.ts +103 -97
- package/lib/cjs/geometry3d/GeometryHandler.d.ts.map +1 -1
- package/lib/cjs/geometry3d/GeometryHandler.js +247 -124
- package/lib/cjs/geometry3d/GeometryHandler.js.map +1 -1
- package/lib/cjs/geometry3d/GrowableBlockedArray.d.ts.map +1 -1
- package/lib/cjs/geometry3d/GrowableBlockedArray.js +1 -1
- package/lib/cjs/geometry3d/GrowableBlockedArray.js.map +1 -1
- package/lib/cjs/geometry3d/GrowableFloat64Array.d.ts.map +1 -1
- package/lib/cjs/geometry3d/GrowableFloat64Array.js +1 -1
- package/lib/cjs/geometry3d/GrowableFloat64Array.js.map +1 -1
- package/lib/cjs/geometry3d/Matrix3d.d.ts +18 -0
- package/lib/cjs/geometry3d/Matrix3d.d.ts.map +1 -1
- package/lib/cjs/geometry3d/Matrix3d.js +32 -5
- package/lib/cjs/geometry3d/Matrix3d.js.map +1 -1
- package/lib/cjs/geometry3d/OrderedRotationAngles.js.map +1 -1
- package/lib/cjs/geometry3d/Plane3d.d.ts +41 -32
- package/lib/cjs/geometry3d/Plane3d.d.ts.map +1 -1
- package/lib/cjs/geometry3d/Plane3d.js +11 -8
- package/lib/cjs/geometry3d/Plane3d.js.map +1 -1
- package/lib/cjs/geometry3d/Plane3dByOriginAndUnitNormal.d.ts +37 -34
- package/lib/cjs/geometry3d/Plane3dByOriginAndUnitNormal.d.ts.map +1 -1
- package/lib/cjs/geometry3d/Plane3dByOriginAndUnitNormal.js +65 -43
- package/lib/cjs/geometry3d/Plane3dByOriginAndUnitNormal.js.map +1 -1
- package/lib/cjs/geometry3d/Plane3dByOriginAndVectors.d.ts +36 -32
- package/lib/cjs/geometry3d/Plane3dByOriginAndVectors.d.ts.map +1 -1
- package/lib/cjs/geometry3d/Plane3dByOriginAndVectors.js +37 -32
- package/lib/cjs/geometry3d/Plane3dByOriginAndVectors.js.map +1 -1
- package/lib/cjs/geometry3d/Point2dVector2d.d.ts +8 -9
- package/lib/cjs/geometry3d/Point2dVector2d.d.ts.map +1 -1
- package/lib/cjs/geometry3d/Point2dVector2d.js +9 -10
- package/lib/cjs/geometry3d/Point2dVector2d.js.map +1 -1
- package/lib/cjs/geometry3d/Point3dArrayCarrier.js.map +1 -1
- package/lib/cjs/geometry3d/Point3dVector3d.d.ts +12 -4
- package/lib/cjs/geometry3d/Point3dVector3d.d.ts.map +1 -1
- package/lib/cjs/geometry3d/Point3dVector3d.js +18 -5
- package/lib/cjs/geometry3d/Point3dVector3d.js.map +1 -1
- package/lib/cjs/geometry3d/PointHelpers.d.ts.map +1 -1
- package/lib/cjs/geometry3d/PointHelpers.js +5 -5
- package/lib/cjs/geometry3d/PointHelpers.js.map +1 -1
- package/lib/cjs/geometry3d/PolygonOps.d.ts +6 -2
- package/lib/cjs/geometry3d/PolygonOps.d.ts.map +1 -1
- package/lib/cjs/geometry3d/PolygonOps.js +31 -22
- package/lib/cjs/geometry3d/PolygonOps.js.map +1 -1
- package/lib/cjs/geometry3d/PolylineOps.d.ts +16 -1
- package/lib/cjs/geometry3d/PolylineOps.d.ts.map +1 -1
- package/lib/cjs/geometry3d/PolylineOps.js +55 -0
- package/lib/cjs/geometry3d/PolylineOps.js.map +1 -1
- package/lib/cjs/geometry3d/Range.d.ts +134 -94
- package/lib/cjs/geometry3d/Range.d.ts.map +1 -1
- package/lib/cjs/geometry3d/Range.js +297 -145
- package/lib/cjs/geometry3d/Range.js.map +1 -1
- package/lib/cjs/geometry3d/Ray2d.d.ts +69 -0
- package/lib/cjs/geometry3d/Ray2d.d.ts.map +1 -0
- package/lib/cjs/geometry3d/Ray2d.js +146 -0
- package/lib/cjs/geometry3d/Ray2d.js.map +1 -0
- package/lib/cjs/geometry3d/Ray3d.d.ts.map +1 -1
- package/lib/cjs/geometry3d/Ray3d.js.map +1 -1
- package/lib/cjs/geometry3d/Transform.d.ts +10 -3
- package/lib/cjs/geometry3d/Transform.d.ts.map +1 -1
- package/lib/cjs/geometry3d/Transform.js +18 -6
- package/lib/cjs/geometry3d/Transform.js.map +1 -1
- package/lib/cjs/geometry3d/YawPitchRollAngles.js.map +1 -1
- package/lib/cjs/numerics/ConvexPolygon2d.d.ts +7 -49
- package/lib/cjs/numerics/ConvexPolygon2d.d.ts.map +1 -1
- package/lib/cjs/numerics/ConvexPolygon2d.js +16 -107
- package/lib/cjs/numerics/ConvexPolygon2d.js.map +1 -1
- package/lib/cjs/numerics/Newton.js.map +1 -1
- package/lib/cjs/numerics/Polynomials.d.ts.map +1 -1
- package/lib/cjs/numerics/Polynomials.js +0 -2
- package/lib/cjs/numerics/Polynomials.js.map +1 -1
- package/lib/cjs/numerics/Quadrature.js +5 -5
- package/lib/cjs/numerics/Quadrature.js.map +1 -1
- package/lib/cjs/polyface/IndexedEdgeMatcher.js +1 -1
- package/lib/cjs/polyface/IndexedEdgeMatcher.js.map +1 -1
- package/lib/cjs/polyface/PolyfaceBuilder.d.ts.map +1 -1
- package/lib/cjs/polyface/PolyfaceBuilder.js +2 -2
- package/lib/cjs/polyface/PolyfaceBuilder.js.map +1 -1
- package/lib/cjs/polyface/PolyfaceQuery.d.ts +93 -14
- package/lib/cjs/polyface/PolyfaceQuery.d.ts.map +1 -1
- package/lib/cjs/polyface/PolyfaceQuery.js +173 -34
- package/lib/cjs/polyface/PolyfaceQuery.js.map +1 -1
- package/lib/cjs/polyface/TaggedNumericData.js +1 -1
- package/lib/cjs/polyface/TaggedNumericData.js.map +1 -1
- package/lib/cjs/polyface/multiclip/BuildAverageNormalsContext.js +2 -2
- package/lib/cjs/polyface/multiclip/BuildAverageNormalsContext.js.map +1 -1
- package/lib/cjs/polyface/multiclip/GriddedRaggedRange2dSet.d.ts +27 -19
- package/lib/cjs/polyface/multiclip/GriddedRaggedRange2dSet.d.ts.map +1 -1
- package/lib/cjs/polyface/multiclip/GriddedRaggedRange2dSet.js +30 -12
- package/lib/cjs/polyface/multiclip/GriddedRaggedRange2dSet.js.map +1 -1
- package/lib/cjs/polyface/multiclip/GriddedRaggedRange2dSetWithOverflow.d.ts +12 -8
- package/lib/cjs/polyface/multiclip/GriddedRaggedRange2dSetWithOverflow.d.ts.map +1 -1
- package/lib/cjs/polyface/multiclip/GriddedRaggedRange2dSetWithOverflow.js +18 -4
- package/lib/cjs/polyface/multiclip/GriddedRaggedRange2dSetWithOverflow.js.map +1 -1
- package/lib/cjs/polyface/multiclip/LinearSearchRange2dArray.d.ts +3 -4
- package/lib/cjs/polyface/multiclip/LinearSearchRange2dArray.d.ts.map +1 -1
- package/lib/cjs/polyface/multiclip/LinearSearchRange2dArray.js +3 -5
- package/lib/cjs/polyface/multiclip/LinearSearchRange2dArray.js.map +1 -1
- package/lib/cjs/polyface/multiclip/OffsetMeshContext.js.map +1 -1
- package/lib/cjs/polyface/multiclip/Range2dSearchInterface.d.ts +15 -12
- package/lib/cjs/polyface/multiclip/Range2dSearchInterface.d.ts.map +1 -1
- package/lib/cjs/polyface/multiclip/Range2dSearchInterface.js.map +1 -1
- package/lib/cjs/polyface/multiclip/SweepLineStringToFacetContext.d.ts +38 -0
- package/lib/cjs/polyface/multiclip/SweepLineStringToFacetContext.d.ts.map +1 -1
- package/lib/cjs/polyface/multiclip/SweepLineStringToFacetContext.js +104 -1
- package/lib/cjs/polyface/multiclip/SweepLineStringToFacetContext.js.map +1 -1
- package/lib/cjs/serialization/BGFBWriter.js.map +1 -1
- package/lib/cjs/serialization/GeometrySamples.d.ts +11 -0
- package/lib/cjs/serialization/GeometrySamples.d.ts.map +1 -1
- package/lib/cjs/serialization/GeometrySamples.js +30 -0
- package/lib/cjs/serialization/GeometrySamples.js.map +1 -1
- package/lib/cjs/serialization/IModelJsonSchema.d.ts +2 -7
- package/lib/cjs/serialization/IModelJsonSchema.d.ts.map +1 -1
- package/lib/cjs/serialization/IModelJsonSchema.js +2 -7
- package/lib/cjs/serialization/IModelJsonSchema.js.map +1 -1
- package/lib/cjs/solid/LinearSweep.d.ts +2 -1
- package/lib/cjs/solid/LinearSweep.d.ts.map +1 -1
- package/lib/cjs/solid/LinearSweep.js.map +1 -1
- package/lib/cjs/solid/RotationalSweep.d.ts +2 -1
- package/lib/cjs/solid/RotationalSweep.d.ts.map +1 -1
- package/lib/cjs/solid/RotationalSweep.js.map +1 -1
- package/lib/cjs/solid/RuledSweep.d.ts +2 -1
- package/lib/cjs/solid/RuledSweep.d.ts.map +1 -1
- package/lib/cjs/solid/RuledSweep.js.map +1 -1
- package/lib/cjs/solid/SweepContour.d.ts +2 -2
- package/lib/cjs/solid/SweepContour.d.ts.map +1 -1
- package/lib/cjs/solid/SweepContour.js +9 -0
- package/lib/cjs/solid/SweepContour.js.map +1 -1
- package/lib/cjs/topology/ChainMerge.js +1 -1
- package/lib/cjs/topology/ChainMerge.js.map +1 -1
- package/lib/cjs/topology/HalfEdgeGraphSearch.d.ts.map +1 -1
- package/lib/cjs/topology/HalfEdgeGraphSearch.js +1 -1
- package/lib/cjs/topology/HalfEdgeGraphSearch.js.map +1 -1
- package/lib/cjs/topology/HalfEdgeGraphSpineContext.js +1 -1
- package/lib/cjs/topology/HalfEdgeGraphSpineContext.js.map +1 -1
- package/lib/cjs/topology/HalfEdgePriorityQueue.d.ts.map +1 -1
- package/lib/cjs/topology/HalfEdgePriorityQueue.js +1 -1
- package/lib/cjs/topology/HalfEdgePriorityQueue.js.map +1 -1
- package/lib/cjs/topology/RegularizeFace.js +3 -3
- package/lib/cjs/topology/RegularizeFace.js.map +1 -1
- package/lib/cjs/topology/Triangulation.js +1 -1
- package/lib/cjs/topology/Triangulation.js.map +1 -1
- package/lib/esm/Geometry.js.map +1 -1
- package/lib/esm/bspline/BSplineCurve.d.ts +1 -1
- package/lib/esm/bspline/BSplineCurve.d.ts.map +1 -1
- package/lib/esm/bspline/BSplineCurve.js +1 -1
- package/lib/esm/bspline/BSplineCurve.js.map +1 -1
- package/lib/esm/bspline/BSplineSurface.d.ts.map +1 -1
- package/lib/esm/bspline/BSplineSurface.js +1 -1
- package/lib/esm/bspline/BSplineSurface.js.map +1 -1
- package/lib/esm/bspline/BezierCurveBase.d.ts +1 -1
- package/lib/esm/bspline/BezierCurveBase.d.ts.map +1 -1
- package/lib/esm/bspline/BezierCurveBase.js +1 -1
- package/lib/esm/bspline/BezierCurveBase.js.map +1 -1
- package/lib/esm/bspline/InterpolationCurve3d.js.map +1 -1
- package/lib/esm/clipping/AlternatingConvexClipTree.d.ts +15 -17
- package/lib/esm/clipping/AlternatingConvexClipTree.d.ts.map +1 -1
- package/lib/esm/clipping/AlternatingConvexClipTree.js +24 -20
- package/lib/esm/clipping/AlternatingConvexClipTree.js.map +1 -1
- package/lib/esm/clipping/BooleanClipFactory.d.ts +28 -28
- package/lib/esm/clipping/BooleanClipFactory.d.ts.map +1 -1
- package/lib/esm/clipping/BooleanClipFactory.js +28 -28
- package/lib/esm/clipping/BooleanClipFactory.js.map +1 -1
- package/lib/esm/clipping/BooleanClipNode.d.ts +11 -11
- package/lib/esm/clipping/BooleanClipNode.d.ts.map +1 -1
- package/lib/esm/clipping/BooleanClipNode.js +11 -11
- package/lib/esm/clipping/BooleanClipNode.js.map +1 -1
- package/lib/esm/clipping/ClipPlane.d.ts +73 -76
- package/lib/esm/clipping/ClipPlane.d.ts.map +1 -1
- package/lib/esm/clipping/ClipPlane.js +105 -86
- package/lib/esm/clipping/ClipPlane.js.map +1 -1
- package/lib/esm/clipping/ClipPrimitive.d.ts +78 -47
- package/lib/esm/clipping/ClipPrimitive.d.ts.map +1 -1
- package/lib/esm/clipping/ClipPrimitive.js +112 -54
- package/lib/esm/clipping/ClipPrimitive.js.map +1 -1
- package/lib/esm/clipping/ClipUtils.d.ts +54 -44
- package/lib/esm/clipping/ClipUtils.d.ts.map +1 -1
- package/lib/esm/clipping/ClipUtils.js +33 -29
- package/lib/esm/clipping/ClipUtils.js.map +1 -1
- package/lib/esm/clipping/ClipVector.d.ts +39 -25
- package/lib/esm/clipping/ClipVector.d.ts.map +1 -1
- package/lib/esm/clipping/ClipVector.js +35 -23
- package/lib/esm/clipping/ClipVector.js.map +1 -1
- package/lib/esm/clipping/ConvexClipPlaneSet.d.ts +61 -38
- package/lib/esm/clipping/ConvexClipPlaneSet.d.ts.map +1 -1
- package/lib/esm/clipping/ConvexClipPlaneSet.js +64 -41
- package/lib/esm/clipping/ConvexClipPlaneSet.js.map +1 -1
- package/lib/esm/clipping/UnionOfConvexClipPlaneSets.d.ts +49 -30
- package/lib/esm/clipping/UnionOfConvexClipPlaneSets.d.ts.map +1 -1
- package/lib/esm/clipping/UnionOfConvexClipPlaneSets.js +50 -30
- package/lib/esm/clipping/UnionOfConvexClipPlaneSets.js.map +1 -1
- package/lib/esm/clipping/internalContexts/LineStringOffsetClipperContext.d.ts +2 -2
- package/lib/esm/clipping/internalContexts/LineStringOffsetClipperContext.d.ts.map +1 -1
- package/lib/esm/clipping/internalContexts/LineStringOffsetClipperContext.js +2 -2
- package/lib/esm/clipping/internalContexts/LineStringOffsetClipperContext.js.map +1 -1
- package/lib/esm/core-geometry.d.ts +5 -1
- package/lib/esm/core-geometry.d.ts.map +1 -1
- package/lib/esm/core-geometry.js +5 -1
- package/lib/esm/core-geometry.js.map +1 -1
- package/lib/esm/curve/Arc3d.d.ts +4 -3
- package/lib/esm/curve/Arc3d.d.ts.map +1 -1
- package/lib/esm/curve/Arc3d.js +6 -4
- package/lib/esm/curve/Arc3d.js.map +1 -1
- package/lib/esm/curve/CurveChainWithDistanceIndex.d.ts +62 -42
- package/lib/esm/curve/CurveChainWithDistanceIndex.d.ts.map +1 -1
- package/lib/esm/curve/CurveChainWithDistanceIndex.js +70 -47
- package/lib/esm/curve/CurveChainWithDistanceIndex.js.map +1 -1
- package/lib/esm/curve/CurveCollection.d.ts +36 -26
- package/lib/esm/curve/CurveCollection.d.ts.map +1 -1
- package/lib/esm/curve/CurveCollection.js +46 -39
- package/lib/esm/curve/CurveCollection.js.map +1 -1
- package/lib/esm/curve/CurveCurve.d.ts +6 -2
- package/lib/esm/curve/CurveCurve.d.ts.map +1 -1
- package/lib/esm/curve/CurveCurve.js +13 -9
- package/lib/esm/curve/CurveCurve.js.map +1 -1
- package/lib/esm/curve/CurveCurveCloseApproachXY.d.ts +74 -68
- package/lib/esm/curve/CurveCurveCloseApproachXY.d.ts.map +1 -1
- package/lib/esm/curve/CurveCurveCloseApproachXY.js +100 -108
- package/lib/esm/curve/CurveCurveCloseApproachXY.js.map +1 -1
- package/lib/esm/curve/CurveCurveIntersectXY.d.ts +46 -48
- package/lib/esm/curve/CurveCurveIntersectXY.d.ts.map +1 -1
- package/lib/esm/curve/CurveCurveIntersectXY.js +72 -61
- package/lib/esm/curve/CurveCurveIntersectXY.js.map +1 -1
- package/lib/esm/curve/CurveCurveIntersectXYZ.d.ts +32 -38
- package/lib/esm/curve/CurveCurveIntersectXYZ.d.ts.map +1 -1
- package/lib/esm/curve/CurveCurveIntersectXYZ.js +86 -97
- package/lib/esm/curve/CurveCurveIntersectXYZ.js.map +1 -1
- package/lib/esm/curve/CurveFactory.d.ts +67 -3
- package/lib/esm/curve/CurveFactory.d.ts.map +1 -1
- package/lib/esm/curve/CurveFactory.js +74 -6
- package/lib/esm/curve/CurveFactory.js.map +1 -1
- package/lib/esm/curve/CurveLocationDetail.d.ts +6 -6
- package/lib/esm/curve/CurveLocationDetail.d.ts.map +1 -1
- package/lib/esm/curve/CurveLocationDetail.js +9 -7
- package/lib/esm/curve/CurveLocationDetail.js.map +1 -1
- package/lib/esm/curve/CurveOps.d.ts +77 -0
- package/lib/esm/curve/CurveOps.d.ts.map +1 -0
- package/lib/esm/curve/CurveOps.js +156 -0
- package/lib/esm/curve/CurveOps.js.map +1 -0
- package/lib/esm/curve/CurvePrimitive.d.ts +26 -18
- package/lib/esm/curve/CurvePrimitive.d.ts.map +1 -1
- package/lib/esm/curve/CurvePrimitive.js +4 -3
- package/lib/esm/curve/CurvePrimitive.js.map +1 -1
- package/lib/esm/curve/GeometryQuery.d.ts +2 -2
- package/lib/esm/curve/GeometryQuery.d.ts.map +1 -1
- package/lib/esm/curve/GeometryQuery.js +2 -2
- package/lib/esm/curve/GeometryQuery.js.map +1 -1
- package/lib/esm/curve/LineSegment3d.d.ts +7 -5
- package/lib/esm/curve/LineSegment3d.d.ts.map +1 -1
- package/lib/esm/curve/LineSegment3d.js +5 -5
- package/lib/esm/curve/LineSegment3d.js.map +1 -1
- package/lib/esm/curve/LineString3d.d.ts +2 -2
- package/lib/esm/curve/LineString3d.d.ts.map +1 -1
- package/lib/esm/curve/LineString3d.js +2 -2
- package/lib/esm/curve/LineString3d.js.map +1 -1
- package/lib/esm/curve/Loop.d.ts +7 -5
- package/lib/esm/curve/Loop.d.ts.map +1 -1
- package/lib/esm/curve/Loop.js +18 -6
- package/lib/esm/curve/Loop.js.map +1 -1
- package/lib/esm/curve/OffsetOptions.d.ts +97 -0
- package/lib/esm/curve/OffsetOptions.d.ts.map +1 -0
- package/lib/esm/curve/OffsetOptions.js +161 -0
- package/lib/esm/curve/OffsetOptions.js.map +1 -0
- package/lib/esm/curve/ParityRegion.d.ts +7 -7
- package/lib/esm/curve/ParityRegion.d.ts.map +1 -1
- package/lib/esm/curve/ParityRegion.js +19 -11
- package/lib/esm/curve/ParityRegion.js.map +1 -1
- package/lib/esm/curve/Path.d.ts +6 -6
- package/lib/esm/curve/Path.d.ts.map +1 -1
- package/lib/esm/curve/Path.js +15 -9
- package/lib/esm/curve/Path.js.map +1 -1
- package/lib/esm/curve/ProxyCurve.d.ts +5 -7
- package/lib/esm/curve/ProxyCurve.d.ts.map +1 -1
- package/lib/esm/curve/ProxyCurve.js +7 -7
- package/lib/esm/curve/ProxyCurve.js.map +1 -1
- package/lib/esm/curve/Query/StrokeCountMap.js.map +1 -1
- package/lib/esm/curve/RegionOps.d.ts +76 -56
- package/lib/esm/curve/RegionOps.d.ts.map +1 -1
- package/lib/esm/curve/RegionOps.js +84 -61
- package/lib/esm/curve/RegionOps.js.map +1 -1
- package/lib/esm/curve/RegionOpsClassificationSweeps.js +2 -2
- package/lib/esm/curve/RegionOpsClassificationSweeps.js.map +1 -1
- package/lib/esm/curve/StrokeOptions.d.ts.map +1 -1
- package/lib/esm/curve/StrokeOptions.js +6 -2
- package/lib/esm/curve/StrokeOptions.js.map +1 -1
- package/lib/esm/curve/UnionRegion.d.ts +6 -5
- package/lib/esm/curve/UnionRegion.d.ts.map +1 -1
- package/lib/esm/curve/UnionRegion.js +17 -8
- package/lib/esm/curve/UnionRegion.js.map +1 -1
- package/lib/esm/curve/{ChainCollectorContext.d.ts → internalContexts/ChainCollectorContext.d.ts} +4 -4
- package/lib/esm/curve/internalContexts/ChainCollectorContext.d.ts.map +1 -0
- package/lib/esm/curve/{ChainCollectorContext.js → internalContexts/ChainCollectorContext.js} +4 -4
- package/lib/esm/curve/internalContexts/ChainCollectorContext.js.map +1 -0
- package/lib/esm/curve/internalContexts/GapSearchContext.d.ts +2 -1
- package/lib/esm/curve/internalContexts/GapSearchContext.d.ts.map +1 -1
- package/lib/esm/curve/internalContexts/GapSearchContext.js +6 -2
- package/lib/esm/curve/internalContexts/GapSearchContext.js.map +1 -1
- package/lib/esm/curve/internalContexts/MultiChainCollector.d.ts +59 -70
- package/lib/esm/curve/internalContexts/MultiChainCollector.d.ts.map +1 -1
- package/lib/esm/curve/internalContexts/MultiChainCollector.js +129 -218
- package/lib/esm/curve/internalContexts/MultiChainCollector.js.map +1 -1
- package/lib/esm/curve/internalContexts/PlaneAltitudeRangeContext.d.ts +14 -8
- package/lib/esm/curve/internalContexts/PlaneAltitudeRangeContext.d.ts.map +1 -1
- package/lib/esm/curve/internalContexts/PlaneAltitudeRangeContext.js +14 -8
- package/lib/esm/curve/internalContexts/PlaneAltitudeRangeContext.js.map +1 -1
- package/lib/esm/curve/internalContexts/PolygonOffsetContext.d.ts +23 -95
- package/lib/esm/curve/internalContexts/PolygonOffsetContext.d.ts.map +1 -1
- package/lib/esm/curve/internalContexts/PolygonOffsetContext.js +86 -173
- package/lib/esm/curve/internalContexts/PolygonOffsetContext.js.map +1 -1
- package/lib/esm/curve/internalContexts/SumLengthsContext.d.ts.map +1 -1
- package/lib/esm/curve/internalContexts/SumLengthsContext.js +4 -1
- package/lib/esm/curve/internalContexts/SumLengthsContext.js.map +1 -1
- package/lib/esm/curve/spiral/IntegratedSpiral3d.js +1 -1
- package/lib/esm/curve/spiral/IntegratedSpiral3d.js.map +1 -1
- package/lib/esm/curve/spiral/TransitionSpiral3d.d.ts +1 -1
- package/lib/esm/curve/spiral/TransitionSpiral3d.d.ts.map +1 -1
- package/lib/esm/curve/spiral/TransitionSpiral3d.js +1 -1
- package/lib/esm/curve/spiral/TransitionSpiral3d.js.map +1 -1
- package/lib/esm/curve/spiral/XYCurveEvaluator.js +1 -1
- package/lib/esm/curve/spiral/XYCurveEvaluator.js.map +1 -1
- package/lib/esm/geometry3d/Angle.d.ts +9 -0
- package/lib/esm/geometry3d/Angle.d.ts.map +1 -1
- package/lib/esm/geometry3d/Angle.js +13 -0
- package/lib/esm/geometry3d/Angle.js.map +1 -1
- package/lib/esm/geometry3d/AngleSweep.js.map +1 -1
- package/lib/esm/geometry3d/BarycentricTriangle.js.map +1 -1
- package/lib/esm/geometry3d/BilinearPatch.d.ts +43 -48
- package/lib/esm/geometry3d/BilinearPatch.d.ts.map +1 -1
- package/lib/esm/geometry3d/BilinearPatch.js +51 -55
- package/lib/esm/geometry3d/BilinearPatch.js.map +1 -1
- package/lib/esm/geometry3d/Ellipsoid.d.ts +1 -1
- package/lib/esm/geometry3d/Ellipsoid.js +1 -1
- package/lib/esm/geometry3d/Ellipsoid.js.map +1 -1
- package/lib/esm/geometry3d/FrameBuilder.d.ts.map +1 -1
- package/lib/esm/geometry3d/FrameBuilder.js +13 -11
- package/lib/esm/geometry3d/FrameBuilder.js.map +1 -1
- package/lib/esm/geometry3d/GeometryHandler.d.ts +103 -97
- package/lib/esm/geometry3d/GeometryHandler.d.ts.map +1 -1
- package/lib/esm/geometry3d/GeometryHandler.js +247 -124
- package/lib/esm/geometry3d/GeometryHandler.js.map +1 -1
- package/lib/esm/geometry3d/GrowableBlockedArray.d.ts.map +1 -1
- package/lib/esm/geometry3d/GrowableBlockedArray.js +1 -1
- package/lib/esm/geometry3d/GrowableBlockedArray.js.map +1 -1
- package/lib/esm/geometry3d/GrowableFloat64Array.d.ts.map +1 -1
- package/lib/esm/geometry3d/GrowableFloat64Array.js +1 -1
- package/lib/esm/geometry3d/GrowableFloat64Array.js.map +1 -1
- package/lib/esm/geometry3d/Matrix3d.d.ts +18 -0
- package/lib/esm/geometry3d/Matrix3d.d.ts.map +1 -1
- package/lib/esm/geometry3d/Matrix3d.js +32 -5
- package/lib/esm/geometry3d/Matrix3d.js.map +1 -1
- package/lib/esm/geometry3d/OrderedRotationAngles.js.map +1 -1
- package/lib/esm/geometry3d/Plane3d.d.ts +41 -32
- package/lib/esm/geometry3d/Plane3d.d.ts.map +1 -1
- package/lib/esm/geometry3d/Plane3d.js +11 -8
- package/lib/esm/geometry3d/Plane3d.js.map +1 -1
- package/lib/esm/geometry3d/Plane3dByOriginAndUnitNormal.d.ts +37 -34
- package/lib/esm/geometry3d/Plane3dByOriginAndUnitNormal.d.ts.map +1 -1
- package/lib/esm/geometry3d/Plane3dByOriginAndUnitNormal.js +65 -43
- package/lib/esm/geometry3d/Plane3dByOriginAndUnitNormal.js.map +1 -1
- package/lib/esm/geometry3d/Plane3dByOriginAndVectors.d.ts +36 -32
- package/lib/esm/geometry3d/Plane3dByOriginAndVectors.d.ts.map +1 -1
- package/lib/esm/geometry3d/Plane3dByOriginAndVectors.js +37 -32
- package/lib/esm/geometry3d/Plane3dByOriginAndVectors.js.map +1 -1
- package/lib/esm/geometry3d/Point2dVector2d.d.ts +8 -9
- package/lib/esm/geometry3d/Point2dVector2d.d.ts.map +1 -1
- package/lib/esm/geometry3d/Point2dVector2d.js +9 -10
- package/lib/esm/geometry3d/Point2dVector2d.js.map +1 -1
- package/lib/esm/geometry3d/Point3dArrayCarrier.js.map +1 -1
- package/lib/esm/geometry3d/Point3dVector3d.d.ts +12 -4
- package/lib/esm/geometry3d/Point3dVector3d.d.ts.map +1 -1
- package/lib/esm/geometry3d/Point3dVector3d.js +18 -5
- package/lib/esm/geometry3d/Point3dVector3d.js.map +1 -1
- package/lib/esm/geometry3d/PointHelpers.d.ts.map +1 -1
- package/lib/esm/geometry3d/PointHelpers.js +5 -5
- package/lib/esm/geometry3d/PointHelpers.js.map +1 -1
- package/lib/esm/geometry3d/PolygonOps.d.ts +6 -2
- package/lib/esm/geometry3d/PolygonOps.d.ts.map +1 -1
- package/lib/esm/geometry3d/PolygonOps.js +31 -22
- package/lib/esm/geometry3d/PolygonOps.js.map +1 -1
- package/lib/esm/geometry3d/PolylineOps.d.ts +16 -1
- package/lib/esm/geometry3d/PolylineOps.d.ts.map +1 -1
- package/lib/esm/geometry3d/PolylineOps.js +56 -1
- package/lib/esm/geometry3d/PolylineOps.js.map +1 -1
- package/lib/esm/geometry3d/Range.d.ts +134 -94
- package/lib/esm/geometry3d/Range.d.ts.map +1 -1
- package/lib/esm/geometry3d/Range.js +297 -145
- package/lib/esm/geometry3d/Range.js.map +1 -1
- package/lib/esm/geometry3d/Ray2d.d.ts +69 -0
- package/lib/esm/geometry3d/Ray2d.d.ts.map +1 -0
- package/lib/esm/geometry3d/Ray2d.js +142 -0
- package/lib/esm/geometry3d/Ray2d.js.map +1 -0
- package/lib/esm/geometry3d/Ray3d.d.ts.map +1 -1
- package/lib/esm/geometry3d/Ray3d.js.map +1 -1
- package/lib/esm/geometry3d/Transform.d.ts +10 -3
- package/lib/esm/geometry3d/Transform.d.ts.map +1 -1
- package/lib/esm/geometry3d/Transform.js +18 -6
- package/lib/esm/geometry3d/Transform.js.map +1 -1
- package/lib/esm/geometry3d/YawPitchRollAngles.js.map +1 -1
- package/lib/esm/numerics/ConvexPolygon2d.d.ts +7 -49
- package/lib/esm/numerics/ConvexPolygon2d.d.ts.map +1 -1
- package/lib/esm/numerics/ConvexPolygon2d.js +14 -104
- package/lib/esm/numerics/ConvexPolygon2d.js.map +1 -1
- package/lib/esm/numerics/Newton.js.map +1 -1
- package/lib/esm/numerics/Polynomials.d.ts.map +1 -1
- package/lib/esm/numerics/Polynomials.js +0 -2
- package/lib/esm/numerics/Polynomials.js.map +1 -1
- package/lib/esm/numerics/Quadrature.js +5 -5
- package/lib/esm/numerics/Quadrature.js.map +1 -1
- package/lib/esm/polyface/IndexedEdgeMatcher.js +1 -1
- package/lib/esm/polyface/IndexedEdgeMatcher.js.map +1 -1
- package/lib/esm/polyface/PolyfaceBuilder.d.ts.map +1 -1
- package/lib/esm/polyface/PolyfaceBuilder.js +2 -2
- package/lib/esm/polyface/PolyfaceBuilder.js.map +1 -1
- package/lib/esm/polyface/PolyfaceQuery.d.ts +93 -14
- package/lib/esm/polyface/PolyfaceQuery.d.ts.map +1 -1
- package/lib/esm/polyface/PolyfaceQuery.js +173 -35
- package/lib/esm/polyface/PolyfaceQuery.js.map +1 -1
- package/lib/esm/polyface/TaggedNumericData.js +1 -1
- package/lib/esm/polyface/TaggedNumericData.js.map +1 -1
- package/lib/esm/polyface/multiclip/BuildAverageNormalsContext.js +2 -2
- package/lib/esm/polyface/multiclip/BuildAverageNormalsContext.js.map +1 -1
- package/lib/esm/polyface/multiclip/GriddedRaggedRange2dSet.d.ts +27 -19
- package/lib/esm/polyface/multiclip/GriddedRaggedRange2dSet.d.ts.map +1 -1
- package/lib/esm/polyface/multiclip/GriddedRaggedRange2dSet.js +30 -12
- package/lib/esm/polyface/multiclip/GriddedRaggedRange2dSet.js.map +1 -1
- package/lib/esm/polyface/multiclip/GriddedRaggedRange2dSetWithOverflow.d.ts +12 -8
- package/lib/esm/polyface/multiclip/GriddedRaggedRange2dSetWithOverflow.d.ts.map +1 -1
- package/lib/esm/polyface/multiclip/GriddedRaggedRange2dSetWithOverflow.js +18 -4
- package/lib/esm/polyface/multiclip/GriddedRaggedRange2dSetWithOverflow.js.map +1 -1
- package/lib/esm/polyface/multiclip/LinearSearchRange2dArray.d.ts +3 -4
- package/lib/esm/polyface/multiclip/LinearSearchRange2dArray.d.ts.map +1 -1
- package/lib/esm/polyface/multiclip/LinearSearchRange2dArray.js +3 -5
- package/lib/esm/polyface/multiclip/LinearSearchRange2dArray.js.map +1 -1
- package/lib/esm/polyface/multiclip/OffsetMeshContext.js.map +1 -1
- package/lib/esm/polyface/multiclip/Range2dSearchInterface.d.ts +15 -12
- package/lib/esm/polyface/multiclip/Range2dSearchInterface.d.ts.map +1 -1
- package/lib/esm/polyface/multiclip/Range2dSearchInterface.js.map +1 -1
- package/lib/esm/polyface/multiclip/SweepLineStringToFacetContext.d.ts +38 -0
- package/lib/esm/polyface/multiclip/SweepLineStringToFacetContext.d.ts.map +1 -1
- package/lib/esm/polyface/multiclip/SweepLineStringToFacetContext.js +102 -1
- package/lib/esm/polyface/multiclip/SweepLineStringToFacetContext.js.map +1 -1
- package/lib/esm/serialization/BGFBWriter.js.map +1 -1
- package/lib/esm/serialization/GeometrySamples.d.ts +11 -0
- package/lib/esm/serialization/GeometrySamples.d.ts.map +1 -1
- package/lib/esm/serialization/GeometrySamples.js +30 -0
- package/lib/esm/serialization/GeometrySamples.js.map +1 -1
- package/lib/esm/serialization/IModelJsonSchema.d.ts +2 -7
- package/lib/esm/serialization/IModelJsonSchema.d.ts.map +1 -1
- package/lib/esm/serialization/IModelJsonSchema.js +2 -7
- package/lib/esm/serialization/IModelJsonSchema.js.map +1 -1
- package/lib/esm/solid/LinearSweep.d.ts +2 -1
- package/lib/esm/solid/LinearSweep.d.ts.map +1 -1
- package/lib/esm/solid/LinearSweep.js.map +1 -1
- package/lib/esm/solid/RotationalSweep.d.ts +2 -1
- package/lib/esm/solid/RotationalSweep.d.ts.map +1 -1
- package/lib/esm/solid/RotationalSweep.js.map +1 -1
- package/lib/esm/solid/RuledSweep.d.ts +2 -1
- package/lib/esm/solid/RuledSweep.d.ts.map +1 -1
- package/lib/esm/solid/RuledSweep.js.map +1 -1
- package/lib/esm/solid/SweepContour.d.ts +2 -2
- package/lib/esm/solid/SweepContour.d.ts.map +1 -1
- package/lib/esm/solid/SweepContour.js +9 -0
- package/lib/esm/solid/SweepContour.js.map +1 -1
- package/lib/esm/topology/ChainMerge.js +1 -1
- package/lib/esm/topology/ChainMerge.js.map +1 -1
- package/lib/esm/topology/HalfEdgeGraphSearch.d.ts.map +1 -1
- package/lib/esm/topology/HalfEdgeGraphSearch.js +1 -1
- package/lib/esm/topology/HalfEdgeGraphSearch.js.map +1 -1
- package/lib/esm/topology/HalfEdgeGraphSpineContext.js +1 -1
- package/lib/esm/topology/HalfEdgeGraphSpineContext.js.map +1 -1
- package/lib/esm/topology/HalfEdgePriorityQueue.d.ts.map +1 -1
- package/lib/esm/topology/HalfEdgePriorityQueue.js +1 -1
- package/lib/esm/topology/HalfEdgePriorityQueue.js.map +1 -1
- package/lib/esm/topology/RegularizeFace.js +3 -3
- package/lib/esm/topology/RegularizeFace.js.map +1 -1
- package/lib/esm/topology/Triangulation.js +1 -1
- package/lib/esm/topology/Triangulation.js.map +1 -1
- package/package.json +6 -17
- package/lib/cjs/curve/ChainCollectorContext.d.ts.map +0 -1
- package/lib/cjs/curve/ChainCollectorContext.js.map +0 -1
- package/lib/esm/curve/ChainCollectorContext.d.ts.map +0 -1
- package/lib/esm/curve/ChainCollectorContext.js.map +0 -1
|
@@ -9,20 +9,25 @@ import { Clipper, ClipPlaneContainment } from "./ClipUtils";
|
|
|
9
9
|
import { Arc3d } from "../curve/Arc3d";
|
|
10
10
|
import { GrowableXYZArray } from "../geometry3d/GrowableXYZArray";
|
|
11
11
|
import { GrowableXYZArrayCache } from "../geometry3d/ReusableObjectCache";
|
|
12
|
-
/**
|
|
12
|
+
/**
|
|
13
|
+
* Wire format describing a [[ClipVector]].
|
|
13
14
|
* @public
|
|
14
15
|
*/
|
|
15
16
|
export type ClipVectorProps = ClipPrimitiveProps[];
|
|
16
|
-
/**
|
|
17
|
+
/**
|
|
18
|
+
* Class holding an array structure of shapes defined by `ClipPrimitive`
|
|
17
19
|
* * The `ClipVector` defines an intersection of the member `ClipPrimitive` regions.
|
|
18
|
-
* * In the most common usage, one of the `ClipPrimitive` will be an outer region, and all others are holes with marker
|
|
20
|
+
* * In the most common usage, one of the `ClipPrimitive` will be an outer region, and all others are holes with marker
|
|
21
|
+
* flag indicating that the outside of each hole is live.
|
|
19
22
|
* @public
|
|
20
23
|
*/
|
|
21
24
|
export declare class ClipVector implements Clipper {
|
|
22
25
|
private _clips;
|
|
23
|
-
/**
|
|
26
|
+
/**
|
|
27
|
+
* Range acting as first filter.
|
|
24
28
|
* * This is understood as overall range limit, not as precise planes.
|
|
25
|
-
* *
|
|
29
|
+
* * Applying any rotation to the whole ClipVector generally expands this range, rather than exactly transforming
|
|
30
|
+
* its planes.
|
|
26
31
|
*/
|
|
27
32
|
boundingRange: Range3d;
|
|
28
33
|
/** Returns a reference to the array of ClipShapes. */
|
|
@@ -52,13 +57,15 @@ export declare class ClipVector implements Clipper {
|
|
|
52
57
|
appendShape(shape: Point3d[], zLow?: number, zHigh?: number, transform?: Transform, isMask?: boolean, invisible?: boolean): boolean;
|
|
53
58
|
/** Returns true if the given point lies inside all of this ClipVector's ClipShapes (by rule of intersection).*/
|
|
54
59
|
pointInside(point: Point3d, onTolerance?: number): boolean;
|
|
55
|
-
/**
|
|
60
|
+
/**
|
|
61
|
+
* Method from [[Clipper]] interface.
|
|
56
62
|
* * Implement as dispatch to clipPlaneSets as supplied by derived class.
|
|
57
63
|
*/
|
|
58
64
|
isPointOnOrInside(point: Point3d, onTolerance?: number): boolean;
|
|
59
65
|
private _clipNodeProxy?;
|
|
60
66
|
private ensureProxyClipNode;
|
|
61
|
-
/**
|
|
67
|
+
/**
|
|
68
|
+
* Method from [[Clipper]] interface.
|
|
62
69
|
* * Implement as dispatch to clipPlaneSets as supplied by derived class.
|
|
63
70
|
*/
|
|
64
71
|
announceClippedSegmentIntervals(f0: number, f1: number, pointA: Point3d, pointB: Point3d, announce?: AnnounceNumberNumber): boolean;
|
|
@@ -68,28 +75,30 @@ export declare class ClipVector implements Clipper {
|
|
|
68
75
|
announceClippedArcIntervals(arc: Arc3d, announce?: AnnounceNumberNumberCurvePrimitive): boolean;
|
|
69
76
|
/** Execute polygon clip as intersection of the child primitives. */
|
|
70
77
|
appendPolygonClip(xyz: GrowableXYZArray, insideFragments: GrowableXYZArray[], outsideFragments: GrowableXYZArray[], arrayCache: GrowableXYZArrayCache): void;
|
|
71
|
-
/**
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
78
|
+
/**
|
|
79
|
+
* Transforms this ClipVector to a new coordinate-system.
|
|
80
|
+
* Note that if the transform has rotate and scale the boundingRange member expands.
|
|
81
|
+
* Returns true if successful.
|
|
82
|
+
*/
|
|
75
83
|
transformInPlace(transform: Transform): boolean;
|
|
76
84
|
/**
|
|
77
85
|
* A simple way of packaging this ClipVector's ClipShape points into a multidimensional array, while also
|
|
78
86
|
* taking into account each ClipPrimitive's individual transforms.
|
|
79
|
-
*
|
|
80
87
|
* ClipPrimitives OTHER THAN ClipShape are ignored.
|
|
81
|
-
*
|
|
82
88
|
* Information out:
|
|
83
|
-
* - All of the loop points are stored in the multidimensional Point3d array given (will return unchanged upon failure)
|
|
84
|
-
* - If given a transform, will be set from the transformFromClip of the first ClipPrimitive
|
|
85
|
-
* - The ClipMask of the final ClipPrimitive is stored in the returned array at index 0
|
|
86
|
-
* - The last valid zLow found is stored in the returned array at index 1
|
|
87
|
-
* - The last valid zHigh found is stored in the returned array at index 2
|
|
89
|
+
* - All of the loop points are stored in the multidimensional Point3d array given (will return unchanged upon failure).
|
|
90
|
+
* - If given a transform, will be set from the transformFromClip of the first ClipPrimitive.
|
|
91
|
+
* - The ClipMask of the final ClipPrimitive is stored in the returned array at index 0.
|
|
92
|
+
* - The last valid zLow found is stored in the returned array at index 1.
|
|
93
|
+
* - The last valid zHigh found is stored in the returned array at index 2.
|
|
88
94
|
*/
|
|
89
95
|
extractBoundaryLoops(loopPoints: Point3d[][], transform?: Transform): number[];
|
|
90
96
|
/** Sets this ClipVector and all of its members to the visibility specified. */
|
|
91
97
|
setInvisible(invisible: boolean): void;
|
|
92
|
-
/**
|
|
98
|
+
/**
|
|
99
|
+
* For every clip, parse the member point array into the member clip plane object (only for clipPlanes member,
|
|
100
|
+
* not the mask)
|
|
101
|
+
*/
|
|
93
102
|
parseClipPlanes(): void;
|
|
94
103
|
/**
|
|
95
104
|
* Multiply all ClipPlanes DPoint4d by matrix.
|
|
@@ -104,8 +113,9 @@ export declare class ClipVector implements Clipper {
|
|
|
104
113
|
*/
|
|
105
114
|
multiplyPlanesByMatrix4d(matrix: Matrix4d, invert?: boolean, transpose?: boolean): boolean;
|
|
106
115
|
/**
|
|
107
|
-
* Determines whether the given points fall inside or outside this set of ClipShapes. If any set is defined
|
|
108
|
-
* checks the mask planes only, provided that ignoreMasks is false. Otherwise, checks the
|
|
116
|
+
* Determines whether the given points fall inside or outside this set of ClipShapes. If any set is defined
|
|
117
|
+
* by masking planes, checks the mask planes only, provided that ignoreMasks is false. Otherwise, checks the
|
|
118
|
+
* _clipPlanes member.
|
|
109
119
|
*/
|
|
110
120
|
classifyPointContainment(points: Point3d[], ignoreMasks?: boolean): ClipPlaneContainment;
|
|
111
121
|
/**
|
|
@@ -114,7 +124,8 @@ export declare class ClipVector implements Clipper {
|
|
|
114
124
|
*/
|
|
115
125
|
classifyRangeContainment(range: Range3d, ignoreMasks: boolean): ClipPlaneContainment;
|
|
116
126
|
/**
|
|
117
|
-
* For an array of points (making up a LineString), tests whether the segment between each point lies inside the
|
|
127
|
+
* For an array of points (making up a LineString), tests whether the segment between each point lies inside the
|
|
128
|
+
* ClipVector.
|
|
118
129
|
* If true, returns true immediately.
|
|
119
130
|
*/
|
|
120
131
|
isAnyLineStringPointInside(points: Point3d[]): boolean;
|
|
@@ -126,7 +137,8 @@ export declare class ClipVector implements Clipper {
|
|
|
126
137
|
* and returns true if all segments lie inside this ClipVector.
|
|
127
138
|
*/
|
|
128
139
|
isLineStringCompletelyContained(points: Point3d[]): boolean;
|
|
129
|
-
/**
|
|
140
|
+
/**
|
|
141
|
+
* Serializes this ClipVector to a compact string representation appropriate for transmission as part of a URL.
|
|
130
142
|
* Chiefly used for requesting [Tile]($frontend)s with section cut facets.
|
|
131
143
|
* UnionOfConvexClipPlaneSets is obtained for each ClipPrimitive. The encoding is as follows:
|
|
132
144
|
* ClipVector:
|
|
@@ -149,7 +161,8 @@ export declare class ClipVector implements Clipper {
|
|
|
149
161
|
*/
|
|
150
162
|
toCompactString(): string;
|
|
151
163
|
}
|
|
152
|
-
/**
|
|
164
|
+
/**
|
|
165
|
+
* Bundles a [[ClipVector]] with its compact string representation.
|
|
153
166
|
* @note The string representation is computed once; the ClipVector is assumed not to be subsequently modified.
|
|
154
167
|
* @see [[StringifiedClipVector.fromClipVector]] to create from a ClipVector.
|
|
155
168
|
* @see [[ClipVector.toCompactString]] for a description of the string representation.
|
|
@@ -158,7 +171,8 @@ export declare class ClipVector implements Clipper {
|
|
|
158
171
|
export type StringifiedClipVector = ClipVector & {
|
|
159
172
|
readonly clipString: string;
|
|
160
173
|
};
|
|
161
|
-
/**
|
|
174
|
+
/**
|
|
175
|
+
* Bundles a ClipVector with its compact string representation.
|
|
162
176
|
* @note The string representation is computed once; the ClipVector is assumed not to be subsequently modified.
|
|
163
177
|
* @alpha
|
|
164
178
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ClipVector.d.ts","sourceRoot":"","sources":["../../../src/clipping/ClipVector.ts"],"names":[],"mappings":"AAYA,OAAO,EAAE,OAAO,EAAY,MAAM,+BAA+B,CAAC;AAClE,OAAO,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AAC9C,OAAO,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC;AACpD,OAAO,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC;AACpD,OAAO,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAC;AAElD,OAAO,EAAE,oBAAoB,EAAE,kCAAkC,
|
|
1
|
+
{"version":3,"file":"ClipVector.d.ts","sourceRoot":"","sources":["../../../src/clipping/ClipVector.ts"],"names":[],"mappings":"AAYA,OAAO,EAAE,OAAO,EAAY,MAAM,+BAA+B,CAAC;AAClE,OAAO,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AAC9C,OAAO,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC;AACpD,OAAO,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC;AACpD,OAAO,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAC;AAElD,OAAO,EAAE,oBAAoB,EAAE,kCAAkC,EAAE,MAAM,yBAAyB,CAAC;AACnG,OAAO,EAA0B,aAAa,EAAE,kBAAkB,EAAa,MAAM,iBAAiB,CAAC;AACvG,OAAO,EAAE,OAAO,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAC;AAG5D,OAAO,EAAE,KAAK,EAAE,MAAM,gBAAgB,CAAC;AACvC,OAAO,EAAE,gBAAgB,EAAE,MAAM,gCAAgC,CAAC;AAClE,OAAO,EAAE,qBAAqB,EAAE,MAAM,mCAAmC,CAAC;AAE1E;;;GAGG;AACH,MAAM,MAAM,eAAe,GAAG,kBAAkB,EAAE,CAAC;AAEnD;;;;;;GAMG;AACH,qBAAa,UAAW,YAAW,OAAO;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MAAM,CAAC,QAAQ,CAAC,oBAAoB,CAAc;IAC1D;;;OAGG;IACI,+BAA+B,CAAC,MAAM,EAAE,OAAO,EAAE,GAAG,OAAO;IAyBlE;;;;;;;;;;;;;;;;;;;;;OAqBG;IACI,eAAe,IAAI,MAAM;CAyCjC;AAED;;;;;;GAMG;AACH,MAAM,MAAM,qBAAqB,GAAG,UAAU,GAAG;IAAE,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAA;CAAE,CAAC;AAEjF;;;;GAIG;AACH,yBAAiB,qBAAqB,CAAC;IACrC;;;;OAIG;IACH,SAAgB,cAAc,CAAC,IAAI,CAAC,EAAE,UAAU,GAAG,qBAAqB,GAAG,SAAS,CAWnF;CACF"}
|
|
@@ -16,18 +16,22 @@ const Transform_1 = require("../geometry3d/Transform");
|
|
|
16
16
|
const ClipPrimitive_1 = require("./ClipPrimitive");
|
|
17
17
|
const ClipUtils_1 = require("./ClipUtils");
|
|
18
18
|
const BooleanClipNode_1 = require("./BooleanClipNode");
|
|
19
|
-
/**
|
|
19
|
+
/**
|
|
20
|
+
* Class holding an array structure of shapes defined by `ClipPrimitive`
|
|
20
21
|
* * The `ClipVector` defines an intersection of the member `ClipPrimitive` regions.
|
|
21
|
-
* * In the most common usage, one of the `ClipPrimitive` will be an outer region, and all others are holes with marker
|
|
22
|
+
* * In the most common usage, one of the `ClipPrimitive` will be an outer region, and all others are holes with marker
|
|
23
|
+
* flag indicating that the outside of each hole is live.
|
|
22
24
|
* @public
|
|
23
25
|
*/
|
|
24
26
|
class ClipVector {
|
|
25
27
|
/** Returns a reference to the array of ClipShapes. */
|
|
26
28
|
get clips() { return this._clips; }
|
|
27
29
|
constructor(clips) {
|
|
28
|
-
/**
|
|
30
|
+
/**
|
|
31
|
+
* Range acting as first filter.
|
|
29
32
|
* * This is understood as overall range limit, not as precise planes.
|
|
30
|
-
* *
|
|
33
|
+
* * Applying any rotation to the whole ClipVector generally expands this range, rather than exactly transforming
|
|
34
|
+
* its planes.
|
|
31
35
|
*/
|
|
32
36
|
this.boundingRange = Range_1.Range3d.createNull();
|
|
33
37
|
this._clips = clips ? clips : [];
|
|
@@ -115,7 +119,8 @@ class ClipVector {
|
|
|
115
119
|
pointInside(point, onTolerance = Geometry_1.Geometry.smallMetricDistanceSquared) {
|
|
116
120
|
return this.isPointOnOrInside(point, onTolerance);
|
|
117
121
|
}
|
|
118
|
-
/**
|
|
122
|
+
/**
|
|
123
|
+
* Method from [[Clipper]] interface.
|
|
119
124
|
* * Implement as dispatch to clipPlaneSets as supplied by derived class.
|
|
120
125
|
*/
|
|
121
126
|
isPointOnOrInside(point, onTolerance = Geometry_1.Geometry.smallMetricDistanceSquared) {
|
|
@@ -141,7 +146,8 @@ class ClipVector {
|
|
|
141
146
|
}
|
|
142
147
|
return numChildren > 0;
|
|
143
148
|
}
|
|
144
|
-
/**
|
|
149
|
+
/**
|
|
150
|
+
* Method from [[Clipper]] interface.
|
|
145
151
|
* * Implement as dispatch to clipPlaneSets as supplied by derived class.
|
|
146
152
|
*/
|
|
147
153
|
announceClippedSegmentIntervals(f0, f1, pointA, pointB, announce) {
|
|
@@ -165,10 +171,11 @@ class ClipVector {
|
|
|
165
171
|
if (this._clipNodeProxy)
|
|
166
172
|
this._clipNodeProxy.appendPolygonClip(xyz, insideFragments, outsideFragments, arrayCache);
|
|
167
173
|
}
|
|
168
|
-
/**
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
174
|
+
/**
|
|
175
|
+
* Transforms this ClipVector to a new coordinate-system.
|
|
176
|
+
* Note that if the transform has rotate and scale the boundingRange member expands.
|
|
177
|
+
* Returns true if successful.
|
|
178
|
+
*/
|
|
172
179
|
transformInPlace(transform) {
|
|
173
180
|
for (const clip of this._clips)
|
|
174
181
|
if (clip.transformInPlace(transform) === false)
|
|
@@ -180,15 +187,13 @@ class ClipVector {
|
|
|
180
187
|
/**
|
|
181
188
|
* A simple way of packaging this ClipVector's ClipShape points into a multidimensional array, while also
|
|
182
189
|
* taking into account each ClipPrimitive's individual transforms.
|
|
183
|
-
*
|
|
184
190
|
* ClipPrimitives OTHER THAN ClipShape are ignored.
|
|
185
|
-
*
|
|
186
191
|
* Information out:
|
|
187
|
-
* - All of the loop points are stored in the multidimensional Point3d array given (will return unchanged upon failure)
|
|
188
|
-
* - If given a transform, will be set from the transformFromClip of the first ClipPrimitive
|
|
189
|
-
* - The ClipMask of the final ClipPrimitive is stored in the returned array at index 0
|
|
190
|
-
* - The last valid zLow found is stored in the returned array at index 1
|
|
191
|
-
* - The last valid zHigh found is stored in the returned array at index 2
|
|
192
|
+
* - All of the loop points are stored in the multidimensional Point3d array given (will return unchanged upon failure).
|
|
193
|
+
* - If given a transform, will be set from the transformFromClip of the first ClipPrimitive.
|
|
194
|
+
* - The ClipMask of the final ClipPrimitive is stored in the returned array at index 0.
|
|
195
|
+
* - The last valid zLow found is stored in the returned array at index 1.
|
|
196
|
+
* - The last valid zHigh found is stored in the returned array at index 2.
|
|
192
197
|
*/
|
|
193
198
|
extractBoundaryLoops(loopPoints, transform) {
|
|
194
199
|
let clipM = ClipPrimitive_1.ClipMaskXYZRangePlanes.None;
|
|
@@ -243,7 +248,10 @@ class ClipVector {
|
|
|
243
248
|
for (const clip of this._clips)
|
|
244
249
|
clip.setInvisible(invisible);
|
|
245
250
|
}
|
|
246
|
-
/**
|
|
251
|
+
/**
|
|
252
|
+
* For every clip, parse the member point array into the member clip plane object (only for clipPlanes member,
|
|
253
|
+
* not the mask)
|
|
254
|
+
*/
|
|
247
255
|
parseClipPlanes() {
|
|
248
256
|
for (const clip of this._clips)
|
|
249
257
|
clip.fetchClipPlanesRef();
|
|
@@ -272,8 +280,9 @@ class ClipVector {
|
|
|
272
280
|
return true;
|
|
273
281
|
}
|
|
274
282
|
/**
|
|
275
|
-
* Determines whether the given points fall inside or outside this set of ClipShapes. If any set is defined
|
|
276
|
-
* checks the mask planes only, provided that ignoreMasks is false. Otherwise, checks the
|
|
283
|
+
* Determines whether the given points fall inside or outside this set of ClipShapes. If any set is defined
|
|
284
|
+
* by masking planes, checks the mask planes only, provided that ignoreMasks is false. Otherwise, checks the
|
|
285
|
+
* _clipPlanes member.
|
|
277
286
|
*/
|
|
278
287
|
classifyPointContainment(points, ignoreMasks = false) {
|
|
279
288
|
let currentContainment = ClipUtils_1.ClipPlaneContainment.Ambiguous;
|
|
@@ -297,7 +306,8 @@ class ClipVector {
|
|
|
297
306
|
return this.classifyPointContainment(corners, ignoreMasks);
|
|
298
307
|
}
|
|
299
308
|
/**
|
|
300
|
-
* For an array of points (making up a LineString), tests whether the segment between each point lies inside the
|
|
309
|
+
* For an array of points (making up a LineString), tests whether the segment between each point lies inside the
|
|
310
|
+
* ClipVector.
|
|
301
311
|
* If true, returns true immediately.
|
|
302
312
|
*/
|
|
303
313
|
isAnyLineStringPointInside(points) {
|
|
@@ -347,7 +357,8 @@ class ClipVector {
|
|
|
347
357
|
}
|
|
348
358
|
return true;
|
|
349
359
|
}
|
|
350
|
-
/**
|
|
360
|
+
/**
|
|
361
|
+
* Serializes this ClipVector to a compact string representation appropriate for transmission as part of a URL.
|
|
351
362
|
* Chiefly used for requesting [Tile]($frontend)s with section cut facets.
|
|
352
363
|
* UnionOfConvexClipPlaneSets is obtained for each ClipPrimitive. The encoding is as follows:
|
|
353
364
|
* ClipVector:
|
|
@@ -410,7 +421,8 @@ class ClipVector {
|
|
|
410
421
|
}
|
|
411
422
|
ClipVector._TARGET_FRACTION_SUM = 0.99999999;
|
|
412
423
|
exports.ClipVector = ClipVector;
|
|
413
|
-
/**
|
|
424
|
+
/**
|
|
425
|
+
* Bundles a ClipVector with its compact string representation.
|
|
414
426
|
* @note The string representation is computed once; the ClipVector is assumed not to be subsequently modified.
|
|
415
427
|
* @alpha
|
|
416
428
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ClipVector.js","sourceRoot":"","sources":["../../../src/clipping/ClipVector.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;;;AAE/F;;GAEG;AAE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,GAAG,GAAG,GAAG,cAAc,CAAC,CAAC,CAAC,EAAE,CAAC;aACtC;YAED,OAAO,GAAG,GAAG,GAAG,CAAC;QACnB,CAAC;QAED,IAAI,MAAM,GAAG,EAAE,CAAC;QAChB,KAAK,MAAM,SAAS,IAAI,IAAI,CAAC,KAAK;YAChC,MAAM,GAAG,GAAG,MAAM,GAAG,eAAe,CAAC,SAAS,CAAC,EAAE,CAAC;QAEpD,OAAO,GAAG,MAAM,GAAG,CAAC;IACtB,CAAC;;AApGuB,+BAAoB,GAAG,UAAU,AAAb,CAAc;AA5V/C,gCAAU;AA2cvB;;;GAGG;AACH,IAAiB,qBAAqB,CAkBrC;AAlBD,WAAiB,qBAAqB;IACpC;;;;OAIG;IACH,SAAgB,cAAc,CAAC,IAAiB;QAC9C,IAAI,CAAC,IAAI,IAAI,CAAC,IAAI,CAAC,OAAO;YACxB,OAAO,SAAS,CAAC;QAEnB,MAAM,GAAG,GAAG,IAAW,CAAC;QACxB,IAAI,SAAS,KAAK,GAAG,CAAC,UAAU;YAC9B,GAAG,CAAC,UAAU,GAAG,IAAI,CAAC,eAAe,EAAE,CAAC;QAE1C,MAAM,WAAW,GAAG,GAA4B,CAAC;QACjD,IAAA,qBAAM,EAAC,SAAS,KAAK,WAAW,CAAC,UAAU,CAAC,CAAC;QAC7C,OAAO,WAAW,CAAC;IACrB,CAAC;IAXe,oCAAc,iBAW7B,CAAA;AACH,CAAC,EAlBgB,qBAAqB,GAArB,6BAAqB,KAArB,6BAAqB,QAkBrC","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n\r\n/** @packageDocumentation\r\n * @module CartesianGeometry\r\n */\r\n\r\nimport { assert } from \"@itwin/core-bentley\";\r\nimport { LineSegment3d } from \"../curve/LineSegment3d\";\r\nimport { Geometry } from \"../Geometry\";\r\nimport { Point3d, Vector3d } from \"../geometry3d/Point3dVector3d\";\r\nimport { Range3d } from \"../geometry3d/Range\";\r\nimport { Segment1d } from \"../geometry3d/Segment1d\";\r\nimport { Transform } from \"../geometry3d/Transform\";\r\nimport { Matrix4d } from \"../geometry4d/Matrix4d\";\r\nimport { ClipPlane } from \"./ClipPlane\";\r\nimport { AnnounceNumberNumber, AnnounceNumberNumberCurvePrimitive} from \"../curve/CurvePrimitive\";\r\nimport { ClipMaskXYZRangePlanes, ClipPrimitive, ClipPrimitiveProps, ClipShape } from \"./ClipPrimitive\";\r\nimport { Clipper, ClipPlaneContainment } from \"./ClipUtils\";\r\nimport { ConvexClipPlaneSet } from \"./ConvexClipPlaneSet\";\r\nimport { BooleanClipNodeIntersection } from \"./BooleanClipNode\";\r\nimport { Arc3d } from \"../curve/Arc3d\";\r\nimport { GrowableXYZArray } from \"../geometry3d/GrowableXYZArray\";\r\nimport { GrowableXYZArrayCache } from \"../geometry3d/ReusableObjectCache\";\r\n\r\n/** Wire format describing a [[ClipVector]].\r\n * @public\r\n */\r\nexport type ClipVectorProps = ClipPrimitiveProps[];\r\n\r\n/** Class holding an array structure of shapes defined by `ClipPrimitive`\r\n * * The `ClipVector` defines an intersection of the member `ClipPrimitive` regions.\r\n * * In the most common usage, one of the `ClipPrimitive` will be an outer region, and all others are holes with marker flag indicating that the outside of each hole is live.\r\n * @public\r\n */\r\nexport class ClipVector implements Clipper {\r\n private _clips: ClipPrimitive[];\r\n /** range acting as first filter.\r\n * * This is understood as overall range limit, not as precise planes.\r\n * * applying any rotation to the whole ClipVector generally expands this range, rather than exactly transforming its planes.\r\n */\r\n public boundingRange: Range3d = Range3d.createNull();\r\n\r\n /** Returns a reference to the array of ClipShapes. */\r\n public get clips() { return this._clips; }\r\n\r\n private constructor(clips?: ClipPrimitive[]) {\r\n this._clips = clips ? clips : [];\r\n }\r\n\r\n /** Returns true if this ClipVector contains a ClipPrimitive. */\r\n public get isValid(): boolean { return this._clips.length > 0; }\r\n\r\n /** Create a ClipVector with an empty set of ClipShapes. */\r\n public static createEmpty(result?: ClipVector): ClipVector {\r\n if (result) {\r\n result._clips.length = 0;\r\n return result;\r\n }\r\n return new ClipVector();\r\n }\r\n\r\n /** Create a ClipVector from an array of ClipPrimitives (or derived classes) (capture the pointers) */\r\n public static createCapture(clips: ClipPrimitive[], result?: ClipVector): ClipVector {\r\n if (result) {\r\n result._clips = clips;\r\n return result;\r\n }\r\n return new ClipVector(clips);\r\n }\r\n\r\n /** Create a ClipVector from (clones of) an array of ClipPrimitives */\r\n public static create(clips: ClipPrimitive[], result?: ClipVector): ClipVector {\r\n const clipClones: ClipPrimitive[] = [];\r\n for (const clip of clips)\r\n clipClones.push(clip.clone());\r\n return ClipVector.createCapture(clipClones, result);\r\n }\r\n\r\n /** Create a deep copy of another ClipVector */\r\n public clone(result?: ClipVector): ClipVector {\r\n const retVal = result ? result : new ClipVector();\r\n retVal._clips.length = 0;\r\n for (const clip of this._clips) {\r\n retVal._clips.push(clip.clone());\r\n }\r\n retVal.boundingRange.setFrom(this.boundingRange);\r\n return retVal;\r\n }\r\n\r\n /** Parse this ClipVector into a JSON object. */\r\n public toJSON(): ClipVectorProps {\r\n if (!this.isValid)\r\n return [];\r\n\r\n return this.clips.map((clip) => clip.toJSON());\r\n }\r\n\r\n /** Parse a JSON object into a new ClipVector. */\r\n public static fromJSON(json: ClipVectorProps | undefined, result?: ClipVector): ClipVector {\r\n result = result ? result : new ClipVector();\r\n result.clear();\r\n if (!Array.isArray(json))\r\n return result;\r\n\r\n try {\r\n for (const clip of json) {\r\n const clipPrim = ClipPrimitive.fromJSON(clip);\r\n if (clipPrim)\r\n result._clips.push(clipPrim);\r\n }\r\n } catch (e) {\r\n result.clear();\r\n }\r\n\r\n return result;\r\n }\r\n\r\n /** Empties out the array of ClipShapes. */\r\n public clear() {\r\n this._clips.length = 0;\r\n }\r\n\r\n /** Append a deep copy of the given ClipPrimitive to this ClipVector. */\r\n public appendClone(clip: ClipPrimitive) {\r\n this._clips.push(clip.clone());\r\n }\r\n\r\n /** Append a reference of the given ClipPrimitive to this ClipVector. */\r\n public appendReference(clip: ClipPrimitive) {\r\n this._clips.push(clip);\r\n }\r\n\r\n /** Create and append a new ClipPrimitive to the array given a shape as an array of points. Returns true if successful. */\r\n public appendShape(shape: Point3d[], zLow?: number, zHigh?: number,\r\n transform?: Transform, isMask: boolean = false, invisible: boolean = false): boolean {\r\n const clip = ClipShape.createShape(shape, zLow, zHigh, transform, isMask, invisible);\r\n if (!clip)\r\n return false;\r\n this._clips.push(clip);\r\n return true;\r\n }\r\n\r\n /** Returns true if the given point lies inside all of this ClipVector's ClipShapes (by rule of intersection).*/\r\n public pointInside(point: Point3d, onTolerance: number = Geometry.smallMetricDistanceSquared): boolean {\r\n return this.isPointOnOrInside(point, onTolerance);\r\n }\r\n\r\n /** Method from [[Clipper]] interface.\r\n * * Implement as dispatch to clipPlaneSets as supplied by derived class.\r\n */\r\n public isPointOnOrInside(point: Point3d, onTolerance: number = Geometry.smallMetricDistanceSquared): boolean {\r\n if (!this.boundingRange.isNull && !this.boundingRange.containsPoint(point))\r\n return false;\r\n\r\n for (const clip of this._clips) {\r\n if (!clip.pointInside(point, onTolerance))\r\n return false;\r\n }\r\n return true;\r\n }\r\n // Proxy object to implement line and arc clip.\r\n private _clipNodeProxy?: BooleanClipNodeIntersection;\r\n private ensureProxyClipNode(): boolean{\r\n if (this._clipNodeProxy)\r\n return true;\r\n this._clipNodeProxy = new BooleanClipNodeIntersection(true);\r\n let numChildren = 0;\r\n for (const child of this._clips) {\r\n const q = child.fetchClipPlanesRef();\r\n if (q) {\r\n numChildren++;\r\n this._clipNodeProxy.captureChild(q);\r\n }\r\n }\r\n return numChildren > 0;\r\n }\r\n /** Method from [[Clipper]] interface.\r\n * * Implement as dispatch to clipPlaneSets as supplied by derived class.\r\n */\r\n public announceClippedSegmentIntervals(f0: number, f1: number, pointA: Point3d, pointB: Point3d, announce?: AnnounceNumberNumber): boolean {\r\n this.ensureProxyClipNode();\r\n if (this._clipNodeProxy)\r\n return this._clipNodeProxy.announceClippedSegmentIntervals(f0, f1, pointA, pointB, announce);\r\n return false;\r\n }\r\n /** Method from [[Clipper]] interface.\r\n * * Implement as dispatch to clipPlaneSets as supplied by derived class.\r\n */\r\n public announceClippedArcIntervals(arc: Arc3d, announce?: AnnounceNumberNumberCurvePrimitive): boolean {\r\n this.ensureProxyClipNode();\r\n if (this._clipNodeProxy)\r\n return this._clipNodeProxy.announceClippedArcIntervals(arc, announce);\r\n return false;\r\n }\r\n/** Execute polygon clip as intersection of the child primitives. */\r\n public appendPolygonClip(\r\n xyz: GrowableXYZArray,\r\n insideFragments: GrowableXYZArray[],\r\n outsideFragments: GrowableXYZArray[],\r\n arrayCache: GrowableXYZArrayCache) {\r\n this.ensureProxyClipNode();\r\n if (this._clipNodeProxy)\r\n this._clipNodeProxy.appendPolygonClip(xyz, insideFragments, outsideFragments, arrayCache);\r\n }\r\n /** Transforms this ClipVector to a new coordinate-system.\r\n * Note that if the transform has rotate and scale the boundingRange member expands.\r\n * Returns true if successful.\r\n */\r\n public transformInPlace(transform: Transform): boolean {\r\n for (const clip of this._clips)\r\n if (clip.transformInPlace(transform) === false)\r\n return false;\r\n\r\n if (!this.boundingRange.isNull)\r\n transform.multiplyRange(this.boundingRange, this.boundingRange);\r\n\r\n return true;\r\n }\r\n\r\n /**\r\n * A simple way of packaging this ClipVector's ClipShape points into a multidimensional array, while also\r\n * taking into account each ClipPrimitive's individual transforms.\r\n *\r\n * ClipPrimitives OTHER THAN ClipShape are ignored.\r\n *\r\n * Information out:\r\n * - All of the loop points are stored in the multidimensional Point3d array given (will return unchanged upon failure)\r\n * - If given a transform, will be set from the transformFromClip of the first ClipPrimitive\r\n * - The ClipMask of the final ClipPrimitive is stored in the returned array at index 0\r\n * - The last valid zLow found is stored in the returned array at index 1\r\n * - The last valid zHigh found is stored in the returned array at index 2\r\n */\r\n public extractBoundaryLoops(loopPoints: Point3d[][], transform?: Transform): number[] {\r\n let clipM = ClipMaskXYZRangePlanes.None;\r\n let zBack = -Number.MAX_VALUE;\r\n let zFront = Number.MAX_VALUE;\r\n const retVal: number[] = [];\r\n let nLoops = 0;\r\n\r\n if (this._clips.length === 0)\r\n return retVal;\r\n let firstClipShape: ClipShape | undefined;\r\n const deltaTrans = Transform.createIdentity();\r\n\r\n for (const clip of this._clips) {\r\n if (clip instanceof ClipShape) {\r\n if (firstClipShape !== undefined && clip !== firstClipShape) { // Is not the first iteration\r\n let fwdTrans = Transform.createIdentity();\r\n let invTrans = Transform.createIdentity();\r\n\r\n if (firstClipShape.transformValid && clip.transformValid) {\r\n fwdTrans = clip.transformFromClip!.clone();\r\n invTrans = firstClipShape.transformToClip!.clone();\r\n }\r\n deltaTrans.setFrom(invTrans.multiplyTransformTransform(fwdTrans));\r\n }\r\n if (!firstClipShape)\r\n firstClipShape = clip;\r\n loopPoints[nLoops] = [];\r\n\r\n if (clip.polygon !== undefined) {\r\n clipM = ClipMaskXYZRangePlanes.XAndY;\r\n\r\n if (clip.zHighValid) {\r\n clipM = clipM | ClipMaskXYZRangePlanes.ZHigh;\r\n zFront = clip.zHigh!;\r\n }\r\n if (clip.zLowValid) {\r\n clipM = clipM | ClipMaskXYZRangePlanes.ZLow;\r\n zBack = clip.zLow!;\r\n }\r\n\r\n for (const point of clip.polygon)\r\n loopPoints[nLoops].push(point.clone());\r\n deltaTrans.multiplyPoint3dArray(loopPoints[nLoops], loopPoints[nLoops]);\r\n nLoops++;\r\n }\r\n }\r\n }\r\n\r\n retVal.push(clipM);\r\n retVal.push(zBack);\r\n retVal.push(zFront);\r\n\r\n if (transform && firstClipShape)\r\n transform.setFrom(firstClipShape.transformFromClip!);\r\n\r\n return retVal;\r\n }\r\n\r\n /** Sets this ClipVector and all of its members to the visibility specified. */\r\n public setInvisible(invisible: boolean) {\r\n for (const clip of this._clips)\r\n clip.setInvisible(invisible);\r\n }\r\n\r\n /** For every clip, parse the member point array into the member clip plane object (only for clipPlanes member, not the mask) */\r\n public parseClipPlanes() {\r\n for (const clip of this._clips)\r\n clip.fetchClipPlanesRef();\r\n }\r\n\r\n /**\r\n * Multiply all ClipPlanes DPoint4d by matrix.\r\n * @param matrix matrix to apply.\r\n * @param invert if true, use in verse of the matrix.\r\n * @param transpose if true, use the transpose of the matrix (or inverse, per invert parameter)\r\n * * Note that if matrixA is applied to all of space, the matrix to send to this method to get a corresponding effect on the plane is the inverse transpose of matrixA\r\n * * Callers that will apply the same matrix to many planes should pre-invert the matrix for efficiency.\r\n * * Both params default to true to get the full effect of transforming space.\r\n * @param matrix matrix to apply\r\n * @returns false if matrix inversion fails.\r\n */\r\n public multiplyPlanesByMatrix4d(matrix: Matrix4d, invert: boolean = true, transpose: boolean = true): boolean {\r\n if (invert) { // form inverse once here, reuse for all planes\r\n const inverse = matrix.createInverse();\r\n if (!inverse)\r\n return false;\r\n return this.multiplyPlanesByMatrix4d(inverse, false, transpose);\r\n }\r\n // no inverse necessary -- lower level cannot fail.\r\n for (const clip of this._clips)\r\n clip.multiplyPlanesByMatrix4d(matrix, false, transpose);\r\n return true;\r\n }\r\n\r\n /**\r\n * Determines whether the given points fall inside or outside this set of ClipShapes. If any set is defined by masking planes,\r\n * checks the mask planes only, provided that ignoreMasks is false. Otherwise, checks the _clipPlanes member.\r\n */\r\n public classifyPointContainment(points: Point3d[], ignoreMasks: boolean = false): ClipPlaneContainment {\r\n let currentContainment = ClipPlaneContainment.Ambiguous;\r\n\r\n for (const primitive of this._clips) {\r\n const thisContainment = primitive.classifyPointContainment(points, ignoreMasks);\r\n\r\n if (ClipPlaneContainment.Ambiguous === thisContainment)\r\n return ClipPlaneContainment.Ambiguous;\r\n\r\n if (ClipPlaneContainment.Ambiguous === currentContainment)\r\n currentContainment = thisContainment;\r\n else if (currentContainment !== thisContainment)\r\n return ClipPlaneContainment.Ambiguous;\r\n }\r\n return currentContainment;\r\n }\r\n\r\n /**\r\n * Determines whether a 3D range lies inside or outside this set of ClipShapes. If any set is defined by masking planes,\r\n * checks the mask planes only, provided that ignoreMasks is false. Otherwise, checks the clip planes member.\r\n */\r\n public classifyRangeContainment(range: Range3d, ignoreMasks: boolean): ClipPlaneContainment {\r\n const corners: Point3d[] = range.corners();\r\n return this.classifyPointContainment(corners, ignoreMasks);\r\n }\r\n\r\n /**\r\n * For an array of points (making up a LineString), tests whether the segment between each point lies inside the ClipVector.\r\n * If true, returns true immediately.\r\n */\r\n public isAnyLineStringPointInside(points: Point3d[]): boolean {\r\n for (const clip of this._clips) {\r\n const clipPlaneSet = clip.fetchClipPlanesRef();\r\n if (clipPlaneSet !== undefined) {\r\n for (let i = 0; i + 1 < points.length; i++) {\r\n const segment = LineSegment3d.create(points[i], points[i + 1]);\r\n if (clipPlaneSet.isAnyPointInOrOnFromSegment(segment))\r\n return true;\r\n }\r\n }\r\n }\r\n return false;\r\n }\r\n\r\n /** Note: Line segments are used to represent 1 dimensional intervals here, rather than segments. */\r\n public sumSizes(intervals: Segment1d[], begin: number, end: number): number {\r\n let s = 0.0;\r\n for (let i = begin; i < end; i++)\r\n s += (intervals[i].x1 - intervals[i].x0);\r\n return s;\r\n }\r\n\r\n private static readonly _TARGET_FRACTION_SUM = 0.99999999;\r\n /**\r\n * For an array of points that make up a LineString, develops a line segment between each point pair,\r\n * and returns true if all segments lie inside this ClipVector.\r\n */\r\n public isLineStringCompletelyContained(points: Point3d[]): boolean {\r\n const clipIntervals: Segment1d[] = [];\r\n\r\n for (let i = 0; i + 1 < points.length; i++) {\r\n const segment = LineSegment3d.create(points[i], points[i + 1]);\r\n let fractionSum = 0.0;\r\n let index0 = 0;\r\n\r\n for (const clip of this._clips) {\r\n const clipPlaneSet = clip.fetchClipPlanesRef();\r\n if (clipPlaneSet !== undefined) {\r\n clipPlaneSet.appendIntervalsFromSegment(segment, clipIntervals);\r\n const index1 = clipIntervals.length;\r\n fractionSum += this.sumSizes(clipIntervals, index0, index1);\r\n index0 = index1;\r\n // ASSUME primitives are non-overlapping...\r\n if (fractionSum >= ClipVector._TARGET_FRACTION_SUM)\r\n break;\r\n }\r\n }\r\n if (fractionSum < ClipVector._TARGET_FRACTION_SUM)\r\n return false;\r\n }\r\n return true;\r\n }\r\n\r\n /** Serializes this ClipVector to a compact string representation appropriate for transmission as part of a URL.\r\n * Chiefly used for requesting [Tile]($frontend)s with section cut facets.\r\n * UnionOfConvexClipPlaneSets is obtained for each ClipPrimitive. The encoding is as follows:\r\n * ClipVector:\r\n * ClipPrimitive[]\r\n * _\r\n * ClipPrimitive:\r\n * invisible: 0|1\r\n * ConvexClipPlaneSet[]\r\n * _\r\n * ConvexClipPlaneSet:\r\n * ClipPlane[]\r\n * _\r\n * ClipPlane:\r\n * flags: 0|1|2|3, where 1=invisible and 2=interior\r\n * inwardNormal: Number[3]\r\n * distance: Number\r\n * Number:\r\n * number\r\n * _\r\n */\r\n public toCompactString(): string {\r\n function formatNumber(num: number) {\r\n return `${num.toString()}_`;\r\n }\r\n\r\n function formatVector3d(vec: Vector3d) {\r\n return `${formatNumber(vec.x)}${formatNumber(vec.y)}${formatNumber(vec.z)}`;\r\n }\r\n\r\n function formatFlags(flags: number) {\r\n const f = flags.toString();\r\n assert(1 === f.length);\r\n return f;\r\n }\r\n\r\n function formatPlane(plane: ClipPlane) {\r\n let flags = plane.invisible ? 1 : 0;\r\n flags |= (plane.interior ? 2 : 0);\r\n return `${formatFlags(flags)}${formatVector3d(plane.inwardNormalRef)}${formatNumber(plane.distance)}`;\r\n }\r\n\r\n function formatPlaneSet(set: ConvexClipPlaneSet) {\r\n let planes = \"\";\r\n for (const plane of set.planes)\r\n planes = `${planes}${formatPlane(plane)}`;\r\n\r\n return `${planes}_`;\r\n }\r\n\r\n function formatPrimitive(prim: ClipPrimitive) {\r\n const flags = prim.invisible ? 1 : 0;\r\n let str = flags.toString();\r\n assert(1 === str.length);\r\n\r\n const union = prim.fetchClipPlanesRef();\r\n if (union) {\r\n for (const s of union.convexSets)\r\n str = `${str}${formatPlaneSet(s)}`;\r\n }\r\n\r\n return `${str}_`;\r\n }\r\n\r\n let result = \"\";\r\n for (const primitive of this.clips)\r\n result = `${result}${formatPrimitive(primitive)}`;\r\n\r\n return `${result}_`;\r\n }\r\n}\r\n\r\n/** Bundles a [[ClipVector]] with its compact string representation.\r\n * @note The string representation is computed once; the ClipVector is assumed not to be subsequently modified.\r\n * @see [[StringifiedClipVector.fromClipVector]] to create from a ClipVector.\r\n * @see [[ClipVector.toCompactString]] for a description of the string representation.\r\n * @alpha\r\n */\r\nexport type StringifiedClipVector = ClipVector & { readonly clipString: string };\r\n\r\n/** Bundles a ClipVector with its compact string representation.\r\n * @note The string representation is computed once; the ClipVector is assumed not to be subsequently modified.\r\n * @alpha\r\n */\r\nexport namespace StringifiedClipVector { // eslint-disable-line @typescript-eslint/no-redeclare\r\n /** Create from a ClipVector.\r\n * @param clip The ClipVector to stringify.\r\n * @returns The input ClipVector with its compact string representation, or undefined if the input is undefined or empty.\r\n * @note The string representation is computed once; the ClipVector is assumed not to be subsequently modified.\r\n */\r\n export function fromClipVector(clip?: ClipVector): StringifiedClipVector | undefined {\r\n if (!clip || !clip.isValid)\r\n return undefined;\r\n\r\n const ret = clip as any;\r\n if (undefined === ret.clipString)\r\n ret.clipString = clip.toCompactString();\r\n\r\n const stringified = ret as StringifiedClipVector;\r\n assert(undefined !== stringified.clipString);\r\n return stringified;\r\n }\r\n}\r\n"]}
|
|
1
|
+
{"version":3,"file":"ClipVector.js","sourceRoot":"","sources":["../../../src/clipping/ClipVector.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;;;AAE/F;;GAEG;AAEH,sDAA6C;AAC7C,0DAAuD;AACvD,0CAAuC;AAEvC,+CAA8C;AAE9C,uDAAoD;AAIpD,mDAAuG;AACvG,2CAA4D;AAE5D,uDAAgE;AAWhE;;;;;;GAMG;AACH,MAAa,UAAU;IASrB,sDAAsD;IACtD,IAAW,KAAK,KAAK,OAAO,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC;IAC1C,YAAoB,KAAuB;QAT3C;;;;;W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AAO,GAAG,MAAM,GAAG,CAAC;IACtB,CAAC;;AA5FuB,+BAAoB,GAAG,UAAU,AAAb,CAAc;AAzU/C,gCAAU;AAibvB;;;;GAIG;AACH,IAAiB,qBAAqB,CAkBrC;AAlBD,WAAiB,qBAAqB;IACpC;;;;OAIG;IACH,SAAgB,cAAc,CAAC,IAAiB;QAC9C,IAAI,CAAC,IAAI,IAAI,CAAC,IAAI,CAAC,OAAO;YACxB,OAAO,SAAS,CAAC;QAEnB,MAAM,GAAG,GAAG,IAAW,CAAC;QACxB,IAAI,SAAS,KAAK,GAAG,CAAC,UAAU;YAC9B,GAAG,CAAC,UAAU,GAAG,IAAI,CAAC,eAAe,EAAE,CAAC;QAE1C,MAAM,WAAW,GAAG,GAA4B,CAAC;QACjD,IAAA,qBAAM,EAAC,SAAS,KAAK,WAAW,CAAC,UAAU,CAAC,CAAC;QAC7C,OAAO,WAAW,CAAC;IACrB,CAAC;IAXe,oCAAc,iBAW7B,CAAA;AACH,CAAC,EAlBgB,qBAAqB,GAArB,6BAAqB,KAArB,6BAAqB,QAkBrC","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n\r\n/** @packageDocumentation\r\n * @module CartesianGeometry\r\n */\r\n\r\nimport { assert } from \"@itwin/core-bentley\";\r\nimport { LineSegment3d } from \"../curve/LineSegment3d\";\r\nimport { Geometry } from \"../Geometry\";\r\nimport { Point3d, Vector3d } from \"../geometry3d/Point3dVector3d\";\r\nimport { Range3d } from \"../geometry3d/Range\";\r\nimport { Segment1d } from \"../geometry3d/Segment1d\";\r\nimport { Transform } from \"../geometry3d/Transform\";\r\nimport { Matrix4d } from \"../geometry4d/Matrix4d\";\r\nimport { ClipPlane } from \"./ClipPlane\";\r\nimport { AnnounceNumberNumber, AnnounceNumberNumberCurvePrimitive } from \"../curve/CurvePrimitive\";\r\nimport { ClipMaskXYZRangePlanes, ClipPrimitive, ClipPrimitiveProps, ClipShape } from \"./ClipPrimitive\";\r\nimport { Clipper, ClipPlaneContainment } from \"./ClipUtils\";\r\nimport { ConvexClipPlaneSet } from \"./ConvexClipPlaneSet\";\r\nimport { BooleanClipNodeIntersection } from \"./BooleanClipNode\";\r\nimport { Arc3d } from \"../curve/Arc3d\";\r\nimport { GrowableXYZArray } from \"../geometry3d/GrowableXYZArray\";\r\nimport { GrowableXYZArrayCache } from \"../geometry3d/ReusableObjectCache\";\r\n\r\n/**\r\n * Wire format describing a [[ClipVector]].\r\n * @public\r\n */\r\nexport type ClipVectorProps = ClipPrimitiveProps[];\r\n\r\n/**\r\n * Class holding an array structure of shapes defined by `ClipPrimitive`\r\n * * The `ClipVector` defines an intersection of the member `ClipPrimitive` regions.\r\n * * In the most common usage, one of the `ClipPrimitive` will be an outer region, and all others are holes with marker\r\n * flag indicating that the outside of each hole is live.\r\n * @public\r\n */\r\nexport class ClipVector implements Clipper {\r\n private _clips: ClipPrimitive[];\r\n /**\r\n * Range acting as first filter.\r\n * * This is understood as overall range limit, not as precise planes.\r\n * * Applying any rotation to the whole ClipVector generally expands this range, rather than exactly transforming\r\n * its planes.\r\n */\r\n public boundingRange: Range3d = Range3d.createNull();\r\n /** Returns a reference to the array of ClipShapes. */\r\n public get clips() { return this._clips; }\r\n private constructor(clips?: ClipPrimitive[]) {\r\n this._clips = clips ? clips : [];\r\n }\r\n /** Returns true if this ClipVector contains a ClipPrimitive. */\r\n public get isValid(): boolean { return this._clips.length > 0; }\r\n /** Create a ClipVector with an empty set of ClipShapes. */\r\n public static createEmpty(result?: ClipVector): ClipVector {\r\n if (result) {\r\n result._clips.length = 0;\r\n return result;\r\n }\r\n return new ClipVector();\r\n }\r\n /** Create a ClipVector from an array of ClipPrimitives (or derived classes) (capture the pointers) */\r\n public static createCapture(clips: ClipPrimitive[], result?: ClipVector): ClipVector {\r\n if (result) {\r\n result._clips = clips;\r\n return result;\r\n }\r\n return new ClipVector(clips);\r\n }\r\n /** Create a ClipVector from (clones of) an array of ClipPrimitives */\r\n public static create(clips: ClipPrimitive[], result?: ClipVector): ClipVector {\r\n const clipClones: ClipPrimitive[] = [];\r\n for (const clip of clips)\r\n clipClones.push(clip.clone());\r\n return ClipVector.createCapture(clipClones, result);\r\n }\r\n /** Create a deep copy of another ClipVector */\r\n public clone(result?: ClipVector): ClipVector {\r\n const retVal = result ? result : new ClipVector();\r\n retVal._clips.length = 0;\r\n for (const clip of this._clips) {\r\n retVal._clips.push(clip.clone());\r\n }\r\n retVal.boundingRange.setFrom(this.boundingRange);\r\n return retVal;\r\n }\r\n /** Parse this ClipVector into a JSON object. */\r\n public toJSON(): ClipVectorProps {\r\n if (!this.isValid)\r\n return [];\r\n\r\n return this.clips.map((clip) => clip.toJSON());\r\n }\r\n /** Parse a JSON object into a new ClipVector. */\r\n public static fromJSON(json: ClipVectorProps | undefined, result?: ClipVector): ClipVector {\r\n result = result ? result : new ClipVector();\r\n result.clear();\r\n if (!Array.isArray(json))\r\n return result;\r\n try {\r\n for (const clip of json) {\r\n const clipPrim = ClipPrimitive.fromJSON(clip);\r\n if (clipPrim)\r\n result._clips.push(clipPrim);\r\n }\r\n } catch (e) {\r\n result.clear();\r\n }\r\n return result;\r\n }\r\n /** Empties out the array of ClipShapes. */\r\n public clear() {\r\n this._clips.length = 0;\r\n }\r\n /** Append a deep copy of the given ClipPrimitive to this ClipVector. */\r\n public appendClone(clip: ClipPrimitive) {\r\n this._clips.push(clip.clone());\r\n }\r\n /** Append a reference of the given ClipPrimitive to this ClipVector. */\r\n public appendReference(clip: ClipPrimitive) {\r\n this._clips.push(clip);\r\n }\r\n /** Create and append a new ClipPrimitive to the array given a shape as an array of points. Returns true if successful. */\r\n public appendShape(shape: Point3d[], zLow?: number, zHigh?: number,\r\n transform?: Transform, isMask: boolean = false, invisible: boolean = false): boolean {\r\n const clip = ClipShape.createShape(shape, zLow, zHigh, transform, isMask, invisible);\r\n if (!clip)\r\n return false;\r\n this._clips.push(clip);\r\n return true;\r\n }\r\n /** Returns true if the given point lies inside all of this ClipVector's ClipShapes (by rule of intersection).*/\r\n public pointInside(point: Point3d, onTolerance: number = Geometry.smallMetricDistanceSquared): boolean {\r\n return this.isPointOnOrInside(point, onTolerance);\r\n }\r\n /**\r\n * Method from [[Clipper]] interface.\r\n * * Implement as dispatch to clipPlaneSets as supplied by derived class.\r\n */\r\n public isPointOnOrInside(point: Point3d, onTolerance: number = Geometry.smallMetricDistanceSquared): boolean {\r\n if (!this.boundingRange.isNull && !this.boundingRange.containsPoint(point))\r\n return false;\r\n\r\n for (const clip of this._clips) {\r\n if (!clip.pointInside(point, onTolerance))\r\n return false;\r\n }\r\n return true;\r\n }\r\n // Proxy object to implement line and arc clip.\r\n private _clipNodeProxy?: BooleanClipNodeIntersection;\r\n private ensureProxyClipNode(): boolean {\r\n if (this._clipNodeProxy)\r\n return true;\r\n this._clipNodeProxy = new BooleanClipNodeIntersection(true);\r\n let numChildren = 0;\r\n for (const child of this._clips) {\r\n const q = child.fetchClipPlanesRef();\r\n if (q) {\r\n numChildren++;\r\n this._clipNodeProxy.captureChild(q);\r\n }\r\n }\r\n return numChildren > 0;\r\n }\r\n /**\r\n * Method from [[Clipper]] interface.\r\n * * Implement as dispatch to clipPlaneSets as supplied by derived class.\r\n */\r\n public announceClippedSegmentIntervals(\r\n f0: number, f1: number, pointA: Point3d, pointB: Point3d, announce?: AnnounceNumberNumber,\r\n ): boolean {\r\n this.ensureProxyClipNode();\r\n if (this._clipNodeProxy)\r\n return this._clipNodeProxy.announceClippedSegmentIntervals(f0, f1, pointA, pointB, announce);\r\n return false;\r\n }\r\n /** Method from [[Clipper]] interface.\r\n * * Implement as dispatch to clipPlaneSets as supplied by derived class.\r\n */\r\n public announceClippedArcIntervals(arc: Arc3d, announce?: AnnounceNumberNumberCurvePrimitive): boolean {\r\n this.ensureProxyClipNode();\r\n if (this._clipNodeProxy)\r\n return this._clipNodeProxy.announceClippedArcIntervals(arc, announce);\r\n return false;\r\n }\r\n /** Execute polygon clip as intersection of the child primitives. */\r\n public appendPolygonClip(\r\n xyz: GrowableXYZArray,\r\n insideFragments: GrowableXYZArray[],\r\n outsideFragments: GrowableXYZArray[],\r\n arrayCache: GrowableXYZArrayCache) {\r\n this.ensureProxyClipNode();\r\n if (this._clipNodeProxy)\r\n this._clipNodeProxy.appendPolygonClip(xyz, insideFragments, outsideFragments, arrayCache);\r\n }\r\n /**\r\n * Transforms this ClipVector to a new coordinate-system.\r\n * Note that if the transform has rotate and scale the boundingRange member expands.\r\n * Returns true if successful.\r\n */\r\n public transformInPlace(transform: Transform): boolean {\r\n for (const clip of this._clips)\r\n if (clip.transformInPlace(transform) === false)\r\n return false;\r\n\r\n if (!this.boundingRange.isNull)\r\n transform.multiplyRange(this.boundingRange, this.boundingRange);\r\n\r\n return true;\r\n }\r\n /**\r\n * A simple way of packaging this ClipVector's ClipShape points into a multidimensional array, while also\r\n * taking into account each ClipPrimitive's individual transforms.\r\n * ClipPrimitives OTHER THAN ClipShape are ignored.\r\n * Information out:\r\n * - All of the loop points are stored in the multidimensional Point3d array given (will return unchanged upon failure).\r\n * - If given a transform, will be set from the transformFromClip of the first ClipPrimitive.\r\n * - The ClipMask of the final ClipPrimitive is stored in the returned array at index 0.\r\n * - The last valid zLow found is stored in the returned array at index 1.\r\n * - The last valid zHigh found is stored in the returned array at index 2.\r\n */\r\n public extractBoundaryLoops(loopPoints: Point3d[][], transform?: Transform): number[] {\r\n let clipM = ClipMaskXYZRangePlanes.None;\r\n let zBack = -Number.MAX_VALUE;\r\n let zFront = Number.MAX_VALUE;\r\n const retVal: number[] = [];\r\n let nLoops = 0;\r\n\r\n if (this._clips.length === 0)\r\n return retVal;\r\n let firstClipShape: ClipShape | undefined;\r\n const deltaTrans = Transform.createIdentity();\r\n\r\n for (const clip of this._clips) {\r\n if (clip instanceof ClipShape) {\r\n if (firstClipShape !== undefined && clip !== firstClipShape) { // Is not the first iteration\r\n let fwdTrans = Transform.createIdentity();\r\n let invTrans = Transform.createIdentity();\r\n\r\n if (firstClipShape.transformValid && clip.transformValid) {\r\n fwdTrans = clip.transformFromClip!.clone();\r\n invTrans = firstClipShape.transformToClip!.clone();\r\n }\r\n deltaTrans.setFrom(invTrans.multiplyTransformTransform(fwdTrans));\r\n }\r\n if (!firstClipShape)\r\n firstClipShape = clip;\r\n loopPoints[nLoops] = [];\r\n\r\n if (clip.polygon !== undefined) {\r\n clipM = ClipMaskXYZRangePlanes.XAndY;\r\n\r\n if (clip.zHighValid) {\r\n clipM = clipM | ClipMaskXYZRangePlanes.ZHigh;\r\n zFront = clip.zHigh!;\r\n }\r\n if (clip.zLowValid) {\r\n clipM = clipM | ClipMaskXYZRangePlanes.ZLow;\r\n zBack = clip.zLow!;\r\n }\r\n\r\n for (const point of clip.polygon)\r\n loopPoints[nLoops].push(point.clone());\r\n deltaTrans.multiplyPoint3dArray(loopPoints[nLoops], loopPoints[nLoops]);\r\n nLoops++;\r\n }\r\n }\r\n }\r\n retVal.push(clipM);\r\n retVal.push(zBack);\r\n retVal.push(zFront);\r\n if (transform && firstClipShape)\r\n transform.setFrom(firstClipShape.transformFromClip!);\r\n return retVal;\r\n }\r\n /** Sets this ClipVector and all of its members to the visibility specified. */\r\n public setInvisible(invisible: boolean) {\r\n for (const clip of this._clips)\r\n clip.setInvisible(invisible);\r\n }\r\n /**\r\n * For every clip, parse the member point array into the member clip plane object (only for clipPlanes member,\r\n * not the mask)\r\n */\r\n public parseClipPlanes() {\r\n for (const clip of this._clips)\r\n clip.fetchClipPlanesRef();\r\n }\r\n /**\r\n * Multiply all ClipPlanes DPoint4d by matrix.\r\n * @param matrix matrix to apply.\r\n * @param invert if true, use in verse of the matrix.\r\n * @param transpose if true, use the transpose of the matrix (or inverse, per invert parameter)\r\n * * Note that if matrixA is applied to all of space, the matrix to send to this method to get a corresponding effect on the plane is the inverse transpose of matrixA\r\n * * Callers that will apply the same matrix to many planes should pre-invert the matrix for efficiency.\r\n * * Both params default to true to get the full effect of transforming space.\r\n * @param matrix matrix to apply\r\n * @returns false if matrix inversion fails.\r\n */\r\n public multiplyPlanesByMatrix4d(matrix: Matrix4d, invert: boolean = true, transpose: boolean = true): boolean {\r\n if (invert) { // form inverse once here, reuse for all planes\r\n const inverse = matrix.createInverse();\r\n if (!inverse)\r\n return false;\r\n return this.multiplyPlanesByMatrix4d(inverse, false, transpose);\r\n }\r\n // no inverse necessary -- lower level cannot fail.\r\n for (const clip of this._clips)\r\n clip.multiplyPlanesByMatrix4d(matrix, false, transpose);\r\n return true;\r\n }\r\n /**\r\n * Determines whether the given points fall inside or outside this set of ClipShapes. If any set is defined\r\n * by masking planes, checks the mask planes only, provided that ignoreMasks is false. Otherwise, checks the\r\n * _clipPlanes member.\r\n */\r\n public classifyPointContainment(points: Point3d[], ignoreMasks: boolean = false): ClipPlaneContainment {\r\n let currentContainment = ClipPlaneContainment.Ambiguous;\r\n\r\n for (const primitive of this._clips) {\r\n const thisContainment = primitive.classifyPointContainment(points, ignoreMasks);\r\n\r\n if (ClipPlaneContainment.Ambiguous === thisContainment)\r\n return ClipPlaneContainment.Ambiguous;\r\n\r\n if (ClipPlaneContainment.Ambiguous === currentContainment)\r\n currentContainment = thisContainment;\r\n else if (currentContainment !== thisContainment)\r\n return ClipPlaneContainment.Ambiguous;\r\n }\r\n return currentContainment;\r\n }\r\n /**\r\n * Determines whether a 3D range lies inside or outside this set of ClipShapes. If any set is defined by masking planes,\r\n * checks the mask planes only, provided that ignoreMasks is false. Otherwise, checks the clip planes member.\r\n */\r\n public classifyRangeContainment(range: Range3d, ignoreMasks: boolean): ClipPlaneContainment {\r\n const corners: Point3d[] = range.corners();\r\n return this.classifyPointContainment(corners, ignoreMasks);\r\n }\r\n /**\r\n * For an array of points (making up a LineString), tests whether the segment between each point lies inside the\r\n * ClipVector.\r\n * If true, returns true immediately.\r\n */\r\n public isAnyLineStringPointInside(points: Point3d[]): boolean {\r\n for (const clip of this._clips) {\r\n const clipPlaneSet = clip.fetchClipPlanesRef();\r\n if (clipPlaneSet !== undefined) {\r\n for (let i = 0; i + 1 < points.length; i++) {\r\n const segment = LineSegment3d.create(points[i], points[i + 1]);\r\n if (clipPlaneSet.isAnyPointInOrOnFromSegment(segment))\r\n return true;\r\n }\r\n }\r\n }\r\n return false;\r\n }\r\n /** Note: Line segments are used to represent 1 dimensional intervals here, rather than segments. */\r\n public sumSizes(intervals: Segment1d[], begin: number, end: number): number {\r\n let s = 0.0;\r\n for (let i = begin; i < end; i++)\r\n s += (intervals[i].x1 - intervals[i].x0);\r\n return s;\r\n }\r\n private static readonly _TARGET_FRACTION_SUM = 0.99999999;\r\n /**\r\n * For an array of points that make up a LineString, develops a line segment between each point pair,\r\n * and returns true if all segments lie inside this ClipVector.\r\n */\r\n public isLineStringCompletelyContained(points: Point3d[]): boolean {\r\n const clipIntervals: Segment1d[] = [];\r\n\r\n for (let i = 0; i + 1 < points.length; i++) {\r\n const segment = LineSegment3d.create(points[i], points[i + 1]);\r\n let fractionSum = 0.0;\r\n let index0 = 0;\r\n\r\n for (const clip of this._clips) {\r\n const clipPlaneSet = clip.fetchClipPlanesRef();\r\n if (clipPlaneSet !== undefined) {\r\n clipPlaneSet.appendIntervalsFromSegment(segment, clipIntervals);\r\n const index1 = clipIntervals.length;\r\n fractionSum += this.sumSizes(clipIntervals, index0, index1);\r\n index0 = index1;\r\n // ASSUME primitives are non-overlapping...\r\n if (fractionSum >= ClipVector._TARGET_FRACTION_SUM)\r\n break;\r\n }\r\n }\r\n if (fractionSum < ClipVector._TARGET_FRACTION_SUM)\r\n return false;\r\n }\r\n return true;\r\n }\r\n /**\r\n * Serializes this ClipVector to a compact string representation appropriate for transmission as part of a URL.\r\n * Chiefly used for requesting [Tile]($frontend)s with section cut facets.\r\n * UnionOfConvexClipPlaneSets is obtained for each ClipPrimitive. The encoding is as follows:\r\n * ClipVector:\r\n * ClipPrimitive[]\r\n * _\r\n * ClipPrimitive:\r\n * invisible: 0|1\r\n * ConvexClipPlaneSet[]\r\n * _\r\n * ConvexClipPlaneSet:\r\n * ClipPlane[]\r\n * _\r\n * ClipPlane:\r\n * flags: 0|1|2|3, where 1=invisible and 2=interior\r\n * inwardNormal: Number[3]\r\n * distance: Number\r\n * Number:\r\n * number\r\n * _\r\n */\r\n public toCompactString(): string {\r\n function formatNumber(num: number) {\r\n return `${num.toString()}_`;\r\n }\r\n function formatVector3d(vec: Vector3d) {\r\n return `${formatNumber(vec.x)}${formatNumber(vec.y)}${formatNumber(vec.z)}`;\r\n }\r\n function formatFlags(flags: number) {\r\n const f = flags.toString();\r\n assert(1 === f.length);\r\n return f;\r\n }\r\n function formatPlane(plane: ClipPlane) {\r\n let flags = plane.invisible ? 1 : 0;\r\n flags |= (plane.interior ? 2 : 0);\r\n return `${formatFlags(flags)}${formatVector3d(plane.inwardNormalRef)}${formatNumber(plane.distance)}`;\r\n }\r\n function formatPlaneSet(set: ConvexClipPlaneSet) {\r\n let planes = \"\";\r\n for (const plane of set.planes)\r\n planes = `${planes}${formatPlane(plane)}`;\r\n\r\n return `${planes}_`;\r\n }\r\n function formatPrimitive(prim: ClipPrimitive) {\r\n const flags = prim.invisible ? 1 : 0;\r\n let str = flags.toString();\r\n assert(1 === str.length);\r\n\r\n const union = prim.fetchClipPlanesRef();\r\n if (union) {\r\n for (const s of union.convexSets)\r\n str = `${str}${formatPlaneSet(s)}`;\r\n }\r\n return `${str}_`;\r\n }\r\n let result = \"\";\r\n for (const primitive of this.clips)\r\n result = `${result}${formatPrimitive(primitive)}`;\r\n return `${result}_`;\r\n }\r\n}\r\n\r\n/**\r\n * Bundles a [[ClipVector]] with its compact string representation.\r\n * @note The string representation is computed once; the ClipVector is assumed not to be subsequently modified.\r\n * @see [[StringifiedClipVector.fromClipVector]] to create from a ClipVector.\r\n * @see [[ClipVector.toCompactString]] for a description of the string representation.\r\n * @alpha\r\n */\r\nexport type StringifiedClipVector = ClipVector & { readonly clipString: string };\r\n\r\n/**\r\n * Bundles a ClipVector with its compact string representation.\r\n * @note The string representation is computed once; the ClipVector is assumed not to be subsequently modified.\r\n * @alpha\r\n */\r\nexport namespace StringifiedClipVector { // eslint-disable-line @typescript-eslint/no-redeclare\r\n /** Create from a ClipVector.\r\n * @param clip The ClipVector to stringify.\r\n * @returns The input ClipVector with its compact string representation, or undefined if the input is undefined or empty.\r\n * @note The string representation is computed once; the ClipVector is assumed not to be subsequently modified.\r\n */\r\n export function fromClipVector(clip?: ClipVector): StringifiedClipVector | undefined {\r\n if (!clip || !clip.isValid)\r\n return undefined;\r\n\r\n const ret = clip as any;\r\n if (undefined === ret.clipString)\r\n ret.clipString = clip.toCompactString();\r\n\r\n const stringified = ret as StringifiedClipVector;\r\n assert(undefined !== stringified.clipString);\r\n return stringified;\r\n }\r\n}\r\n"]}
|