@itwin/core-geometry 4.1.0-dev.68 → 4.1.0-dev.69
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/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/ClipUtils.js.map +1 -1
- package/lib/cjs/core-geometry.d.ts +3 -2
- package/lib/cjs/core-geometry.d.ts.map +1 -1
- package/lib/cjs/core-geometry.js +4 -5
- package/lib/cjs/core-geometry.js.map +1 -1
- package/lib/cjs/curve/Arc3d.d.ts +1 -1
- package/lib/cjs/curve/Arc3d.d.ts.map +1 -1
- package/lib/cjs/curve/Arc3d.js +2 -2
- package/lib/cjs/curve/Arc3d.js.map +1 -1
- package/lib/cjs/curve/CurveChainWithDistanceIndex.d.ts +1 -1
- package/lib/cjs/curve/CurveChainWithDistanceIndex.d.ts.map +1 -1
- package/lib/cjs/curve/CurveChainWithDistanceIndex.js +2 -2
- package/lib/cjs/curve/CurveChainWithDistanceIndex.js.map +1 -1
- package/lib/cjs/curve/CurveCollection.d.ts +2 -2
- package/lib/cjs/curve/CurveCollection.js +2 -2
- package/lib/cjs/curve/CurveCollection.js.map +1 -1
- package/lib/cjs/curve/CurveCurve.js.map +1 -1
- 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 +13 -13
- package/lib/cjs/curve/CurvePrimitive.d.ts.map +1 -1
- 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 +1 -1
- package/lib/cjs/curve/LineSegment3d.d.ts.map +1 -1
- package/lib/cjs/curve/LineSegment3d.js +2 -2
- package/lib/cjs/curve/LineSegment3d.js.map +1 -1
- package/lib/cjs/curve/LineString3d.d.ts +1 -1
- package/lib/cjs/curve/LineString3d.d.ts.map +1 -1
- package/lib/cjs/curve/LineString3d.js +2 -2
- package/lib/cjs/curve/LineString3d.js.map +1 -1
- 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/ProxyCurve.d.ts +1 -1
- package/lib/cjs/curve/ProxyCurve.d.ts.map +1 -1
- 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 +10 -13
- package/lib/cjs/curve/RegionOps.d.ts.map +1 -1
- package/lib/cjs/curve/RegionOps.js +16 -17
- 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.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/MultiChainCollector.d.ts +59 -74
- package/lib/cjs/curve/internalContexts/MultiChainCollector.d.ts.map +1 -1
- package/lib/cjs/curve/internalContexts/MultiChainCollector.js +130 -223
- package/lib/cjs/curve/internalContexts/MultiChainCollector.js.map +1 -1
- package/lib/cjs/curve/internalContexts/PlaneAltitudeRangeContext.js.map +1 -1
- package/lib/cjs/curve/internalContexts/PolygonOffsetContext.d.ts +6 -100
- package/lib/cjs/curve/internalContexts/PolygonOffsetContext.d.ts.map +1 -1
- package/lib/cjs/curve/internalContexts/PolygonOffsetContext.js +12 -167
- package/lib/cjs/curve/internalContexts/PolygonOffsetContext.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.js.map +1 -1
- package/lib/cjs/geometry3d/AngleSweep.js.map +1 -1
- package/lib/cjs/geometry3d/BarycentricTriangle.js.map +1 -1
- package/lib/cjs/geometry3d/BilinearPatch.js.map +1 -1
- package/lib/cjs/geometry3d/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.js +5 -5
- package/lib/cjs/geometry3d/Matrix3d.js.map +1 -1
- package/lib/cjs/geometry3d/OrderedRotationAngles.js.map +1 -1
- package/lib/cjs/geometry3d/Plane3d.js.map +1 -1
- package/lib/cjs/geometry3d/Plane3dByOriginAndUnitNormal.js.map +1 -1
- package/lib/cjs/geometry3d/Plane3dByOriginAndVectors.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 +4 -4
- package/lib/cjs/geometry3d/Point3dVector3d.js +5 -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 +1 -2
- package/lib/cjs/geometry3d/PolygonOps.d.ts.map +1 -1
- package/lib/cjs/geometry3d/PolygonOps.js +2 -3
- package/lib/cjs/geometry3d/PolygonOps.js.map +1 -1
- 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.js.map +1 -1
- package/lib/cjs/geometry3d/Transform.js +3 -3
- 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 +10 -7
- package/lib/cjs/polyface/PolyfaceQuery.d.ts.map +1 -1
- package/lib/cjs/polyface/PolyfaceQuery.js +13 -12
- 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/OffsetMeshContext.js.map +1 -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.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/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/ClipUtils.js.map +1 -1
- package/lib/esm/core-geometry.d.ts +3 -2
- package/lib/esm/core-geometry.d.ts.map +1 -1
- package/lib/esm/core-geometry.js +3 -3
- package/lib/esm/core-geometry.js.map +1 -1
- package/lib/esm/curve/Arc3d.d.ts +1 -1
- package/lib/esm/curve/Arc3d.d.ts.map +1 -1
- package/lib/esm/curve/Arc3d.js +1 -1
- package/lib/esm/curve/Arc3d.js.map +1 -1
- package/lib/esm/curve/CurveChainWithDistanceIndex.d.ts +1 -1
- package/lib/esm/curve/CurveChainWithDistanceIndex.d.ts.map +1 -1
- package/lib/esm/curve/CurveChainWithDistanceIndex.js +1 -1
- package/lib/esm/curve/CurveChainWithDistanceIndex.js.map +1 -1
- package/lib/esm/curve/CurveCollection.d.ts +2 -2
- package/lib/esm/curve/CurveCollection.js +2 -2
- package/lib/esm/curve/CurveCollection.js.map +1 -1
- package/lib/esm/curve/CurveCurve.js.map +1 -1
- 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 +13 -13
- package/lib/esm/curve/CurvePrimitive.d.ts.map +1 -1
- 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 +1 -1
- package/lib/esm/curve/LineSegment3d.d.ts.map +1 -1
- package/lib/esm/curve/LineSegment3d.js +1 -1
- package/lib/esm/curve/LineSegment3d.js.map +1 -1
- package/lib/esm/curve/LineString3d.d.ts +1 -1
- package/lib/esm/curve/LineString3d.d.ts.map +1 -1
- package/lib/esm/curve/LineString3d.js +1 -1
- package/lib/esm/curve/LineString3d.js.map +1 -1
- 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/ProxyCurve.d.ts +1 -1
- package/lib/esm/curve/ProxyCurve.d.ts.map +1 -1
- 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 +10 -13
- package/lib/esm/curve/RegionOps.d.ts.map +1 -1
- package/lib/esm/curve/RegionOps.js +17 -18
- 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.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/MultiChainCollector.d.ts +59 -74
- package/lib/esm/curve/internalContexts/MultiChainCollector.d.ts.map +1 -1
- package/lib/esm/curve/internalContexts/MultiChainCollector.js +129 -221
- package/lib/esm/curve/internalContexts/MultiChainCollector.js.map +1 -1
- package/lib/esm/curve/internalContexts/PlaneAltitudeRangeContext.js.map +1 -1
- package/lib/esm/curve/internalContexts/PolygonOffsetContext.d.ts +6 -100
- package/lib/esm/curve/internalContexts/PolygonOffsetContext.d.ts.map +1 -1
- package/lib/esm/curve/internalContexts/PolygonOffsetContext.js +9 -162
- package/lib/esm/curve/internalContexts/PolygonOffsetContext.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.js.map +1 -1
- package/lib/esm/geometry3d/AngleSweep.js.map +1 -1
- package/lib/esm/geometry3d/BarycentricTriangle.js.map +1 -1
- package/lib/esm/geometry3d/BilinearPatch.js.map +1 -1
- package/lib/esm/geometry3d/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.js +5 -5
- package/lib/esm/geometry3d/Matrix3d.js.map +1 -1
- package/lib/esm/geometry3d/OrderedRotationAngles.js.map +1 -1
- package/lib/esm/geometry3d/Plane3d.js.map +1 -1
- package/lib/esm/geometry3d/Plane3dByOriginAndUnitNormal.js.map +1 -1
- package/lib/esm/geometry3d/Plane3dByOriginAndVectors.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 +4 -4
- package/lib/esm/geometry3d/Point3dVector3d.js +5 -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 +1 -2
- package/lib/esm/geometry3d/PolygonOps.d.ts.map +1 -1
- package/lib/esm/geometry3d/PolygonOps.js +2 -3
- package/lib/esm/geometry3d/PolygonOps.js.map +1 -1
- 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.js.map +1 -1
- package/lib/esm/geometry3d/Transform.js +3 -3
- 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 +10 -7
- package/lib/esm/polyface/PolyfaceQuery.d.ts.map +1 -1
- package/lib/esm/polyface/PolyfaceQuery.js +14 -13
- 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/OffsetMeshContext.js.map +1 -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.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/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 +5 -16
- 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
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"InterpolationCurve3d.js","sourceRoot":"","sources":["../../../src/bspline/InterpolationCurve3d.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAEH,mEAAkE;AAClE,0CAAuC;AACvC,6DAA0D;AAC1D,oDAAiD;AAEjD,gEAA6D;AAC7D,iDAAgD;AAkChD;;;;;GAKG;AACH,MAAa,2BAA2B;IACtC;;;;OAIG;IACH,YAAmB,SAAqB,EAAE,KAAgB;QACxD,IAAI,CAAC,UAAU,GAAG,SAAS,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC;QAC7C,IAAI,CAAC,MAAM,GAAG,KAAK,CAAC;IACtB,CAAC;IAaD,0BAA0B;IAC1B,IAAW,KAAK,KAAa,OAAO,mBAAQ,CAAC,aAAa,CAAC,IAAI,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC;IAC7E,IAAW,KAAK,CAAC,GAAW,IAAI,IAAI,CAAC,MAAM,GAAG,GAAG,CAAC,CAAC,CAAC;IACpD,2BAA2B;IAC3B,IAAW,MAAM,KAAc,OAAO,mBAAQ,CAAC,YAAY,CAAC,IAAI,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC,CAAC,CAAC;IACnF,IAAW,MAAM,CAAC,GAAY,IAAI,IAAI,CAAC,OAAO,GAAG,GAAG,CAAC,CAAC,CAAC;IACvD,oCAAoC;IACpC,IAAW,eAAe,KAAa,OAAO,mBAAQ,CAAC,aAAa,CAAC,IAAI,CAAC,gBAAgB,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC;IACjG,IAAW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QAAQ,CAAC,UAAU,CAAC,CAAC;SAC7D;QACD,OAAO,OAAO,CAAC;IACjB,CAAC;IAED,0BAA0B;IACV,KAAK;QACnB,OAAO,IAAI,oBAAoB,CAAC,IAAI,CAAC,QAAQ,CAAC,KAAK,EAAE,EAAE,IAAI,CAAC,WAAW,CAAC,KAAK,EAAE,CAAC,CAAC;IACnF,CAAC;IAEe,aAAa,CAAC,KAAoB;QAChD,IAAI,KAAK,YAAY,oBAAoB,EAAE;YACzC,OAAO,2BAA2B,CAAC,cAAc,CAAC,IAAI,CAAC,QAAQ,EAAE,KAAK,CAAC,QAAQ,CAAC,CAAC;SAClF;QACD,OAAO,KAAK,CAAC;IACf,CAAC;IAED,0DAA0D;IACnD,mBAAmB,CAAC,KAAoB,IAAa,OAAO,KAAK,YAAY,oBAAoB,CAAC,CAAC,CAAC;CAE5G;AAlGD,oDAkGC","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module Bspline\r\n */\r\n\r\nimport { Point3d, Vector3d } from \"../geometry3d/Point3dVector3d\";\r\nimport { Geometry } from \"../Geometry\";\r\nimport { Point3dArray } from \"../geometry3d/PointHelpers\";\r\nimport { ProxyCurve } from \"../curve/ProxyCurve\";\r\nimport { CurvePrimitive } from \"../curve/CurvePrimitive\";\r\nimport { BSplineCurveOps } from \"../bspline/BSplineCurveOps\";\r\nimport { BSplineCurve3d } from \"./BSplineCurve\";\r\nimport { GeometryQuery } from \"../curve/GeometryQuery\";\r\nimport { Transform } from \"../geometry3d/Transform\";\r\nimport { GeometryHandler } from \"../geometry3d/GeometryHandler\";\r\nimport { XYZProps } from \"../geometry3d/XYZProps\";\r\n\r\n/**\r\n * fitPoints and end condition data for [[InterpolationCurve3d]]\r\n * * This is a \"json compatible\" version of [[InterpolationCurve3dOptions]]\r\n * @public\r\n */\r\nexport interface InterpolationCurve3dProps {\r\n /** order of the computed bspline (one more than degree) */\r\n order?: number;\r\n /** true if the B-spline construction should be periodic */\r\n closed?: boolean;\r\n /** if closed and no knots, compute chord length knots (1) or uniform knots (0). Chord length knots give best fit. */\r\n isChordLenKnots?: number;\r\n /** if !closed but first and last fitPoints are equal, pivot computed start/end tangent(s) so that they are colinear (1) or leave them be (0). */\r\n isColinearTangents?: number;\r\n /** if !closed and start/endTangent is given, set its magnitude to the first/last fit point chord length (1) or to the magnitude of the Bessel tangent (0). Bessel gives best fit. */\r\n isChordLenTangents?: number;\r\n /** if !closed and start/endTangent is absent, compute it using the natural end condition (1) or Bessel (0). Bessel gives best fit. */\r\n isNaturalTangents?: number;\r\n /** optional start tangent, pointing into curve. Magnitude is ignored. */\r\n startTangent?: XYZProps;\r\n /** optional end tangent, pointing into curve. Magnitude is ignored. */\r\n endTangent?: XYZProps;\r\n /** points that the curve must pass through */\r\n fitPoints: XYZProps[];\r\n /** parameters for curve fitting, one per fit point */\r\n knots?: number[];\r\n}\r\n\r\n/**\r\n * fitPoints and end condition data for [[InterpolationCurve3d]]\r\n * * This is a \"typed object\" version of the serializer-friendly [[InterpolationCurve3dProps]]\r\n * * Typical use cases rarely require all parameters, so the constructor does not itemize them as parameters.\r\n * @public\r\n */\r\nexport class InterpolationCurve3dOptions {\r\n /**\r\n * Constructor.\r\n * @param fitPoints points to CAPTURE\r\n * @param knots array to CAPTURE\r\n */\r\n public constructor(fitPoints?: Point3d[], knots?: number[]) {\r\n this._fitPoints = fitPoints ? fitPoints : [];\r\n this._knots = knots;\r\n }\r\n\r\n private _order?: number;\r\n private _closed?: boolean;\r\n private _isChordLenKnots?: number;\r\n private _isColinearTangents?: number;\r\n private _isChordLenTangents?: number;\r\n private _isNaturalTangents?: number;\r\n private _startTangent?: Vector3d;\r\n private _endTangent?: Vector3d;\r\n private _fitPoints: Point3d[];\r\n private _knots?: number[];\r\n\r\n /** `order` as property */\r\n public get order(): number { return Geometry.resolveNumber(this._order, 4); }\r\n public set order(val: number) { this._order = val; }\r\n /** `closed` as property */\r\n public get closed(): boolean { return Geometry.resolveValue(this._closed, false); }\r\n public set closed(val: boolean) { this._closed = val; }\r\n /** `isChordLenKnots` as property */\r\n public get isChordLenKnots(): number { return Geometry.resolveNumber(this._isChordLenKnots, 0); }\r\n public set isChordLenKnots(val: number) { this._isChordLenKnots = val; }\r\n /** `isColinearTangents` as property */\r\n public get isColinearTangents(): number { return Geometry.resolveNumber(this._isColinearTangents, 0); }\r\n public set isColinearTangents(val: number) { this._isColinearTangents = val; }\r\n /** `isChordLenTangents` as property */\r\n public get isChordLenTangents(): number { return Geometry.resolveNumber(this._isChordLenTangents, 0); }\r\n public set isChordLenTangents(val: number) { this._isChordLenTangents = val; }\r\n /** `isNaturalTangents` as property */\r\n public get isNaturalTangents(): number { return Geometry.resolveNumber(this._isNaturalTangents, 0); }\r\n public set isNaturalTangents(val: number) { this._isNaturalTangents = val; }\r\n /** access POSSIBLY UNDEFINED start tangent. Setter CAPTURES. */\r\n public get startTangent(): Vector3d | undefined { return this._startTangent; }\r\n public set startTangent(val: Vector3d | undefined) { this._startTangent = val; }\r\n /** access POSSIBLY UNDEFINED end tangent. Setter CAPTURES. */\r\n public get endTangent(): Vector3d | undefined { return this._endTangent; }\r\n public set endTangent(val: Vector3d | undefined) { this._endTangent = val; }\r\n /** access POINTER TO fit points. Setter CAPTURES. */\r\n public get fitPoints(): Point3d[] { return this._fitPoints; }\r\n public set fitPoints(val: Point3d[]) { this._fitPoints = val; }\r\n /** access POSSIBLY UNDEFINED knots array. Setter CAPTURES. */\r\n public get knots(): number[] | undefined { return this._knots; }\r\n public set knots(val: number[] | undefined) { this._knots = val; }\r\n\r\n /** One step setup of properties not named in constructor.\r\n * * CAPTURE pointers to tangents.\r\n * * OPTIONALLY downgrade \"0\" values to undefined.\r\n */\r\n public captureOptionalProps(\r\n order: number | undefined,\r\n closed: boolean | undefined,\r\n isChordLenKnots: number | undefined,\r\n isColinearTangents: number | undefined,\r\n isChordLenTangent: number | undefined,\r\n isNaturalTangents: number | undefined,\r\n startTangent: Vector3d | undefined,\r\n endTangent: Vector3d | undefined\r\n ) {\r\n this._order = Geometry.resolveToUndefined(order, 0);\r\n this._closed = Geometry.resolveToUndefined(closed, false);\r\n this._isChordLenKnots = Geometry.resolveToUndefined(isChordLenKnots, 0);\r\n this._isColinearTangents = Geometry.resolveToUndefined(isColinearTangents, 0);\r\n this._isChordLenTangents = Geometry.resolveToUndefined(isChordLenTangent, 0);\r\n this._isNaturalTangents = Geometry.resolveToUndefined(isNaturalTangents, 0);\r\n this._startTangent = startTangent;\r\n this._endTangent = endTangent;\r\n\r\n }\r\n /** Clone with strongly typed members reduced to simple json, with \"undefined\" members omitted */\r\n public cloneAsInterpolationCurve3dProps(): InterpolationCurve3dProps {\r\n const props: InterpolationCurve3dProps = {\r\n fitPoints: Point3dArray.cloneDeepJSONNumberArrays(this.fitPoints),\r\n knots: this._knots?.slice(),\r\n };\r\n if (this._order !== undefined)\r\n props.order = this._order;\r\n if (this._closed !== undefined)\r\n props.closed = this._closed;\r\n if (this._isChordLenKnots !== undefined)\r\n props.isChordLenKnots = this._isChordLenKnots;\r\n if (this._isColinearTangents !== undefined)\r\n props.isColinearTangents = this._isColinearTangents;\r\n if (this._isChordLenTangents !== undefined)\r\n props.isChordLenTangents = this._isChordLenTangents;\r\n if (this._isNaturalTangents !== undefined)\r\n props.isNaturalTangents = this._isNaturalTangents;\r\n if (this._startTangent !== undefined)\r\n props.startTangent = this._startTangent?.toArray();\r\n if (this._endTangent !== undefined)\r\n props.endTangent = this._endTangent?.toArray();\r\n return props;\r\n }\r\n /** Clone with strongly typed members reduced to simple json. */\r\n public clone(): InterpolationCurve3dOptions {\r\n const clone = new InterpolationCurve3dOptions(Point3dArray.clonePoint3dArray(this.fitPoints), this.knots?.slice());\r\n clone._order = this.order;\r\n clone._closed = this.closed;\r\n clone._isChordLenKnots = this.isChordLenKnots;\r\n clone._isColinearTangents = this.isColinearTangents;\r\n clone._isChordLenTangents = this.isChordLenTangents;\r\n clone._isNaturalTangents = this.isNaturalTangents;\r\n clone._startTangent = this._startTangent?.clone();\r\n clone._endTangent = this._endTangent?.clone();\r\n return clone;\r\n }\r\n\r\n /** Clone with strongly typed members reduced to simple json. */\r\n public static create(source: InterpolationCurve3dProps): InterpolationCurve3dOptions {\r\n const result = new InterpolationCurve3dOptions(Point3dArray.clonePoint3dArray(source.fitPoints), source.knots?.slice());\r\n result._order = source.order;\r\n result._closed = source.closed;\r\n result._isChordLenKnots = source.isChordLenKnots;\r\n result._isColinearTangents = source.isColinearTangents;\r\n result._isChordLenTangents = source.isChordLenTangents;\r\n result._isNaturalTangents = source.isNaturalTangents;\r\n result._startTangent = source.startTangent ? Vector3d.fromJSON(source.startTangent) : undefined;\r\n result._endTangent = source.endTangent ? Vector3d.fromJSON(source.endTangent) : undefined;\r\n return result;\r\n }\r\n // ugh.\r\n // vector equality test with awkward rule that 000 matches undefined.\r\n private static areAlmostEqualAllow000AsUndefined(a: Vector3d | undefined, b: Vector3d | undefined): boolean {\r\n if (a !== undefined && a.maxAbs() === 0)\r\n a = undefined;\r\n if (b !== undefined && b.maxAbs() === 0)\r\n b = undefined;\r\n if (a !== undefined && b !== undefined)\r\n return a.isAlmostEqual(b);\r\n return a === undefined && b === undefined;\r\n }\r\n public static areAlmostEqual(dataA: InterpolationCurve3dOptions | undefined, dataB: InterpolationCurve3dOptions | undefined): boolean {\r\n if (dataA === undefined && dataB === undefined)\r\n return true;\r\n if (dataA !== undefined && dataB !== undefined) {\r\n if (Geometry.areEqualAllowUndefined(dataA.order, dataB.order)\r\n && Geometry.areEqualAllowUndefined(dataA.closed, dataB.closed)\r\n && Geometry.areEqualAllowUndefined(dataA.isChordLenKnots, dataB.isChordLenKnots)\r\n && Geometry.areEqualAllowUndefined(dataA.isColinearTangents, dataB.isColinearTangents)\r\n && Geometry.areEqualAllowUndefined(dataA.isNaturalTangents, dataB.isNaturalTangents)\r\n && this.areAlmostEqualAllow000AsUndefined(dataA.startTangent, dataB.startTangent)\r\n && this.areAlmostEqualAllow000AsUndefined(dataA.endTangent, dataB.endTangent)\r\n && Geometry.almostEqualArrays(dataA.fitPoints, dataB.fitPoints, (a: Point3d, b: Point3d) => a.isAlmostEqual(b))) {\r\n if (Geometry.almostEqualNumberArrays(dataA.knots, dataB.knots, (a: number, b: number) => a === b))\r\n return true;\r\n if (dataA.knots === undefined && dataB.knots === undefined)\r\n return true;\r\n /* alas .. need to allow tricky mismatch of end replication */\r\n let knotsA = dataA.knots, knotsB = dataB.knots;\r\n if (dataA.knots === undefined) // construct undefined knots to compare against defined knots\r\n knotsA = BSplineCurveOps.C2CubicFit.constructFitParametersFromPoints(dataA.fitPoints, dataA.isChordLenKnots, dataA.closed);\r\n else if (dataB.knots === undefined)\r\n knotsB = BSplineCurveOps.C2CubicFit.constructFitParametersFromPoints(dataB.fitPoints, dataB.isChordLenKnots, dataB.closed);\r\n knotsA = BSplineCurveOps.C2CubicFit.convertCubicKnotVectorToFitParams(knotsA, dataA.fitPoints.length, false);\r\n knotsB = BSplineCurveOps.C2CubicFit.convertCubicKnotVectorToFitParams(knotsB, dataB.fitPoints.length, false);\r\n return Geometry.almostEqualNumberArrays(knotsA, knotsB, (a: number, b: number) => Geometry.isAlmostEqualNumber(a, b));\r\n }\r\n }\r\n return false;\r\n }\r\n /** reverse the order or sense of all start-to-end related properties. */\r\n public reverseInPlace() {\r\n this.fitPoints.reverse();\r\n if (this.knots)\r\n this.knots.reverse();\r\n // Swap pointers to tangents. They don't need to be negated because they point into the curve.\r\n const oldStart = this._startTangent;\r\n this._startTangent = this.endTangent;\r\n this._endTangent = oldStart;\r\n }\r\n}\r\n\r\n/**\r\n * Interpolating curve.\r\n * * Derive from [[ProxyCurve]]\r\n * * Use a [[BSplineCurve3d]] as the proxy\r\n * *\r\n * @public\r\n */\r\nexport class InterpolationCurve3d extends ProxyCurve {\r\n public readonly curvePrimitiveType = \"interpolationCurve\";\r\n private _options: InterpolationCurve3dOptions;\r\n /**\r\n * CAPTURE properties and proxy curve.\r\n */\r\n private constructor(properties: InterpolationCurve3dOptions, proxyCurve: CurvePrimitive) {\r\n super(proxyCurve);\r\n this._options = properties;\r\n }\r\n\r\n public override dispatchToGeometryHandler(handler: GeometryHandler): any {\r\n let result = handler.handleInterpolationCurve3d(this);\r\n if (undefined === result) // if handler doesn't specialize on interpolation curves, default to proxy\r\n result = this._proxyCurve.dispatchToGeometryHandler(handler);\r\n return result;\r\n }\r\n /**\r\n * Create an [[InterpolationCurve3d]] based on points, knots, and other properties in the [[InterpolationCurve3dProps]] or [[InterpolationCurve3dOptions]].\r\n * * This saves a COPY OF the options or props.\r\n * * Use createCapture () if the options or props can be used without copy\r\n */\r\n public static create(options: InterpolationCurve3dOptions | InterpolationCurve3dProps): InterpolationCurve3d | undefined {\r\n let optionsCopy;\r\n if (options instanceof InterpolationCurve3dOptions) {\r\n optionsCopy = options.clone();\r\n } else {\r\n optionsCopy = InterpolationCurve3dOptions.create(options);\r\n }\r\n return InterpolationCurve3d.createCapture(optionsCopy);\r\n }\r\n /** Create an [[InterpolationCurve3d]]\r\n * * The options object is captured into the new curve object (not copied)\r\n */\r\n public static createCapture(options: InterpolationCurve3dOptions): InterpolationCurve3d | undefined {\r\n const proxyCurve = BSplineCurve3d.createFromInterpolationCurve3dOptions(options);\r\n if (proxyCurve)\r\n return new InterpolationCurve3d(options, proxyCurve);\r\n return undefined;\r\n }\r\n /** Return a (copy of) the defining points, packed as a Float64Array */\r\n public copyFitPointsFloat64Array(): Float64Array {\r\n return Point3dArray.cloneXYZPropsAsFloat64Array(this._options.fitPoints);\r\n }\r\n\r\n /**\r\n * Return json key-value pairs for for this [[InterpolationCurve3d]].\r\n * @returns\r\n */\r\n public toJSON(): any {\r\n return this._options.cloneAsInterpolationCurve3dProps();\r\n }\r\n /** Clone the [[InterpolationCurve3dProps]] object in this [[InterpolationCurve3d]] */\r\n public cloneProps(): InterpolationCurve3dProps {\r\n return this._options.cloneAsInterpolationCurve3dProps();\r\n }\r\n\r\n /** return the options pointer */\r\n public get options(): InterpolationCurve3dOptions { return this._options; }\r\n\r\n /**\r\n * Reverse the curve direction.\r\n * * This updates both the defining properties and the proxy bspline.\r\n */\r\n public reverseInPlace(): void {\r\n this._proxyCurve.reverseInPlace();\r\n this._options.reverseInPlace();\r\n }\r\n /**\r\n * Transform this [[InterpolationCurve3d]] and its defining data in place\r\n */\r\n public tryTransformInPlace(transform: Transform): boolean {\r\n const proxyOk = this._proxyCurve.tryTransformInPlace(transform);\r\n if (proxyOk) {\r\n transform.multiplyPoint3dArrayInPlace(this._options.fitPoints);\r\n if (this._options.startTangent)\r\n transform.multiplyVectorInPlace(this._options.startTangent);\r\n if (this._options.endTangent)\r\n transform.multiplyVectorInPlace(this._options.endTangent);\r\n }\r\n return proxyOk;\r\n }\r\n\r\n /** Return a deep clone */\r\n public override clone(): InterpolationCurve3d {\r\n return new InterpolationCurve3d(this._options.clone(), this._proxyCurve.clone());\r\n }\r\n\r\n public override isAlmostEqual(other: GeometryQuery): boolean {\r\n if (other instanceof InterpolationCurve3d) {\r\n return InterpolationCurve3dOptions.areAlmostEqual(this._options, other._options);\r\n }\r\n return false;\r\n }\r\n\r\n /** Test if `other` is also an [[InterpolationCurve3d]] */\r\n public isSameGeometryClass(other: GeometryQuery): boolean { return other instanceof InterpolationCurve3d; }\r\n\r\n}\r\n"]}
|
|
1
|
+
{"version":3,"file":"InterpolationCurve3d.js","sourceRoot":"","sources":["../../../src/bspline/InterpolationCurve3d.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAEH,mEAAkE;AAClE,0CAAuC;AACvC,6DAA0D;AAC1D,oDAAiD;AAEjD,gEAA6D;AAC7D,iDAAgD;AAkChD;;;;;GAKG;AACH,MAAa,2BAA2B;IACtC;;;;OAIG;IACH,YAAmB,SAAqB,EAAE,KAAgB;QACxD,IAAI,CAAC,UAAU,GAAG,SAAS,CAAC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------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module Bspline\r\n */\r\n\r\nimport { Point3d, Vector3d } from \"../geometry3d/Point3dVector3d\";\r\nimport { Geometry } from \"../Geometry\";\r\nimport { Point3dArray } from \"../geometry3d/PointHelpers\";\r\nimport { ProxyCurve } from \"../curve/ProxyCurve\";\r\nimport { CurvePrimitive } from \"../curve/CurvePrimitive\";\r\nimport { BSplineCurveOps } from \"../bspline/BSplineCurveOps\";\r\nimport { BSplineCurve3d } from \"./BSplineCurve\";\r\nimport { GeometryQuery } from \"../curve/GeometryQuery\";\r\nimport { Transform } from \"../geometry3d/Transform\";\r\nimport { GeometryHandler } from \"../geometry3d/GeometryHandler\";\r\nimport { XYZProps } from \"../geometry3d/XYZProps\";\r\n\r\n/**\r\n * fitPoints and end condition data for [[InterpolationCurve3d]]\r\n * * This is a \"json compatible\" version of [[InterpolationCurve3dOptions]]\r\n * @public\r\n */\r\nexport interface InterpolationCurve3dProps {\r\n /** order of the computed bspline (one more than degree) */\r\n order?: number;\r\n /** true if the B-spline construction should be periodic */\r\n closed?: boolean;\r\n /** if closed and no knots, compute chord length knots (1) or uniform knots (0). Chord length knots give best fit. */\r\n isChordLenKnots?: number;\r\n /** if !closed but first and last fitPoints are equal, pivot computed start/end tangent(s) so that they are colinear (1) or leave them be (0). */\r\n isColinearTangents?: number;\r\n /** if !closed and start/endTangent is given, set its magnitude to the first/last fit point chord length (1) or to the magnitude of the Bessel tangent (0). Bessel gives best fit. */\r\n isChordLenTangents?: number;\r\n /** if !closed and start/endTangent is absent, compute it using the natural end condition (1) or Bessel (0). Bessel gives best fit. */\r\n isNaturalTangents?: number;\r\n /** optional start tangent, pointing into curve. Magnitude is ignored. */\r\n startTangent?: XYZProps;\r\n /** optional end tangent, pointing into curve. Magnitude is ignored. */\r\n endTangent?: XYZProps;\r\n /** points that the curve must pass through */\r\n fitPoints: XYZProps[];\r\n /** parameters for curve fitting, one per fit point */\r\n knots?: number[];\r\n}\r\n\r\n/**\r\n * fitPoints and end condition data for [[InterpolationCurve3d]]\r\n * * This is a \"typed object\" version of the serializer-friendly [[InterpolationCurve3dProps]]\r\n * * Typical use cases rarely require all parameters, so the constructor does not itemize them as parameters.\r\n * @public\r\n */\r\nexport class InterpolationCurve3dOptions {\r\n /**\r\n * Constructor.\r\n * @param fitPoints points to CAPTURE\r\n * @param knots array to CAPTURE\r\n */\r\n public constructor(fitPoints?: Point3d[], knots?: number[]) {\r\n this._fitPoints = fitPoints ? fitPoints : [];\r\n this._knots = knots;\r\n }\r\n\r\n private _order?: number;\r\n private _closed?: boolean;\r\n private _isChordLenKnots?: number;\r\n private _isColinearTangents?: number;\r\n private _isChordLenTangents?: number;\r\n private _isNaturalTangents?: number;\r\n private _startTangent?: Vector3d;\r\n private _endTangent?: Vector3d;\r\n private _fitPoints: Point3d[];\r\n private _knots?: number[];\r\n\r\n /** `order` as property */\r\n public get order(): number { return Geometry.resolveNumber(this._order, 4); }\r\n public set order(val: number) { this._order = val; }\r\n /** `closed` as property */\r\n public get closed(): boolean { return Geometry.resolveValue(this._closed, false); }\r\n public set closed(val: boolean) { this._closed = val; }\r\n /** `isChordLenKnots` as property */\r\n public get isChordLenKnots(): number { return Geometry.resolveNumber(this._isChordLenKnots, 0); }\r\n public set isChordLenKnots(val: number) { this._isChordLenKnots = val; }\r\n /** `isColinearTangents` as property */\r\n public get isColinearTangents(): number { return Geometry.resolveNumber(this._isColinearTangents, 0); }\r\n public set isColinearTangents(val: number) { this._isColinearTangents = val; }\r\n /** `isChordLenTangents` as property */\r\n public get isChordLenTangents(): number { return Geometry.resolveNumber(this._isChordLenTangents, 0); }\r\n public set isChordLenTangents(val: number) { this._isChordLenTangents = val; }\r\n /** `isNaturalTangents` as property */\r\n public get isNaturalTangents(): number { return Geometry.resolveNumber(this._isNaturalTangents, 0); }\r\n public set isNaturalTangents(val: number) { this._isNaturalTangents = val; }\r\n /** access POSSIBLY UNDEFINED start tangent. Setter CAPTURES. */\r\n public get startTangent(): Vector3d | undefined { return this._startTangent; }\r\n public set startTangent(val: Vector3d | undefined) { this._startTangent = val; }\r\n /** access POSSIBLY UNDEFINED end tangent. Setter CAPTURES. */\r\n public get endTangent(): Vector3d | undefined { return this._endTangent; }\r\n public set endTangent(val: Vector3d | undefined) { this._endTangent = val; }\r\n /** access POINTER TO fit points. Setter CAPTURES. */\r\n public get fitPoints(): Point3d[] { return this._fitPoints; }\r\n public set fitPoints(val: Point3d[]) { this._fitPoints = val; }\r\n /** access POSSIBLY UNDEFINED knots array. Setter CAPTURES. */\r\n public get knots(): number[] | undefined { return this._knots; }\r\n public set knots(val: number[] | undefined) { this._knots = val; }\r\n\r\n /** One step setup of properties not named in constructor.\r\n * * CAPTURE pointers to tangents.\r\n * * OPTIONALLY downgrade \"0\" values to undefined.\r\n */\r\n public captureOptionalProps(\r\n order: number | undefined,\r\n closed: boolean | undefined,\r\n isChordLenKnots: number | undefined,\r\n isColinearTangents: number | undefined,\r\n isChordLenTangent: number | undefined,\r\n isNaturalTangents: number | undefined,\r\n startTangent: Vector3d | undefined,\r\n endTangent: Vector3d | undefined,\r\n ) {\r\n this._order = Geometry.resolveToUndefined(order, 0);\r\n this._closed = Geometry.resolveToUndefined(closed, false);\r\n this._isChordLenKnots = Geometry.resolveToUndefined(isChordLenKnots, 0);\r\n this._isColinearTangents = Geometry.resolveToUndefined(isColinearTangents, 0);\r\n this._isChordLenTangents = Geometry.resolveToUndefined(isChordLenTangent, 0);\r\n this._isNaturalTangents = Geometry.resolveToUndefined(isNaturalTangents, 0);\r\n this._startTangent = startTangent;\r\n this._endTangent = endTangent;\r\n\r\n }\r\n /** Clone with strongly typed members reduced to simple json, with \"undefined\" members omitted */\r\n public cloneAsInterpolationCurve3dProps(): InterpolationCurve3dProps {\r\n const props: InterpolationCurve3dProps = {\r\n fitPoints: Point3dArray.cloneDeepJSONNumberArrays(this.fitPoints),\r\n knots: this._knots?.slice(),\r\n };\r\n if (this._order !== undefined)\r\n props.order = this._order;\r\n if (this._closed !== undefined)\r\n props.closed = this._closed;\r\n if (this._isChordLenKnots !== undefined)\r\n props.isChordLenKnots = this._isChordLenKnots;\r\n if (this._isColinearTangents !== undefined)\r\n props.isColinearTangents = this._isColinearTangents;\r\n if (this._isChordLenTangents !== undefined)\r\n props.isChordLenTangents = this._isChordLenTangents;\r\n if (this._isNaturalTangents !== undefined)\r\n props.isNaturalTangents = this._isNaturalTangents;\r\n if (this._startTangent !== undefined)\r\n props.startTangent = this._startTangent?.toArray();\r\n if (this._endTangent !== undefined)\r\n props.endTangent = this._endTangent?.toArray();\r\n return props;\r\n }\r\n /** Clone with strongly typed members reduced to simple json. */\r\n public clone(): InterpolationCurve3dOptions {\r\n const clone = new InterpolationCurve3dOptions(Point3dArray.clonePoint3dArray(this.fitPoints), this.knots?.slice());\r\n clone._order = this.order;\r\n clone._closed = this.closed;\r\n clone._isChordLenKnots = this.isChordLenKnots;\r\n clone._isColinearTangents = this.isColinearTangents;\r\n clone._isChordLenTangents = this.isChordLenTangents;\r\n clone._isNaturalTangents = this.isNaturalTangents;\r\n clone._startTangent = this._startTangent?.clone();\r\n clone._endTangent = this._endTangent?.clone();\r\n return clone;\r\n }\r\n\r\n /** Clone with strongly typed members reduced to simple json. */\r\n public static create(source: InterpolationCurve3dProps): InterpolationCurve3dOptions {\r\n const result = new InterpolationCurve3dOptions(Point3dArray.clonePoint3dArray(source.fitPoints), source.knots?.slice());\r\n result._order = source.order;\r\n result._closed = source.closed;\r\n result._isChordLenKnots = source.isChordLenKnots;\r\n result._isColinearTangents = source.isColinearTangents;\r\n result._isChordLenTangents = source.isChordLenTangents;\r\n result._isNaturalTangents = source.isNaturalTangents;\r\n result._startTangent = source.startTangent ? Vector3d.fromJSON(source.startTangent) : undefined;\r\n result._endTangent = source.endTangent ? Vector3d.fromJSON(source.endTangent) : undefined;\r\n return result;\r\n }\r\n // ugh.\r\n // vector equality test with awkward rule that 000 matches undefined.\r\n private static areAlmostEqualAllow000AsUndefined(a: Vector3d | undefined, b: Vector3d | undefined): boolean {\r\n if (a !== undefined && a.maxAbs() === 0)\r\n a = undefined;\r\n if (b !== undefined && b.maxAbs() === 0)\r\n b = undefined;\r\n if (a !== undefined && b !== undefined)\r\n return a.isAlmostEqual(b);\r\n return a === undefined && b === undefined;\r\n }\r\n public static areAlmostEqual(dataA: InterpolationCurve3dOptions | undefined, dataB: InterpolationCurve3dOptions | undefined): boolean {\r\n if (dataA === undefined && dataB === undefined)\r\n return true;\r\n if (dataA !== undefined && dataB !== undefined) {\r\n if (Geometry.areEqualAllowUndefined(dataA.order, dataB.order)\r\n && Geometry.areEqualAllowUndefined(dataA.closed, dataB.closed)\r\n && Geometry.areEqualAllowUndefined(dataA.isChordLenKnots, dataB.isChordLenKnots)\r\n && Geometry.areEqualAllowUndefined(dataA.isColinearTangents, dataB.isColinearTangents)\r\n && Geometry.areEqualAllowUndefined(dataA.isNaturalTangents, dataB.isNaturalTangents)\r\n && this.areAlmostEqualAllow000AsUndefined(dataA.startTangent, dataB.startTangent)\r\n && this.areAlmostEqualAllow000AsUndefined(dataA.endTangent, dataB.endTangent)\r\n && Geometry.almostEqualArrays(dataA.fitPoints, dataB.fitPoints, (a: Point3d, b: Point3d) => a.isAlmostEqual(b))) {\r\n if (Geometry.almostEqualNumberArrays(dataA.knots, dataB.knots, (a: number, b: number) => a === b))\r\n return true;\r\n if (dataA.knots === undefined && dataB.knots === undefined)\r\n return true;\r\n /* alas .. need to allow tricky mismatch of end replication */\r\n let knotsA = dataA.knots, knotsB = dataB.knots;\r\n if (dataA.knots === undefined) // construct undefined knots to compare against defined knots\r\n knotsA = BSplineCurveOps.C2CubicFit.constructFitParametersFromPoints(dataA.fitPoints, dataA.isChordLenKnots, dataA.closed);\r\n else if (dataB.knots === undefined)\r\n knotsB = BSplineCurveOps.C2CubicFit.constructFitParametersFromPoints(dataB.fitPoints, dataB.isChordLenKnots, dataB.closed);\r\n knotsA = BSplineCurveOps.C2CubicFit.convertCubicKnotVectorToFitParams(knotsA, dataA.fitPoints.length, false);\r\n knotsB = BSplineCurveOps.C2CubicFit.convertCubicKnotVectorToFitParams(knotsB, dataB.fitPoints.length, false);\r\n return Geometry.almostEqualNumberArrays(knotsA, knotsB, (a: number, b: number) => Geometry.isAlmostEqualNumber(a, b));\r\n }\r\n }\r\n return false;\r\n }\r\n /** reverse the order or sense of all start-to-end related properties. */\r\n public reverseInPlace() {\r\n this.fitPoints.reverse();\r\n if (this.knots)\r\n this.knots.reverse();\r\n // Swap pointers to tangents. They don't need to be negated because they point into the curve.\r\n const oldStart = this._startTangent;\r\n this._startTangent = this.endTangent;\r\n this._endTangent = oldStart;\r\n }\r\n}\r\n\r\n/**\r\n * Interpolating curve.\r\n * * Derive from [[ProxyCurve]]\r\n * * Use a [[BSplineCurve3d]] as the proxy\r\n * *\r\n * @public\r\n */\r\nexport class InterpolationCurve3d extends ProxyCurve {\r\n public readonly curvePrimitiveType = \"interpolationCurve\";\r\n private _options: InterpolationCurve3dOptions;\r\n /**\r\n * CAPTURE properties and proxy curve.\r\n */\r\n private constructor(properties: InterpolationCurve3dOptions, proxyCurve: CurvePrimitive) {\r\n super(proxyCurve);\r\n this._options = properties;\r\n }\r\n\r\n public override dispatchToGeometryHandler(handler: GeometryHandler): any {\r\n let result = handler.handleInterpolationCurve3d(this);\r\n if (undefined === result) // if handler doesn't specialize on interpolation curves, default to proxy\r\n result = this._proxyCurve.dispatchToGeometryHandler(handler);\r\n return result;\r\n }\r\n /**\r\n * Create an [[InterpolationCurve3d]] based on points, knots, and other properties in the [[InterpolationCurve3dProps]] or [[InterpolationCurve3dOptions]].\r\n * * This saves a COPY OF the options or props.\r\n * * Use createCapture () if the options or props can be used without copy\r\n */\r\n public static create(options: InterpolationCurve3dOptions | InterpolationCurve3dProps): InterpolationCurve3d | undefined {\r\n let optionsCopy;\r\n if (options instanceof InterpolationCurve3dOptions) {\r\n optionsCopy = options.clone();\r\n } else {\r\n optionsCopy = InterpolationCurve3dOptions.create(options);\r\n }\r\n return InterpolationCurve3d.createCapture(optionsCopy);\r\n }\r\n /** Create an [[InterpolationCurve3d]]\r\n * * The options object is captured into the new curve object (not copied)\r\n */\r\n public static createCapture(options: InterpolationCurve3dOptions): InterpolationCurve3d | undefined {\r\n const proxyCurve = BSplineCurve3d.createFromInterpolationCurve3dOptions(options);\r\n if (proxyCurve)\r\n return new InterpolationCurve3d(options, proxyCurve);\r\n return undefined;\r\n }\r\n /** Return a (copy of) the defining points, packed as a Float64Array */\r\n public copyFitPointsFloat64Array(): Float64Array {\r\n return Point3dArray.cloneXYZPropsAsFloat64Array(this._options.fitPoints);\r\n }\r\n\r\n /**\r\n * Return json key-value pairs for for this [[InterpolationCurve3d]].\r\n * @returns\r\n */\r\n public toJSON(): any {\r\n return this._options.cloneAsInterpolationCurve3dProps();\r\n }\r\n /** Clone the [[InterpolationCurve3dProps]] object in this [[InterpolationCurve3d]] */\r\n public cloneProps(): InterpolationCurve3dProps {\r\n return this._options.cloneAsInterpolationCurve3dProps();\r\n }\r\n\r\n /** return the options pointer */\r\n public get options(): InterpolationCurve3dOptions { return this._options; }\r\n\r\n /**\r\n * Reverse the curve direction.\r\n * * This updates both the defining properties and the proxy bspline.\r\n */\r\n public reverseInPlace(): void {\r\n this._proxyCurve.reverseInPlace();\r\n this._options.reverseInPlace();\r\n }\r\n /**\r\n * Transform this [[InterpolationCurve3d]] and its defining data in place\r\n */\r\n public tryTransformInPlace(transform: Transform): boolean {\r\n const proxyOk = this._proxyCurve.tryTransformInPlace(transform);\r\n if (proxyOk) {\r\n transform.multiplyPoint3dArrayInPlace(this._options.fitPoints);\r\n if (this._options.startTangent)\r\n transform.multiplyVectorInPlace(this._options.startTangent);\r\n if (this._options.endTangent)\r\n transform.multiplyVectorInPlace(this._options.endTangent);\r\n }\r\n return proxyOk;\r\n }\r\n\r\n /** Return a deep clone */\r\n public override clone(): InterpolationCurve3d {\r\n return new InterpolationCurve3d(this._options.clone(), this._proxyCurve.clone());\r\n }\r\n\r\n public override isAlmostEqual(other: GeometryQuery): boolean {\r\n if (other instanceof InterpolationCurve3d) {\r\n return InterpolationCurve3dOptions.areAlmostEqual(this._options, other._options);\r\n }\r\n return false;\r\n }\r\n\r\n /** Test if `other` is also an [[InterpolationCurve3d]] */\r\n public isSameGeometryClass(other: GeometryQuery): boolean { return other instanceof InterpolationCurve3d; }\r\n\r\n}\r\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ClipUtils.js","sourceRoot":"","sources":["../../../src/clipping/ClipUtils.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAGH,wDAAqD;AAGrD,wDAAqD;AACrD,wCAAqC;AACrC,0CAAuC;AAEvC,qEAAkE;AAGlE,2EAAwE;AACxE,mEAAkE;AAClE,+CAAuD;AACvD,2EAA0E;AAG1E,iEAA8D;AAC9D,2CAAwC;AACxC,mDAAgD;AAChD,6CAA0C;AAC1C,6DAA0D;AAC1D,sGAAmG;AACnG,6EAA0E;AAE1E;;GAEG;AACH,IAAY,oBAOX;AAPD,WAAY,oBAAoB;IAC9B,wBAAwB;IACxB,mFAAkB,CAAA;IAClB,oCAAoC;IACpC,yEAAa,CAAA;IACb,yBAAyB;IACzB,qFAAmB,CAAA;AACrB,CAAC,EAPW,oBAAoB,GAApB,4BAAoB,KAApB,4BAAoB,QAO/B;AACD;;;GAGG;AACH,IAAY,cAOT;AAPH,WAAY,cAAc;IACxB,2DAA2D;IAC3D,2DAAY,CAAA;IACZ,4DAA4D;IAC5D,8DAAc,CAAA;IAChB,6CAA6C;IAC3C,uEAAkB,CAAA;AAClB,CAAC,EAPS,cAAc,GAAd,sBAAc,KAAd,sBAAc,QAOvB;AAEH;;GAEG;AACH,IAAY,UAOX;AAPD,WAAY,UAAU;IACpB,kDAAkD;IAClD,2DAAY,CAAA;IACZ,kCAAkC;IACl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CAAC,mBAAmB,CAAC,MAAM,CAAC,CAAC;yBAC5C;qBACF;iBACF;aACF;SACF;QACD,OAAO,uDAA0B,CAAC,gBAAgB,CAAC,WAAW,CAAC,CAAC;IAClE,CAAC;;AA7vBc,yCAA2B,GAAG,yBAAO,CAAC,MAAM,EAAE,CAAC;AANnD,sCAAa;AAqwB1B,SAAS,aAAa,CACpB,SAA6B,EAC7B,WAA2C,EAC3C,UAAiC;IACjC,IAAI,WAAW,KAAK,SAAS;QAC3B,UAAU,CAAC,cAAc,CAAC,SAAS,CAAC,CAAC;SAClC;QACH,KAAK,MAAM,CAAC,IAAI,SAAS;YACvB,WAAW,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;KACvB;IACD,SAAS,CAAC,MAAM,GAAG,CAAC,CAAC;AACvB,CAAC;AACD;;;;;;;;;GASG;AACH,SAAS,mBAAmB,CAC1B,MAAsB,EACtB,SAA6B,EAC7B,UAA0C,EAC1C,WAA2C,EAC3C,cAA8C,EAC9C,UAAiC;IACjC,IAAI,WAAW,CAAC;IAChB,IAAI,MAAM,KAAK,cAAc,CAAC,QAAQ;QACpC,WAAW,GAAG,UAAU,CAAC;SACtB,IAAI,MAAM,KAAK,cAAc,CAAC,SAAS;QAC1C,WAAW,GAAG,WAAW,CAAC;SACvB,IAAI,MAAM,KAAK,cAAc,CAAC,cAAc;QAC/C,WAAW,GAAG,cAAc,CAAC;IACjC,4EAA4E;IAC1E,IAAI,WAAW,KAAK,SAAS;QAC3B,UAAU,CAAC,cAAc,CAAC,SAAS,CAAC,CAAC;SAClC;QACH,KAAK,MAAM,CAAC,IAAI,SAAS;YACvB,WAAW,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;KACvB;IACD,SAAS,CAAC,MAAM,GAAG,CAAC,CAAC;AACvB,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module CartesianGeometry\r\n */\r\n\r\nimport { Arc3d } from \"../curve/Arc3d\";\r\nimport { CurveFactory } from \"../curve/CurveFactory\";\r\nimport { AnnounceNumberNumber, AnnounceNumberNumberCurvePrimitive, CurvePrimitive } from \"../curve/CurvePrimitive\";\r\nimport { GeometryQuery } from \"../curve/GeometryQuery\";\r\nimport { LineString3d } from \"../curve/LineString3d\";\r\nimport { Loop } from \"../curve/Loop\";\r\nimport { Geometry } from \"../Geometry\";\r\nimport { GrowableFloat64Array } from \"../geometry3d/GrowableFloat64Array\";\r\nimport { GrowableXYZArray } from \"../geometry3d/GrowableXYZArray\";\r\nimport { IndexedXYZCollection } from \"../geometry3d/IndexedXYZCollection\";\r\nimport { Plane3dByOriginAndUnitNormal } from \"../geometry3d/Plane3dByOriginAndUnitNormal\";\r\nimport { Point3dArrayCarrier } from \"../geometry3d/Point3dArrayCarrier\";\r\nimport { Point3d, Vector3d } from \"../geometry3d/Point3dVector3d\";\r\nimport { Range1d, Range3d } from \"../geometry3d/Range\";\r\nimport { GrowableXYZArrayCache } from \"../geometry3d/ReusableObjectCache\";\r\nimport { Transform } from \"../geometry3d/Transform\";\r\nimport { XAndY } from \"../geometry3d/XYZProps\";\r\nimport { PolyfaceBuilder } from \"../polyface/PolyfaceBuilder\";\r\nimport { ClipPlane } from \"./ClipPlane\";\r\nimport { ClipPrimitive } from \"./ClipPrimitive\";\r\nimport { ClipVector } from \"./ClipVector\";\r\nimport { ConvexClipPlaneSet } from \"./ConvexClipPlaneSet\";\r\nimport { LineStringOffsetClipperContext } from \"./internalContexts/LineStringOffsetClipperContext\";\r\nimport { UnionOfConvexClipPlaneSets } from \"./UnionOfConvexClipPlaneSets\";\r\n\r\n/** Enumerated type for describing where geometry lies with respect to clipping planes.\r\n * @public\r\n */\r\nexport enum ClipPlaneContainment {\r\n /** All points inside */\r\n StronglyInside = 1,\r\n /** Inside/outside state unknown. */\r\n Ambiguous = 2,\r\n /** All points outside */\r\n StronglyOutside = 3,\r\n}\r\n/**\r\n * Enumeration of ways to handle an intermediate fragment from a clipping step\r\n * @public\r\n */\r\nexport enum ClipStepAction {\r\n /** Pass fragments directly to final accepted \"in\" state */\r\n acceptIn = 1,\r\n /** Pass fragments directly to final accepted \"out\" state */\r\n acceptOut = -1,\r\n/** forward fragments to subsequent steps. */\r\n passToNextStep = 0\r\n }\r\n\r\n/** Enumerated type for describing what must yet be done to clip a piece of geometry.\r\n * @public\r\n */\r\nexport enum ClipStatus {\r\n /** some geometry may cross the clip boundaries */\r\n ClipRequired,\r\n /** geometry is clearly outside */\r\n TrivialReject,\r\n /** geometry is clearly inside */\r\n TrivialAccept,\r\n}\r\n\r\n/** An object containing clipping planes that can be used to clip geometry.\r\n * @public\r\n */\r\nexport interface Clipper {\r\n /** test if `point` is on or inside the Clipper's volume. */\r\n isPointOnOrInside(point: Point3d, tolerance?: number): boolean;\r\n /** Find the parts of the line segment (if any) that is within the convex clip volume.\r\n * * The input fractional interval from fraction0 to fraction1 (increasing!!) is the active part to consider.\r\n * * To clip to the usual bounded line segment, start with fractions (0,1).\r\n * If the clip volume is unbounded, the line interval may also be unbounded.\r\n * * An unbounded line portion will have fraction coordinates positive or negative Number.MAX_VALUE.\r\n * @param f0 fraction that is the initial lower fraction of the active interval. (e.g. 0.0 for bounded segment)\r\n * @param f1 fraction that is the initial upper fraction of the active interval. (e.g. 1.0 for bounded segment)\r\n * @param pointA segment start (fraction 0)\r\n * @param pointB segment end (fraction 1)\r\n * @param announce function to be called to announce a fraction interval that is within the convex clip volume.\r\n * @returns true if a segment was announced, false if entirely outside.\r\n */\r\n announceClippedSegmentIntervals(f0: number, f1: number, pointA: Point3d, pointB: Point3d, announce?: AnnounceNumberNumber): boolean;\r\n /** Find the portion (or portions) of the arc (if any) that are within the convex clip volume.\r\n * * The input fractional interval from fraction0 to fraction1 (increasing!!) is the active part to consider.\r\n * @param announce function to be called to announce a fraction interval that is within the convex clip volume.\r\n * @returns true if one or more arcs portions were announced, false if entirely outside.\r\n */\r\n announceClippedArcIntervals(arc: Arc3d, announce?: AnnounceNumberNumberCurvePrimitive): boolean;\r\n/** Optional polygon clip method.\r\n * * This is expected to be implemented by planar clip structures.\r\n * * This is unimplemented for curve clippers (e.g. sphere) for which polygon clip result has\r\n * curved edges.\r\n */\r\n appendPolygonClip?: AppendPolygonClipFunction;\r\n}\r\n /**\r\n * Signature of method to execute polygon clip, distributing fragments of xyz among insideFragments and outsideFragments\r\n * @param xyz input polygon. This is not changed.\r\n * @param insideFragments Array to receive \"inside\" fragments. Each fragment is a GrowableXYZArray grabbed from the cache. This is NOT cleared.\r\n * @param outsideFragments Array to receive \"outside\" fragments. Each fragment is a GrowableXYZArray grabbed from the cache. This is NOT cleared.\r\n * @param arrayCache cache for reusable GrowableXYZArray.\r\n */\r\n type AppendPolygonClipFunction = (\r\n xyz: GrowableXYZArray,\r\n insideFragments: GrowableXYZArray[],\r\n outsideFragments: GrowableXYZArray[],\r\n arrayCache: GrowableXYZArrayCache) => void;\r\n\r\n/**\r\n * Interface for clipping polygons.\r\n * Supported by:\r\n * * AlternatingCCTreeNode\r\n * * ConvexClipPlaneSet\r\n * @public\r\n */\r\nexport interface PolygonClipper {\r\n appendPolygonClip: AppendPolygonClipFunction;\r\n}\r\n/** Class whose various static methods are functions for clipping geometry\r\n * @public\r\n */\r\nexport class ClipUtilities {\r\n // on-demand scratch objects for method implementations. If you use one, make sure it isn't already being used in scope.\r\n private static _workTransform?: Transform;\r\n private static _workRange?: Range3d;\r\n private static _workClipper?: ConvexClipPlaneSet;\r\n\r\n private static _selectIntervals01TestPoint = Point3d.create();\r\n /**\r\n * * Augment the unsortedFractionsArray with 0 and 1\r\n * * sort\r\n * * test the midpoint of each interval with `clipper.isPointOnOrInside`\r\n * * pass accepted intervals to `announce(f0,f1,curve)`\r\n */\r\n public static selectIntervals01(curve: CurvePrimitive, unsortedFractions: GrowableFloat64Array, clipper: Clipper, announce?: AnnounceNumberNumberCurvePrimitive): boolean {\r\n unsortedFractions.push(0);\r\n unsortedFractions.push(1);\r\n unsortedFractions.sort();\r\n let f0 = unsortedFractions.atUncheckedIndex(0);\r\n let f1;\r\n let fMid;\r\n const testPoint = ClipUtilities._selectIntervals01TestPoint;\r\n const n = unsortedFractions.length;\r\n for (let i = 1; i < n; i++) {\r\n f1 = unsortedFractions.atUncheckedIndex(i);\r\n if (f1 > f0 + Geometry.smallFraction) {\r\n fMid = 0.5 * (f0 + f1);\r\n if (fMid >= 0.0 && fMid <= 1.0) {\r\n curve.fractionToPoint(fMid, testPoint);\r\n if (clipper.isPointOnOrInside(testPoint)) {\r\n if (announce)\r\n announce(f0, f1, curve);\r\n else\r\n return true;\r\n }\r\n }\r\n f0 = f1;\r\n }\r\n }\r\n return false;\r\n }\r\n /**\r\n * Announce triples of (low, high, cp) for each entry in intervals\r\n * @param intervals source array\r\n * @param cp CurvePrimitive for announcement\r\n * @param announce function to receive data\r\n */\r\n public static announceNNC(intervals: Range1d[], cp: CurvePrimitive, announce?: AnnounceNumberNumberCurvePrimitive): boolean {\r\n if (announce) {\r\n for (const ab of intervals) {\r\n announce(ab.low, ab.high, cp);\r\n }\r\n }\r\n return intervals.length > 0;\r\n }\r\n\r\n /** Find portions of the curve that are within the clipper.\r\n * Collect them into an array of curve primitives.\r\n */\r\n public static collectClippedCurves(curve: CurvePrimitive, clipper: Clipper): CurvePrimitive[] {\r\n const result: CurvePrimitive[] = [];\r\n curve.announceClipIntervals(clipper,\r\n (fraction0: number, fraction1: number, curveA: CurvePrimitive) => {\r\n if (fraction1 !== fraction0) {\r\n const partialCurve = curveA.clonePartialCurve(fraction0, fraction1);\r\n if (partialCurve)\r\n result.push(partialCurve);\r\n }\r\n });\r\n return result;\r\n }\r\n\r\n /**\r\n * Clip a polygon down to regions defined by each shape of a ClipShape.\r\n * @return An multidimensional array of points, where each array is the boundary of part of the remaining polygon.\r\n */\r\n public static clipPolygonToClipShape(polygon: Point3d[], clipShape: ClipPrimitive): Point3d[][] {\r\n const outputA = this.clipPolygonToClipShapeReturnGrowableXYZArrays(polygon, clipShape);\r\n const output = [];\r\n for (const g of outputA)\r\n output.push(g.getPoint3dArray());\r\n return output;\r\n }\r\n\r\n /**\r\n * Clip a polygon down to regions defined by each shape of a ClipShape.\r\n * @return An multidimensional array of points, where each array is the boundary of part of the remaining polygon.\r\n */\r\n public static clipPolygonToClipShapeReturnGrowableXYZArrays(polygon: Point3d[], clipShape: ClipPrimitive): GrowableXYZArray[] {\r\n const output: GrowableXYZArray[] = [];\r\n const clipper = clipShape.fetchClipPlanesRef();\r\n // NEEDS WORK -- what if it is a mask !!!!\r\n if (clipper) {\r\n clipper.polygonClip(polygon, output);\r\n }\r\n return output;\r\n }\r\n\r\n /** Given an array of points, test for trivial containment conditions.\r\n * * ClipStatus.TrivialAccept if all points are in any one of the convexSet's.\r\n * * ClipStatus.ClipRequired if (in any single convexSet) there were points on both sides of any single plane.\r\n * * ClipStatus.TrivialReject if neither of those occurred.\r\n */\r\n public static pointSetSingleClipStatus(points: GrowableXYZArray, planeSet: UnionOfConvexClipPlaneSets, tolerance: number): ClipStatus {\r\n if (planeSet.convexSets.length === 0)\r\n return ClipStatus.TrivialAccept;\r\n\r\n for (const convexSet of planeSet.convexSets) {\r\n let allOutsideSinglePlane = false, anyOutside = false;\r\n\r\n for (const plane of convexSet.planes) {\r\n let numInside = 0, numOutside = 0;\r\n const planeDistance = plane.distance - tolerance;\r\n\r\n const currPt = Point3d.create();\r\n const currVec = Vector3d.create();\r\n for (let i = 0; i < points.length; i++) {\r\n points.getPoint3dAtUncheckedPointIndex(i, currPt);\r\n currVec.setFrom(currPt);\r\n currVec.dotProduct(plane.inwardNormalRef) > planeDistance ? numInside++ : numOutside++;\r\n }\r\n\r\n anyOutside = (numOutside !== 0) ? true : anyOutside;\r\n if (numInside === 0) {\r\n allOutsideSinglePlane = true;\r\n break;\r\n }\r\n }\r\n\r\n if (!anyOutside) // totally inside this set - no clip required\r\n return ClipStatus.TrivialAccept;\r\n if (!allOutsideSinglePlane)\r\n return ClipStatus.ClipRequired;\r\n }\r\n return ClipStatus.TrivialReject;\r\n }\r\n\r\n /**\r\n * Emit point loops for intersection of a convex set with a range.\r\n * * return zero length array for (a) null range or (b) no intersections\r\n * @param range range to intersect\r\n * @param includeConvexSetFaces if false, do not compute facets originating as convex set planes.\r\n * @param includeRangeFaces if false, do not compute facets originating as range faces\r\n * @param ignoreInvisiblePlanes if true, do NOT compute a facet for convex set faces marked invisible.\r\n */\r\n public static announceLoopsOfConvexClipPlaneSetIntersectRange(convexSet: ConvexClipPlaneSet | ClipPlane, range: Range3d, loopFunction: (loopPoints: GrowableXYZArray) => void,\r\n includeConvexSetFaces: boolean = true, includeRangeFaces: boolean = true, ignoreInvisiblePlanes = false) {\r\n const work = new GrowableXYZArray();\r\n if (includeConvexSetFaces) {\r\n // Clip convexSet planes to the range and to the rest of the convexSet . .\r\n if (convexSet instanceof ConvexClipPlaneSet) {\r\n for (const plane of convexSet.planes) {\r\n if (ignoreInvisiblePlanes && plane.invisible)\r\n continue;\r\n const pointsClippedToRange = plane.intersectRange(range, true);\r\n const finalPoints = new GrowableXYZArray();\r\n if (pointsClippedToRange) {\r\n convexSet.polygonClip(pointsClippedToRange, finalPoints, work, plane);\r\n if (finalPoints.length > 0)\r\n loopFunction(finalPoints);\r\n }\r\n }\r\n } else { // `convexSet` is just one plane ...\r\n if (ignoreInvisiblePlanes && convexSet.invisible) {\r\n // skip it !\r\n } else {\r\n const pointsClippedToRange = convexSet.intersectRange(range, true);\r\n if (pointsClippedToRange)\r\n loopFunction(pointsClippedToRange);\r\n }\r\n }\r\n }\r\n\r\n if (includeRangeFaces) {\r\n // clip range faces to the convex set . . .\r\n const corners = range.corners();\r\n for (let i = 0; i < 6; i++) {\r\n const indices = Range3d.faceCornerIndices(i);\r\n const finalPoints = new GrowableXYZArray();\r\n const lineString = LineString3d.createIndexedPoints(corners, indices);\r\n if (convexSet instanceof ConvexClipPlaneSet) {\r\n convexSet.polygonClip(lineString.packedPoints, finalPoints, work);\r\n if (finalPoints.length > 0)\r\n loopFunction(finalPoints);\r\n } else {\r\n convexSet.clipConvexPolygonInPlace(lineString.packedPoints, work);\r\n if (lineString.packedPoints.length > 0)\r\n loopFunction(lineString.packedPoints);\r\n }\r\n }\r\n }\r\n }\r\n\r\n /**\r\n * Return a (possibly empty) array of geometry (Loops !!) which are facets of the intersection of the convex set intersecting a range.\r\n * * return zero length array for (a) null range or (b) no intersections\r\n * @param allClippers convex or union clipper\r\n * @param range range to intersect\r\n * @param includeConvexSetFaces if false, do not compute facets originating as convex set planes.\r\n * @param includeRangeFaces if false, do not compute facets originating as range faces\r\n * @param ignoreInvisiblePlanes if true, do NOT compute a facet for convex set faces marked invisible.\r\n */\r\n public static loopsOfConvexClipPlaneIntersectionWithRange(allClippers: ConvexClipPlaneSet | UnionOfConvexClipPlaneSets | ClipPlane, range: Range3d,\r\n includeConvexSetFaces: boolean = true, includeRangeFaces: boolean = true, ignoreInvisiblePlanes = false): GeometryQuery[] {\r\n const result: GeometryQuery[] = [];\r\n if (allClippers instanceof UnionOfConvexClipPlaneSets) {\r\n for (const clipper of allClippers.convexSets) {\r\n this.announceLoopsOfConvexClipPlaneSetIntersectRange(clipper, range,\r\n (points: GrowableXYZArray) => {\r\n if (points.length > 0) result.push(Loop.createPolygon(points));\r\n },\r\n includeConvexSetFaces, includeRangeFaces, ignoreInvisiblePlanes);\r\n }\r\n } else if (allClippers instanceof ConvexClipPlaneSet || allClippers instanceof ClipPlane) {\r\n this.announceLoopsOfConvexClipPlaneSetIntersectRange(allClippers, range,\r\n (points: GrowableXYZArray) => {\r\n if (points.length > 0) result.push(Loop.createPolygon(points));\r\n },\r\n includeConvexSetFaces, includeRangeFaces, ignoreInvisiblePlanes);\r\n }\r\n return result;\r\n }\r\n /**\r\n * Return the (possibly null) range of the intersection of the convex set with a range.\r\n * * The convex set is permitted to be unbounded (e.g. a single plane). The range parameter provides bounds.\r\n * @param convexSet convex set for intersection.\r\n * @param range range to intersect\r\n */\r\n public static rangeOfConvexClipPlaneSetIntersectionWithRange(convexSet: ConvexClipPlaneSet, range: Range3d): Range3d {\r\n const result = Range3d.createNull();\r\n this.announceLoopsOfConvexClipPlaneSetIntersectRange(convexSet, range,\r\n (points: GrowableXYZArray) => {\r\n if (points.length > 0) result.extendArray(points);\r\n },\r\n true, true, false);\r\n return result;\r\n }\r\n /**\r\n * Return the range of various types of clippers\r\n * * `ConvexClipPlaneSet` -- dispatch to `rangeOfConvexClipPlaneSetIntersectionWithRange`\r\n * * `UnionOfConvexClipPlaneSet` -- union of ranges of member `ConvexClipPlaneSet`\r\n * * `ClipPrimitive` -- access its `UnionOfConvexClipPlaneSet`.\r\n * * `ClipVector` -- intersection of the ranges of its `ClipPrimitive`.\r\n * * `undefined` -- entire input range.\r\n * * If `observeInvisibleFlag` is false, the \"invisible\" properties are ignored, and this effectively returns the range of the edge work of the members\r\n * * If `observeInvisibleFlag` is true, the \"invisible\" properties are observed, and \"invisible\" parts do not restrict the range.\r\n * @param clipper\r\n * @param range non-null range.\r\n * @param observeInvisibleFlag indicates how \"invisible\" bit is applied for ClipPrimitive.\r\n */\r\n public static rangeOfClipperIntersectionWithRange(clipper: ConvexClipPlaneSet | UnionOfConvexClipPlaneSets | ClipPrimitive | ClipVector | undefined, range: Range3d, observeInvisibleFlag: boolean = true): Range3d {\r\n if (clipper === undefined)\r\n return range.clone();\r\n if (clipper instanceof ConvexClipPlaneSet)\r\n return this.rangeOfConvexClipPlaneSetIntersectionWithRange(clipper, range);\r\n if (clipper instanceof UnionOfConvexClipPlaneSets) {\r\n const rangeUnion = Range3d.createNull();\r\n for (const c of clipper.convexSets) {\r\n const rangeC = this.rangeOfConvexClipPlaneSetIntersectionWithRange(c, range);\r\n rangeUnion.extendRange(rangeC);\r\n }\r\n return rangeUnion;\r\n }\r\n if (clipper instanceof ClipPrimitive) {\r\n if (observeInvisibleFlag && clipper.invisible)\r\n return range.clone();\r\n return this.rangeOfClipperIntersectionWithRange(clipper.fetchClipPlanesRef(), range);\r\n }\r\n if (clipper instanceof ClipVector) {\r\n const rangeIntersection = range.clone();\r\n for (const c of clipper.clips) {\r\n if (observeInvisibleFlag && c.invisible) {\r\n // trivial range tests do not expose the effects. Assume the hole allows everything.\r\n } else {\r\n const rangeC = this.rangeOfClipperIntersectionWithRange(c, range, observeInvisibleFlag);\r\n rangeIntersection.intersect(rangeC, rangeIntersection);\r\n }\r\n }\r\n return rangeIntersection;\r\n\r\n }\r\n return range.clone();\r\n }\r\n /**\r\n * Test if various types of clippers have any intersection with a range.\r\n * * This follows the same logic as `rangeOfClipperIntersectionWithRange` but attempts to exit at earliest point of confirmed intersection\r\n * * `ConvexClipPlaneSet` -- dispatch to `doesConvexClipPlaneSetIntersectRange`\r\n * * `UnionOfConvexClipPlaneSet` -- union of ranges of member `ConvexClipPlaneSet`\r\n * * `ClipPrimitive` -- access its `UnionOfConvexClipPlaneSet`.\r\n * * `ClipVector` -- intersection of the ranges of its `ClipPrimitive`.\r\n * * `undefined` -- entire input range.\r\n * * If `observeInvisibleFlag` is false, the \"invisible\" properties are ignored, and holes do not affect the result.\r\n * * If `observeInvisibleFlag` is true, the \"invisible\" properties are observed, and may affect the result.\r\n * @param clipper\r\n * @param range non-null range.\r\n * @param observeInvisibleFlag indicates how \"invisible\" bit is applied for ClipPrimitive.\r\n */\r\n public static doesClipperIntersectRange(clipper: ConvexClipPlaneSet | UnionOfConvexClipPlaneSets | ClipPrimitive | ClipVector | undefined, range: Range3d, observeInvisibleFlag: boolean = true): boolean {\r\n if (clipper === undefined)\r\n return true;\r\n\r\n if (clipper instanceof ConvexClipPlaneSet)\r\n return this.doesConvexClipPlaneSetIntersectRange(clipper, range);\r\n\r\n if (clipper instanceof UnionOfConvexClipPlaneSets) {\r\n for (const c of clipper.convexSets) {\r\n if (this.doesConvexClipPlaneSetIntersectRange(c, range))\r\n return true;\r\n }\r\n return false;\r\n }\r\n\r\n if (clipper instanceof ClipPrimitive) {\r\n if (observeInvisibleFlag && clipper.invisible) // um is there an easy way to detect range-completely-inside?\r\n return true;\r\n return this.doesClipperIntersectRange(clipper.fetchClipPlanesRef(), range);\r\n }\r\n\r\n if (clipper instanceof ClipVector) {\r\n const rangeIntersection = range.clone();\r\n for (const c of clipper.clips) {\r\n if (observeInvisibleFlag && c.invisible) {\r\n // trivial range tests do not expose the effects. Assume the hole allows everything.\r\n } else {\r\n const rangeC = this.rangeOfClipperIntersectionWithRange(c, range, observeInvisibleFlag);\r\n rangeIntersection.intersect(rangeC, rangeIntersection);\r\n }\r\n }\r\n return !rangeIntersection.isNull;\r\n }\r\n /** If the case statement above is complete for the variant inputs, this is unreachable .. */\r\n return false;\r\n }\r\n /**\r\n * Emit point loops for intersection of a convex set with a range.\r\n * * return zero length array for (a) null range or (b) no intersections\r\n * @param range range to intersect\r\n * @param includeConvexSetFaces if false, do not compute facets originating as convex set planes.\r\n * @param includeRangeFaces if false, do not compute facets originating as range faces\r\n * @param ignoreInvisiblePlanes if true, do NOT compute a facet for convex set faces marked invisible.\r\n */\r\n public static doesConvexClipPlaneSetIntersectRange(convexSet: ConvexClipPlaneSet, range: Range3d,\r\n includeConvexSetFaces: boolean = true, includeRangeFaces: boolean = true, ignoreInvisiblePlanes = false): boolean {\r\n const work = new GrowableXYZArray();\r\n if (includeConvexSetFaces) {\r\n // Clip convexSet planes to the range and to the rest of the convexSet . .\r\n for (const plane of convexSet.planes) {\r\n if (ignoreInvisiblePlanes && plane.invisible)\r\n continue;\r\n const pointsClippedToRange = plane.intersectRange(range, true);\r\n if (pointsClippedToRange) {\r\n const finalPoints = new GrowableXYZArray();\r\n convexSet.polygonClip(pointsClippedToRange, finalPoints, work, plane);\r\n if (finalPoints.length > 0)\r\n return true;\r\n }\r\n }\r\n }\r\n\r\n if (includeRangeFaces) {\r\n // clip range faces to the convex set . . .\r\n const corners = range.corners();\r\n for (let i = 0; i < 6; i++) {\r\n const indices = Range3d.faceCornerIndices(i);\r\n const finalPoints = new GrowableXYZArray();\r\n const lineString = LineString3d.createIndexedPoints(corners, indices);\r\n convexSet.polygonClip(lineString.packedPoints, finalPoints, work);\r\n if (finalPoints.length > 0)\r\n return true;\r\n }\r\n }\r\n return false;\r\n }\r\n\r\n /** Test for intersection of two ranges in different local coordinates.\r\n * * Useful for clash detection of elements in iModels, using their stored (tight) local ranges and placement transforms.\r\n * @param range0 range in local coordinates of first geometry\r\n * @param local0ToWorld placement transform for first geometry\r\n * @param range1 range in local coordinates of second geometry\r\n * @param local1ToWorld placement transform for second geometry. Assumed to be invertible.\r\n * @param range1Margin optional signed local distance to expand/contract the second range before intersection. Positive expands.\r\n * @return whether the local ranges are adjacent or intersect. Also returns false if local1ToWorld is singular.\r\n */\r\n public static doLocalRangesIntersect(range0: Range3d, local0ToWorld: Transform, range1: Range3d, local1ToWorld: Transform, range1Margin?: number): boolean {\r\n const worldToLocal1 = ClipUtilities._workTransform = local1ToWorld.inverse(ClipUtilities._workTransform);\r\n if (!worldToLocal1)\r\n return false;\r\n let myRange1 = range1;\r\n if (range1Margin) {\r\n myRange1 = ClipUtilities._workRange = range1.clone(ClipUtilities._workRange);\r\n myRange1.expandInPlace(range1Margin);\r\n }\r\n // convert range0 into a clipper in local1 coordinates, then intersect with range1\r\n const local0ToLocal1 = worldToLocal1.multiplyTransformTransform(local0ToWorld, worldToLocal1);\r\n const builder = PolyfaceBuilder.create();\r\n builder.addTransformedRangeMesh(local0ToLocal1, range0);\r\n const mesh0 = builder.claimPolyface();\r\n const clipper = ClipUtilities._workClipper = ConvexClipPlaneSet.createConvexPolyface(mesh0, ClipUtilities._workClipper).clipper;\r\n return ClipUtilities.doesClipperIntersectRange(clipper, myRange1);\r\n }\r\n\r\n /**\r\n * Test if `obj` is a `Clipper` object.\r\n * * This is implemented by testing for each of the methods in the `Clipper` interface.\r\n */\r\n public static isClipper(obj: any): boolean {\r\n if (obj) {\r\n if (obj.isPointOnOrInside\r\n && obj.announceClippedSegmentIntervals\r\n && obj.announceClippedArcIntervals)\r\n return true;\r\n }\r\n return false;\r\n }\r\n /**\r\n * Specialized logic for replacing clip fragments by an equivalent singleton.\r\n * * If there are baseCount + 1 or fewer fragments, do nothing.\r\n * * If there are more than baseCount+1 fragments:\r\n * * drop them all to the cache\r\n * * push a copy of the singleton.\r\n * * The use case for this is that a multi-step clipper (e.g. UnionOfConvexClipPlaneSets) may produce many fragments, and then be able to determine\r\n * that they really are the original pre-clip polygon unchanged.\r\n * * The baseCount+1 case is the case where the entire original singleton is still a singleton and can be left alone.\r\n * * Calling this replacer shuffles the original back into the fragment array, and drops the fragments.\r\n * * This determination is solely within the logic of the caller.\r\n * @param shards array of fragments\r\n * @param baseCount original count\r\n * @param singleton single array which may be a replacement for multiple fragments\r\n * @param cache cache for array management\r\n */\r\n public static restoreSingletonInPlaceOfMultipleShards(fragments: GrowableXYZArray[] | undefined, baseCount: number, singleton: GrowableXYZArray, arrayCache: GrowableXYZArrayCache) {\r\n if (fragments && fragments.length > baseCount + 1) {\r\n while (fragments.length > baseCount) {\r\n const f = fragments.pop();\r\n arrayCache.dropToCache(f);\r\n }\r\n fragments.push(arrayCache.grabAndFill(singleton));\r\n }\r\n }\r\n\r\n /**\r\n * Create a UnionOfConvexClipPlaneSets for a volume defined by a path and offsets.\r\n * @param points points along the path.\r\n * @param positiveOffsetLeft offset to left. 0 is clip on the path.\r\n * @param positiveOffsetRight offset to the right. 0 is clip on the path.\r\n * @param z0 z for lower clipping plane. If undefined, unbounded in positive z\r\n * @param z1 z for upper clipping plane. If undefined, unbounded in negative z.\r\n * @alpha\r\n */\r\n public static createXYOffsetClipFromLineString(points: Point3d[] | IndexedXYZCollection,\r\n leftOffset: number, rightOffset: number, z0: number, z1: number): UnionOfConvexClipPlaneSets {\r\n if (Array.isArray(points)) {\r\n return LineStringOffsetClipperContext.createClipBetweenOffsets(\r\n new Point3dArrayCarrier(points), leftOffset, rightOffset, z0, z1);\r\n }\r\n return LineStringOffsetClipperContext.createClipBetweenOffsets(points, leftOffset, rightOffset, z0, z1);\r\n }\r\n /** if data.length >= minLength threshold, push it to destination; if smaller drop it back to the cache.\r\n */\r\n public static captureOrDrop(data: GrowableXYZArray, minLength: number, destination: GrowableXYZArray[], cache: GrowableXYZArrayCache) {\r\n if (data.length >= minLength)\r\n destination.push(data);\r\n else\r\n cache.dropToCache(data);\r\n }\r\n /**\r\n * Find the portion of a line within a half-plane clip.\r\n * * The half-plane clip is to the left of the line from clipA to clipB.\r\n * * The original clipped segment has fractions 0 and 1 at respective segment points.\r\n * * Caller initializes the interval\r\n * * This method reduces the interval size.\r\n * * See clipSegmentToCCWTriangleXY for typical use.\r\n * @param linePointA First point of clip line\r\n * @param linePointB Second point of clip line\r\n * @param segmentPoint0 First point of clipped segment\r\n * @param segmentPoint1 Second point of clipped segment\r\n * @param interval Live interval.\r\n * @param absoluteTolerance absolute tolerance for both cross product values to indicate \"on\" the line\r\n */\r\n public static clipSegmentToLLeftOfLineXY(linePointA: XAndY, linePointB: XAndY, segmentPoint0: XAndY, segmentPoint1: XAndY, interval: Range1d,\r\n absoluteTolerance: number = 1.0e-14) {\r\n const ux = linePointB.x - linePointA.x;\r\n const uy = linePointB.y - linePointA.y;\r\n // negative is in positive is out ...\r\n const h0 = -(ux * (segmentPoint0.y - linePointA.y) - uy * (segmentPoint0.x - linePointA.x));\r\n const h1 = -(ux * (segmentPoint1.y - linePointA.y) - uy * (segmentPoint1.x - linePointA.x));\r\n if (h0 < absoluteTolerance && h1 < absoluteTolerance) {\r\n // The entire segment is in .....\r\n return;\r\n }\r\n if (h0 * h1 > 0.0) {\r\n if (h0 > 0.0)\r\n interval.setNull();\r\n } else if (h0 * h1 < 0.0) {\r\n // strict crossing with safe fraction . . .\r\n const fraction = -h0 / (h1 - h0);\r\n if (h0 < 0.0) {\r\n return interval.intersectRangeXXInPlace(0.0, fraction);\r\n } else {\r\n return interval.intersectRangeXXInPlace(fraction, 1.0);\r\n }\r\n } else {\r\n // There is an exact hit at one end, possibly non-zero at the other ... the sign of either determines which side is in play\r\n // A zero and a zero or negative is entirely in, which does not alter the prior clip.\r\n if (h0 > 0.0) {\r\n interval.intersectRangeXXInPlace(1.0, 1.0);\r\n } else if (h1 > 0.0) {\r\n interval.intersectRangeXXInPlace(0.0, 0.0);\r\n }\r\n }\r\n }\r\n /**\r\n * Clip an interval of a line segment to a triangle.\r\n * * Triangle is assumed CCW\r\n * @param pointA point of triangle.\r\n * @param pointB point of triangle.\r\n * @param pointC point of triangle.\r\n * @param segment0 start of segment\r\n * @param segment1 end of segment\r\n * @param interval Pre-initialized interval of live part of segment\r\n * @param absoluteTolerance absolute tolerance for begin \"on a line\"\r\n */\r\n public static clipSegmentToCCWTriangleXY(pointA: XAndY, pointB: XAndY, pointC: XAndY, segment0: XAndY, segment1: XAndY, interval: Range1d,\r\n absoluteTolerance: number = 1.0e-14) {\r\n if (!interval.isNull) {\r\n this.clipSegmentToLLeftOfLineXY(pointA, pointB, segment0, segment1, interval, absoluteTolerance);\r\n if (!interval.isNull) {\r\n this.clipSegmentToLLeftOfLineXY(pointB, pointC, segment0, segment1, interval, absoluteTolerance);\r\n if (!interval.isNull) {\r\n this.clipSegmentToLLeftOfLineXY(pointC, pointA, segment0, segment1, interval, absoluteTolerance);\r\n }\r\n }\r\n }\r\n }\r\n\r\n /**\r\n * Find the portion of a line within a half-plane clip.\r\n * * The half-plane clip is to the left of the line from clipA to clipB.\r\n * * The original clipped segment has fractions 0 and 1 at respective segment points.\r\n * * Caller initializes the interval\r\n * * This method reduces the interval size.\r\n * * See clipSegmentToCCWTriangleXY for typical use.\r\n * @param linePointA First point of clip line\r\n * @param linePointB Second point of clip line\r\n * @param segmentPoint0 First point of clipped segment\r\n * @param segmentPoint1 Second point of clipped segment\r\n * @param interval Live interval.\r\n * @param absoluteTolerance absolute tolerance for both cross product values to indicate \"on\" the line\r\n */\r\n public static clipSegmentBelowPlaneXY(plane: Plane3dByOriginAndUnitNormal, segmentPoint0: XAndY, segmentPoint1: XAndY, interval: Range1d,\r\n absoluteTolerance: number = 1.0e-14) {\r\n // negative is in positive is out ...\r\n const h0 = plane.altitudeXY(segmentPoint0.x, segmentPoint0.y);\r\n const h1 = plane.altitudeXY(segmentPoint1.x, segmentPoint1.y);\r\n if (h0 < absoluteTolerance && h1 < absoluteTolerance) {\r\n // The entire segment is in ..... the interval is unaffected.\r\n return;\r\n }\r\n if (h0 * h1 > 0.0) {\r\n if (h0 > 0.0)\r\n interval.setNull();\r\n } else if (h0 * h1 < 0.0) {\r\n // strict crossing with safe fraction . . .\r\n const fraction = -h0 / (h1 - h0);\r\n if (h0 < 0.0) {\r\n return interval.intersectRangeXXInPlace(0.0, fraction);\r\n } else {\r\n return interval.intersectRangeXXInPlace(fraction, 1.0);\r\n }\r\n } else {\r\n // There is an exact hit at one end, possibly non-zero at the other ... the sign of either determines which side is in play\r\n // A zero and a zero or negative is entirely in, which does not alter the prior clip.\r\n if (h0 > 0.0) {\r\n interval.intersectRangeXXInPlace(1.0, 1.0);\r\n } else if (h1 > 0.0) {\r\n interval.intersectRangeXXInPlace(0.0, 0.0);\r\n }\r\n }\r\n }\r\n /**\r\n * Clip an interval of a line segment to an array of planes\r\n * * plane normals assumed OUTWARD\r\n * * planeAltitude is typically a tolerance a tolerance distance.\r\n * * positive altitude makes tha plane move in the direction of the unit normal.\r\n * @param planes array of planes\r\n * @param segment0 start of segment\r\n * @param segment1 end of segment\r\n * @param interval Pre-initialized interval of live part of segment\r\n * @param absoluteTolerance absolute tolerance for begin \"on a line\"\r\n */\r\n public static clipSegmentBelowPlanesXY(planes: Plane3dByOriginAndUnitNormal[], segment0: XAndY, segment1: XAndY, interval: Range1d,\r\n signedAltitude: number = 1.0e-14) {\r\n const numPlanes = planes.length;\r\n for (let i = 0; (!interval.isNull) && i < numPlanes; i++) {\r\n this.clipSegmentBelowPlaneXY(planes[i], segment0, segment1, interval, signedAltitude);\r\n }\r\n }\r\n /**\r\n * Pass line segments from a polyline to the clipper. Resolve the fractional clips to simple points for announcement.\r\n * @param clipper clipper to call\r\n * @param points polyline whose segments are passed to the clipper\r\n * @param announce caller's handler for simple point pairs.\r\n */\r\n public static announcePolylineClip(clipper: Clipper, points: Point3d[], announce: (point0: Point3d, point1: Point3d) => void) {\r\n for (let i = 0; i + 1 < points.length; i++) {\r\n clipper.announceClippedSegmentIntervals(0, 1, points[i], points[i + 1],\r\n (f0: number, f1: number) => {\r\n announce(points[i].interpolate(f0, points[i + 1]), points[i].interpolate(f1, points[i + 1]));\r\n });\r\n }\r\n }\r\n /**\r\n * Pass line segments from a polyline to the clipper. Sum the lengths of the clipped pieces. Return the sum.\r\n * @param clipper clipper to call\r\n * @param points polyline whose segments are passed to the clipper\r\n */\r\n public static sumPolylineClipLength(clipper: Clipper, points: Point3d[]) {\r\n let s = 0;\r\n for (let i = 0; i + 1 < points.length; i++) {\r\n const a = points[i].distance(points[i + 1]);\r\n clipper.announceClippedSegmentIntervals(0, 1, points[i], points[i + 1],\r\n (f0: number, f1: number) => { s += Math.abs(f1 - f0) * a; });\r\n }\r\n return s;\r\n }\r\n /**\r\n * Pass polygon `xyz` through a sequence of PolygonClip steps.\r\n * * At the outset, `xyz` is the (only) entry in a set of candidates.\r\n * * For each clipper, each candidate is presented for appendPolygon to inside and outside parts.\r\n * * Each (in,out) result is distributed among (acceptedIn, acceptedOut, candidates) according to\r\n * (inAction, outAction)\r\n * * At the end, all remaining candidates are distributed among (acceptedIn, acceptedOut, finalUnknown)\r\n * according to finalAction\r\n * * Any clipper that does not have an appendPolygonClip method is skipped.\r\n * @param xyz\r\n * @param clippers\r\n * @param acceptedIn\r\n * @param acceptedOut\r\n * @param finalCandidates\r\n * @param inAction\r\n * @param outAction\r\n * @param finalCandidateAction\r\n */\r\n public static doPolygonClipSequence(\r\n xyz: GrowableXYZArray,\r\n clippers: Clipper[],\r\n acceptedIn: GrowableXYZArray[] | undefined,\r\n acceptedOut: GrowableXYZArray[] | undefined,\r\n finalCandidates: GrowableXYZArray[] | undefined,\r\n inAction: ClipStepAction,\r\n outAction: ClipStepAction,\r\n finalFragmentAction: ClipStepAction,\r\n arrayCache: GrowableXYZArrayCache | undefined\r\n ) {\r\n if (arrayCache === undefined)\r\n arrayCache = new GrowableXYZArrayCache();\r\n let candidates = [arrayCache.grabAndFill(xyz)];\r\n let nextCandidates: GrowableXYZArray[] = [];\r\n const intermediateIn: GrowableXYZArray[] = [];\r\n const intermediateOut: GrowableXYZArray[] = [];\r\n const oldInsideCount = acceptedIn ? acceptedIn.length : 0;\r\n const oldOutsideCount = acceptedOut ? acceptedOut.length : 0;\r\n let shard;\r\n // At each convex set, carryForwardA is all the fragments that have been outside all previous convex sets.\r\n // Clip each such fragment to the current set, sending the outside parts to carryForwardB, which will got to the next clipper\r\n // The final surviving carryForward really is out.\r\n for (const c of clippers) {\r\n if (c.appendPolygonClip) {\r\n while (undefined !== (shard = candidates.pop())) {\r\n c.appendPolygonClip(shard, intermediateIn, intermediateOut, arrayCache);\r\n distributeFragments(inAction, intermediateIn, acceptedIn, acceptedOut, nextCandidates, arrayCache);\r\n distributeFragments(outAction, intermediateOut, acceptedIn, acceptedOut, nextCandidates, arrayCache);\r\n arrayCache.dropToCache(shard);\r\n }\r\n // candidates is empty !!\r\n const temp = candidates; candidates = nextCandidates; nextCandidates = temp;\r\n }\r\n }\r\n distributeFragments(finalFragmentAction, candidates, acceptedIn, acceptedOut, finalCandidates, arrayCache);\r\n // Note: The following assumes that there were no residual candidates ... need to track if that happened?\r\n // If nothing was out, the inside fragments can be replaced by the original.\r\n if (acceptedOut?.length === oldOutsideCount)\r\n ClipUtilities.restoreSingletonInPlaceOfMultipleShards(acceptedIn, oldInsideCount, xyz, arrayCache);\r\n // If nothing was in, the outside fragments can be replaced by the original.\r\n if (acceptedIn?.length === oldInsideCount)\r\n ClipUtilities.restoreSingletonInPlaceOfMultipleShards(acceptedOut, oldOutsideCount, xyz, arrayCache);\r\n }\r\n /**\r\n * Pass polygon `xyz` through a sequence of PolygonClip steps with \"parity\" rules\r\n */\r\n public static doPolygonClipParitySequence(\r\n xyz: GrowableXYZArray,\r\n clippers: Clipper[],\r\n acceptedIn: GrowableXYZArray[] | undefined,\r\n acceptedOut: GrowableXYZArray[] | undefined,\r\n arrayCache: GrowableXYZArrayCache | undefined\r\n ) {\r\n if (arrayCache === undefined)\r\n arrayCache = new GrowableXYZArrayCache();\r\n let candidatesOut = [arrayCache.grabAndFill(xyz)];\r\n let candidatesIn: GrowableXYZArray[] = [];\r\n let nextCandidatesIn: GrowableXYZArray[] = [];\r\n let nextCandidatesOut: GrowableXYZArray[] = [];\r\n const intermediateIn: GrowableXYZArray[] = [];\r\n const intermediateOut: GrowableXYZArray[] = [];\r\n let shard;\r\n // at each step ..\r\n // candidatesIn and candidatesOut are evolved in and out\r\n // nextCandidatesIn and nextCandidatesOut are EMPTY\r\n for (const c of clippers) {\r\n if (c.appendPolygonClip) {\r\n // (IN,OUT) parts of IN parts distribute to (OUT,IN)\r\n while (undefined !== (shard = candidatesIn.pop())) {\r\n c.appendPolygonClip(shard, intermediateIn, intermediateOut, arrayCache);\r\n distributeFragments(ClipStepAction.acceptOut, intermediateIn, nextCandidatesIn, nextCandidatesOut, undefined, arrayCache);\r\n distributeFragments(ClipStepAction.acceptIn, intermediateOut, nextCandidatesIn, nextCandidatesOut, undefined, arrayCache);\r\n arrayCache.dropToCache(shard);\r\n }\r\n // (IN,OUT) parts of IN parts distribute to (OUT,IN)\r\n while (undefined !== (shard = candidatesOut.pop())) {\r\n c.appendPolygonClip(shard, intermediateIn, intermediateOut, arrayCache);\r\n distributeFragments(ClipStepAction.acceptIn, intermediateIn, nextCandidatesIn, nextCandidatesOut, undefined, arrayCache);\r\n distributeFragments(ClipStepAction.acceptOut, intermediateOut, nextCandidatesIn, nextCandidatesOut, undefined, arrayCache);\r\n arrayCache.dropToCache(shard);\r\n }\r\n // reload each candidate step\r\n const tempA = candidatesIn; candidatesIn = nextCandidatesIn; nextCandidatesIn = tempA;\r\n const tempB = candidatesOut; candidatesOut = nextCandidatesOut; nextCandidatesOut = tempB;\r\n }\r\n }\r\n // candidatesIn and candidatesOut are final ....\r\n if (candidatesOut.length === 0)\r\n acceptedIn?.push(arrayCache.grabAndFill(xyz));\r\n else if (candidatesOut.length === 0)\r\n acceptedOut?.push(arrayCache.grabAndFill(xyz));\r\n else {\r\n moveFragments(candidatesIn, acceptedIn, arrayCache);\r\n moveFragments(candidatesOut, acceptedOut, arrayCache);\r\n }\r\n }\r\n /** For each plane of clipper, construct a UnionOfConvexClipPlaneSets for an outer (infinite) convex volume that\r\n * abuts the outer volume of the neighbor faces.\r\n *\r\n */\r\n public static createComplementaryClips(clipper: ConvexClipPlaneSet): UnionOfConvexClipPlaneSets {\r\n const planes = clipper.planes;\r\n const interval = Range1d.createNull();\r\n const n = planes.length;\r\n const newClippers: ConvexClipPlaneSet[] = [];\r\n for (const p of planes){\r\n const outerSet = ConvexClipPlaneSet.createEmpty();\r\n outerSet.addPlaneToConvexSet(p.cloneNegated());\r\n newClippers.push(outerSet);\r\n }\r\n for (let i = 0; i < n; i++) {\r\n for (let j = i + 1; j < n; j++) {\r\n const ray = CurveFactory.planePlaneIntersectionRay(planes[i], planes[j]);\r\n if (ray) {\r\n if (clipper.hasIntersectionWithRay(ray, interval)) {\r\n // the normal-to-normal vector is bisector (or close to bisector?)\r\n const newNormal = planes[j].inwardNormalRef.minus(planes[i].inwardNormalRef);\r\n const plane1 = ClipPlane.createNormalAndPoint(newNormal, ray.origin);\r\n if (plane1) {\r\n const plane2 = plane1.cloneNegated();\r\n newClippers[i].addPlaneToConvexSet(plane1);\r\n newClippers[j].addPlaneToConvexSet(plane2);\r\n }\r\n }\r\n }\r\n }\r\n }\r\n return UnionOfConvexClipPlaneSets.createConvexSets(newClippers);\r\n }\r\n}\r\nfunction moveFragments(\r\n fragments: GrowableXYZArray[],\r\n destination: GrowableXYZArray[] | undefined,\r\n arrayCache: GrowableXYZArrayCache) {\r\n if (destination === undefined)\r\n arrayCache.dropAllToCache(fragments);\r\n else {\r\n for (const f of fragments)\r\n destination.push(f);\r\n }\r\n fragments.length = 0;\r\n}\r\n/**\r\n * Distribute fragments among acceptedIn, acceptedOut, and passToNextStep as directed by action.\r\n * * If the indicated destination is unknown, drop the fragments to the arrayCache.\r\n * @param action destination selector\r\n * @param fragments fragments to be distributed\r\n * @param acceptedIn destination for \"in\"\r\n * @param acceptedOut destination for \"out\"\r\n * @param passToNextStep destination for fragments to be passed to a later step\r\n * @param arrayCache destination for un-distributed fragments.\r\n */\r\nfunction distributeFragments(\r\n action: ClipStepAction,\r\n fragments: GrowableXYZArray[],\r\n acceptedIn: GrowableXYZArray[] | undefined,\r\n acceptedOut: GrowableXYZArray[] | undefined,\r\n passToNextStep: GrowableXYZArray[] | undefined,\r\n arrayCache: GrowableXYZArrayCache) {\r\n let destination;\r\n if (action === ClipStepAction.acceptIn)\r\n destination = acceptedIn;\r\n else if (action === ClipStepAction.acceptOut)\r\n destination = acceptedOut;\r\n else if (action === ClipStepAction.passToNextStep)\r\n destination = passToNextStep;\r\n// remark: if action is other than the enum values, destination is undefined\r\n if (destination === undefined)\r\n arrayCache.dropAllToCache(fragments);\r\n else {\r\n for (const f of fragments)\r\n destination.push(f);\r\n }\r\n fragments.length = 0;\r\n}\r\n"]}
|
|
1
|
+
{"version":3,"file":"ClipUtils.js","sourceRoot":"","sources":["../../../src/clipping/ClipUtils.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAGH,wDAAqD;AAGrD,wDAAqD;AACrD,wCAAqC;AACrC,0CAAuC;AAEvC,qEAAkE;AAGlE,2EAAwE;AACxE,mEAAkE;AAClE,+CAAuD;AACvD,2EAA0E;AAG1E,iEAA8D;AAC9D,2CAAwC;AACxC,mDAAgD;AAChD,6CAA0C;AAC1C,6DAA0D;AAC1D,sGAAmG;AACnG,6EAA0E;AAE1E;;GAEG;AACH,IAAY,oBAOX;AAPD,WAAY,oBAAoB;IAC9B,wBAAwB;IACxB,mFAAkB,CAAA;IAClB,oCAAoC;IACpC,yE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AK,cAAc,CAAC,cAAc;QAC/C,WAAW,GAAG,cAAc,CAAC;IACjC,4EAA4E;IAC1E,IAAI,WAAW,KAAK,SAAS;QAC3B,UAAU,CAAC,cAAc,CAAC,SAAS,CAAC,CAAC;SAClC;QACH,KAAK,MAAM,CAAC,IAAI,SAAS;YACvB,WAAW,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;KACvB;IACD,SAAS,CAAC,MAAM,GAAG,CAAC,CAAC;AACvB,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module CartesianGeometry\r\n */\r\n\r\nimport { Arc3d } from \"../curve/Arc3d\";\r\nimport { CurveFactory } from \"../curve/CurveFactory\";\r\nimport { AnnounceNumberNumber, AnnounceNumberNumberCurvePrimitive, CurvePrimitive } from \"../curve/CurvePrimitive\";\r\nimport { GeometryQuery } from \"../curve/GeometryQuery\";\r\nimport { LineString3d } from \"../curve/LineString3d\";\r\nimport { Loop } from \"../curve/Loop\";\r\nimport { Geometry } from \"../Geometry\";\r\nimport { GrowableFloat64Array } from \"../geometry3d/GrowableFloat64Array\";\r\nimport { GrowableXYZArray } from \"../geometry3d/GrowableXYZArray\";\r\nimport { IndexedXYZCollection } from \"../geometry3d/IndexedXYZCollection\";\r\nimport { Plane3dByOriginAndUnitNormal } from \"../geometry3d/Plane3dByOriginAndUnitNormal\";\r\nimport { Point3dArrayCarrier } from \"../geometry3d/Point3dArrayCarrier\";\r\nimport { Point3d, Vector3d } from \"../geometry3d/Point3dVector3d\";\r\nimport { Range1d, Range3d } from \"../geometry3d/Range\";\r\nimport { GrowableXYZArrayCache } from \"../geometry3d/ReusableObjectCache\";\r\nimport { Transform } from \"../geometry3d/Transform\";\r\nimport { XAndY } from \"../geometry3d/XYZProps\";\r\nimport { PolyfaceBuilder } from \"../polyface/PolyfaceBuilder\";\r\nimport { ClipPlane } from \"./ClipPlane\";\r\nimport { ClipPrimitive } from \"./ClipPrimitive\";\r\nimport { ClipVector } from \"./ClipVector\";\r\nimport { ConvexClipPlaneSet } from \"./ConvexClipPlaneSet\";\r\nimport { LineStringOffsetClipperContext } from \"./internalContexts/LineStringOffsetClipperContext\";\r\nimport { UnionOfConvexClipPlaneSets } from \"./UnionOfConvexClipPlaneSets\";\r\n\r\n/** Enumerated type for describing where geometry lies with respect to clipping planes.\r\n * @public\r\n */\r\nexport enum ClipPlaneContainment {\r\n /** All points inside */\r\n StronglyInside = 1,\r\n /** Inside/outside state unknown. */\r\n Ambiguous = 2,\r\n /** All points outside */\r\n StronglyOutside = 3,\r\n}\r\n/**\r\n * Enumeration of ways to handle an intermediate fragment from a clipping step\r\n * @public\r\n */\r\nexport enum ClipStepAction {\r\n /** Pass fragments directly to final accepted \"in\" state */\r\n acceptIn = 1,\r\n /** Pass fragments directly to final accepted \"out\" state */\r\n acceptOut = -1,\r\n/** forward fragments to subsequent steps. */\r\n passToNextStep = 0\r\n }\r\n\r\n/** Enumerated type for describing what must yet be done to clip a piece of geometry.\r\n * @public\r\n */\r\nexport enum ClipStatus {\r\n /** some geometry may cross the clip boundaries */\r\n ClipRequired,\r\n /** geometry is clearly outside */\r\n TrivialReject,\r\n /** geometry is clearly inside */\r\n TrivialAccept,\r\n}\r\n\r\n/** An object containing clipping planes that can be used to clip geometry.\r\n * @public\r\n */\r\nexport interface Clipper {\r\n /** test if `point` is on or inside the Clipper's volume. */\r\n isPointOnOrInside(point: Point3d, tolerance?: number): boolean;\r\n /** Find the parts of the line segment (if any) that is within the convex clip volume.\r\n * * The input fractional interval from fraction0 to fraction1 (increasing!!) is the active part to consider.\r\n * * To clip to the usual bounded line segment, start with fractions (0,1).\r\n * If the clip volume is unbounded, the line interval may also be unbounded.\r\n * * An unbounded line portion will have fraction coordinates positive or negative Number.MAX_VALUE.\r\n * @param f0 fraction that is the initial lower fraction of the active interval. (e.g. 0.0 for bounded segment)\r\n * @param f1 fraction that is the initial upper fraction of the active interval. (e.g. 1.0 for bounded segment)\r\n * @param pointA segment start (fraction 0)\r\n * @param pointB segment end (fraction 1)\r\n * @param announce function to be called to announce a fraction interval that is within the convex clip volume.\r\n * @returns true if a segment was announced, false if entirely outside.\r\n */\r\n announceClippedSegmentIntervals(f0: number, f1: number, pointA: Point3d, pointB: Point3d, announce?: AnnounceNumberNumber): boolean;\r\n /** Find the portion (or portions) of the arc (if any) that are within the convex clip volume.\r\n * * The input fractional interval from fraction0 to fraction1 (increasing!!) is the active part to consider.\r\n * @param announce function to be called to announce a fraction interval that is within the convex clip volume.\r\n * @returns true if one or more arcs portions were announced, false if entirely outside.\r\n */\r\n announceClippedArcIntervals(arc: Arc3d, announce?: AnnounceNumberNumberCurvePrimitive): boolean;\r\n/** Optional polygon clip method.\r\n * * This is expected to be implemented by planar clip structures.\r\n * * This is unimplemented for curve clippers (e.g. sphere) for which polygon clip result has\r\n * curved edges.\r\n */\r\n appendPolygonClip?: AppendPolygonClipFunction;\r\n}\r\n /**\r\n * Signature of method to execute polygon clip, distributing fragments of xyz among insideFragments and outsideFragments\r\n * @param xyz input polygon. This is not changed.\r\n * @param insideFragments Array to receive \"inside\" fragments. Each fragment is a GrowableXYZArray grabbed from the cache. This is NOT cleared.\r\n * @param outsideFragments Array to receive \"outside\" fragments. Each fragment is a GrowableXYZArray grabbed from the cache. This is NOT cleared.\r\n * @param arrayCache cache for reusable GrowableXYZArray.\r\n */\r\n type AppendPolygonClipFunction = (\r\n xyz: GrowableXYZArray,\r\n insideFragments: GrowableXYZArray[],\r\n outsideFragments: GrowableXYZArray[],\r\n arrayCache: GrowableXYZArrayCache) => void;\r\n\r\n/**\r\n * Interface for clipping polygons.\r\n * Supported by:\r\n * * AlternatingCCTreeNode\r\n * * ConvexClipPlaneSet\r\n * @public\r\n */\r\nexport interface PolygonClipper {\r\n appendPolygonClip: AppendPolygonClipFunction;\r\n}\r\n/** Class whose various static methods are functions for clipping geometry\r\n * @public\r\n */\r\nexport class ClipUtilities {\r\n // on-demand scratch objects for method implementations. If you use one, make sure it isn't already being used in scope.\r\n private static _workTransform?: Transform;\r\n private static _workRange?: Range3d;\r\n private static _workClipper?: ConvexClipPlaneSet;\r\n\r\n private static _selectIntervals01TestPoint = Point3d.create();\r\n /**\r\n * * Augment the unsortedFractionsArray with 0 and 1\r\n * * sort\r\n * * test the midpoint of each interval with `clipper.isPointOnOrInside`\r\n * * pass accepted intervals to `announce(f0,f1,curve)`\r\n */\r\n public static selectIntervals01(curve: CurvePrimitive, unsortedFractions: GrowableFloat64Array, clipper: Clipper, announce?: AnnounceNumberNumberCurvePrimitive): boolean {\r\n unsortedFractions.push(0);\r\n unsortedFractions.push(1);\r\n unsortedFractions.sort();\r\n let f0 = unsortedFractions.atUncheckedIndex(0);\r\n let f1;\r\n let fMid;\r\n const testPoint = ClipUtilities._selectIntervals01TestPoint;\r\n const n = unsortedFractions.length;\r\n for (let i = 1; i < n; i++) {\r\n f1 = unsortedFractions.atUncheckedIndex(i);\r\n if (f1 > f0 + Geometry.smallFraction) {\r\n fMid = 0.5 * (f0 + f1);\r\n if (fMid >= 0.0 && fMid <= 1.0) {\r\n curve.fractionToPoint(fMid, testPoint);\r\n if (clipper.isPointOnOrInside(testPoint)) {\r\n if (announce)\r\n announce(f0, f1, curve);\r\n else\r\n return true;\r\n }\r\n }\r\n f0 = f1;\r\n }\r\n }\r\n return false;\r\n }\r\n /**\r\n * Announce triples of (low, high, cp) for each entry in intervals\r\n * @param intervals source array\r\n * @param cp CurvePrimitive for announcement\r\n * @param announce function to receive data\r\n */\r\n public static announceNNC(intervals: Range1d[], cp: CurvePrimitive, announce?: AnnounceNumberNumberCurvePrimitive): boolean {\r\n if (announce) {\r\n for (const ab of intervals) {\r\n announce(ab.low, ab.high, cp);\r\n }\r\n }\r\n return intervals.length > 0;\r\n }\r\n\r\n /** Find portions of the curve that are within the clipper.\r\n * Collect them into an array of curve primitives.\r\n */\r\n public static collectClippedCurves(curve: CurvePrimitive, clipper: Clipper): CurvePrimitive[] {\r\n const result: CurvePrimitive[] = [];\r\n curve.announceClipIntervals(clipper,\r\n (fraction0: number, fraction1: number, curveA: CurvePrimitive) => {\r\n if (fraction1 !== fraction0) {\r\n const partialCurve = curveA.clonePartialCurve(fraction0, fraction1);\r\n if (partialCurve)\r\n result.push(partialCurve);\r\n }\r\n });\r\n return result;\r\n }\r\n\r\n /**\r\n * Clip a polygon down to regions defined by each shape of a ClipShape.\r\n * @return An multidimensional array of points, where each array is the boundary of part of the remaining polygon.\r\n */\r\n public static clipPolygonToClipShape(polygon: Point3d[], clipShape: ClipPrimitive): Point3d[][] {\r\n const outputA = this.clipPolygonToClipShapeReturnGrowableXYZArrays(polygon, clipShape);\r\n const output = [];\r\n for (const g of outputA)\r\n output.push(g.getPoint3dArray());\r\n return output;\r\n }\r\n\r\n /**\r\n * Clip a polygon down to regions defined by each shape of a ClipShape.\r\n * @return An multidimensional array of points, where each array is the boundary of part of the remaining polygon.\r\n */\r\n public static clipPolygonToClipShapeReturnGrowableXYZArrays(polygon: Point3d[], clipShape: ClipPrimitive): GrowableXYZArray[] {\r\n const output: GrowableXYZArray[] = [];\r\n const clipper = clipShape.fetchClipPlanesRef();\r\n // NEEDS WORK -- what if it is a mask !!!!\r\n if (clipper) {\r\n clipper.polygonClip(polygon, output);\r\n }\r\n return output;\r\n }\r\n\r\n /** Given an array of points, test for trivial containment conditions.\r\n * * ClipStatus.TrivialAccept if all points are in any one of the convexSet's.\r\n * * ClipStatus.ClipRequired if (in any single convexSet) there were points on both sides of any single plane.\r\n * * ClipStatus.TrivialReject if neither of those occurred.\r\n */\r\n public static pointSetSingleClipStatus(points: GrowableXYZArray, planeSet: UnionOfConvexClipPlaneSets, tolerance: number): ClipStatus {\r\n if (planeSet.convexSets.length === 0)\r\n return ClipStatus.TrivialAccept;\r\n\r\n for (const convexSet of planeSet.convexSets) {\r\n let allOutsideSinglePlane = false, anyOutside = false;\r\n\r\n for (const plane of convexSet.planes) {\r\n let numInside = 0, numOutside = 0;\r\n const planeDistance = plane.distance - tolerance;\r\n\r\n const currPt = Point3d.create();\r\n const currVec = Vector3d.create();\r\n for (let i = 0; i < points.length; i++) {\r\n points.getPoint3dAtUncheckedPointIndex(i, currPt);\r\n currVec.setFrom(currPt);\r\n currVec.dotProduct(plane.inwardNormalRef) > planeDistance ? numInside++ : numOutside++;\r\n }\r\n\r\n anyOutside = (numOutside !== 0) ? true : anyOutside;\r\n if (numInside === 0) {\r\n allOutsideSinglePlane = true;\r\n break;\r\n }\r\n }\r\n\r\n if (!anyOutside) // totally inside this set - no clip required\r\n return ClipStatus.TrivialAccept;\r\n if (!allOutsideSinglePlane)\r\n return ClipStatus.ClipRequired;\r\n }\r\n return ClipStatus.TrivialReject;\r\n }\r\n\r\n /**\r\n * Emit point loops for intersection of a convex set with a range.\r\n * * return zero length array for (a) null range or (b) no intersections\r\n * @param range range to intersect\r\n * @param includeConvexSetFaces if false, do not compute facets originating as convex set planes.\r\n * @param includeRangeFaces if false, do not compute facets originating as range faces\r\n * @param ignoreInvisiblePlanes if true, do NOT compute a facet for convex set faces marked invisible.\r\n */\r\n public static announceLoopsOfConvexClipPlaneSetIntersectRange(convexSet: ConvexClipPlaneSet | ClipPlane, range: Range3d, loopFunction: (loopPoints: GrowableXYZArray) => void,\r\n includeConvexSetFaces: boolean = true, includeRangeFaces: boolean = true, ignoreInvisiblePlanes = false) {\r\n const work = new GrowableXYZArray();\r\n if (includeConvexSetFaces) {\r\n // Clip convexSet planes to the range and to the rest of the convexSet . .\r\n if (convexSet instanceof ConvexClipPlaneSet) {\r\n for (const plane of convexSet.planes) {\r\n if (ignoreInvisiblePlanes && plane.invisible)\r\n continue;\r\n const pointsClippedToRange = plane.intersectRange(range, true);\r\n const finalPoints = new GrowableXYZArray();\r\n if (pointsClippedToRange) {\r\n convexSet.polygonClip(pointsClippedToRange, finalPoints, work, plane);\r\n if (finalPoints.length > 0)\r\n loopFunction(finalPoints);\r\n }\r\n }\r\n } else { // `convexSet` is just one plane ...\r\n if (ignoreInvisiblePlanes && convexSet.invisible) {\r\n // skip it !\r\n } else {\r\n const pointsClippedToRange = convexSet.intersectRange(range, true);\r\n if (pointsClippedToRange)\r\n loopFunction(pointsClippedToRange);\r\n }\r\n }\r\n }\r\n\r\n if (includeRangeFaces) {\r\n // clip range faces to the convex set . . .\r\n const corners = range.corners();\r\n for (let i = 0; i < 6; i++) {\r\n const indices = Range3d.faceCornerIndices(i);\r\n const finalPoints = new GrowableXYZArray();\r\n const lineString = LineString3d.createIndexedPoints(corners, indices);\r\n if (convexSet instanceof ConvexClipPlaneSet) {\r\n convexSet.polygonClip(lineString.packedPoints, finalPoints, work);\r\n if (finalPoints.length > 0)\r\n loopFunction(finalPoints);\r\n } else {\r\n convexSet.clipConvexPolygonInPlace(lineString.packedPoints, work);\r\n if (lineString.packedPoints.length > 0)\r\n loopFunction(lineString.packedPoints);\r\n }\r\n }\r\n }\r\n }\r\n\r\n /**\r\n * Return a (possibly empty) array of geometry (Loops !!) which are facets of the intersection of the convex set intersecting a range.\r\n * * return zero length array for (a) null range or (b) no intersections\r\n * @param allClippers convex or union clipper\r\n * @param range range to intersect\r\n * @param includeConvexSetFaces if false, do not compute facets originating as convex set planes.\r\n * @param includeRangeFaces if false, do not compute facets originating as range faces\r\n * @param ignoreInvisiblePlanes if true, do NOT compute a facet for convex set faces marked invisible.\r\n */\r\n public static loopsOfConvexClipPlaneIntersectionWithRange(allClippers: ConvexClipPlaneSet | UnionOfConvexClipPlaneSets | ClipPlane, range: Range3d,\r\n includeConvexSetFaces: boolean = true, includeRangeFaces: boolean = true, ignoreInvisiblePlanes = false): GeometryQuery[] {\r\n const result: GeometryQuery[] = [];\r\n if (allClippers instanceof UnionOfConvexClipPlaneSets) {\r\n for (const clipper of allClippers.convexSets) {\r\n this.announceLoopsOfConvexClipPlaneSetIntersectRange(clipper, range,\r\n (points: GrowableXYZArray) => {\r\n if (points.length > 0) result.push(Loop.createPolygon(points));\r\n },\r\n includeConvexSetFaces, includeRangeFaces, ignoreInvisiblePlanes);\r\n }\r\n } else if (allClippers instanceof ConvexClipPlaneSet || allClippers instanceof ClipPlane) {\r\n this.announceLoopsOfConvexClipPlaneSetIntersectRange(allClippers, range,\r\n (points: GrowableXYZArray) => {\r\n if (points.length > 0) result.push(Loop.createPolygon(points));\r\n },\r\n includeConvexSetFaces, includeRangeFaces, ignoreInvisiblePlanes);\r\n }\r\n return result;\r\n }\r\n /**\r\n * Return the (possibly null) range of the intersection of the convex set with a range.\r\n * * The convex set is permitted to be unbounded (e.g. a single plane). The range parameter provides bounds.\r\n * @param convexSet convex set for intersection.\r\n * @param range range to intersect\r\n */\r\n public static rangeOfConvexClipPlaneSetIntersectionWithRange(convexSet: ConvexClipPlaneSet, range: Range3d): Range3d {\r\n const result = Range3d.createNull();\r\n this.announceLoopsOfConvexClipPlaneSetIntersectRange(convexSet, range,\r\n (points: GrowableXYZArray) => {\r\n if (points.length > 0) result.extendArray(points);\r\n },\r\n true, true, false);\r\n return result;\r\n }\r\n /**\r\n * Return the range of various types of clippers\r\n * * `ConvexClipPlaneSet` -- dispatch to `rangeOfConvexClipPlaneSetIntersectionWithRange`\r\n * * `UnionOfConvexClipPlaneSet` -- union of ranges of member `ConvexClipPlaneSet`\r\n * * `ClipPrimitive` -- access its `UnionOfConvexClipPlaneSet`.\r\n * * `ClipVector` -- intersection of the ranges of its `ClipPrimitive`.\r\n * * `undefined` -- entire input range.\r\n * * If `observeInvisibleFlag` is false, the \"invisible\" properties are ignored, and this effectively returns the range of the edge work of the members\r\n * * If `observeInvisibleFlag` is true, the \"invisible\" properties are observed, and \"invisible\" parts do not restrict the range.\r\n * @param clipper\r\n * @param range non-null range.\r\n * @param observeInvisibleFlag indicates how \"invisible\" bit is applied for ClipPrimitive.\r\n */\r\n public static rangeOfClipperIntersectionWithRange(clipper: ConvexClipPlaneSet | UnionOfConvexClipPlaneSets | ClipPrimitive | ClipVector | undefined, range: Range3d, observeInvisibleFlag: boolean = true): Range3d {\r\n if (clipper === undefined)\r\n return range.clone();\r\n if (clipper instanceof ConvexClipPlaneSet)\r\n return this.rangeOfConvexClipPlaneSetIntersectionWithRange(clipper, range);\r\n if (clipper instanceof UnionOfConvexClipPlaneSets) {\r\n const rangeUnion = Range3d.createNull();\r\n for (const c of clipper.convexSets) {\r\n const rangeC = this.rangeOfConvexClipPlaneSetIntersectionWithRange(c, range);\r\n rangeUnion.extendRange(rangeC);\r\n }\r\n return rangeUnion;\r\n }\r\n if (clipper instanceof ClipPrimitive) {\r\n if (observeInvisibleFlag && clipper.invisible)\r\n return range.clone();\r\n return this.rangeOfClipperIntersectionWithRange(clipper.fetchClipPlanesRef(), range);\r\n }\r\n if (clipper instanceof ClipVector) {\r\n const rangeIntersection = range.clone();\r\n for (const c of clipper.clips) {\r\n if (observeInvisibleFlag && c.invisible) {\r\n // trivial range tests do not expose the effects. Assume the hole allows everything.\r\n } else {\r\n const rangeC = this.rangeOfClipperIntersectionWithRange(c, range, observeInvisibleFlag);\r\n rangeIntersection.intersect(rangeC, rangeIntersection);\r\n }\r\n }\r\n return rangeIntersection;\r\n\r\n }\r\n return range.clone();\r\n }\r\n /**\r\n * Test if various types of clippers have any intersection with a range.\r\n * * This follows the same logic as `rangeOfClipperIntersectionWithRange` but attempts to exit at earliest point of confirmed intersection\r\n * * `ConvexClipPlaneSet` -- dispatch to `doesConvexClipPlaneSetIntersectRange`\r\n * * `UnionOfConvexClipPlaneSet` -- union of ranges of member `ConvexClipPlaneSet`\r\n * * `ClipPrimitive` -- access its `UnionOfConvexClipPlaneSet`.\r\n * * `ClipVector` -- intersection of the ranges of its `ClipPrimitive`.\r\n * * `undefined` -- entire input range.\r\n * * If `observeInvisibleFlag` is false, the \"invisible\" properties are ignored, and holes do not affect the result.\r\n * * If `observeInvisibleFlag` is true, the \"invisible\" properties are observed, and may affect the result.\r\n * @param clipper\r\n * @param range non-null range.\r\n * @param observeInvisibleFlag indicates how \"invisible\" bit is applied for ClipPrimitive.\r\n */\r\n public static doesClipperIntersectRange(clipper: ConvexClipPlaneSet | UnionOfConvexClipPlaneSets | ClipPrimitive | ClipVector | undefined, range: Range3d, observeInvisibleFlag: boolean = true): boolean {\r\n if (clipper === undefined)\r\n return true;\r\n\r\n if (clipper instanceof ConvexClipPlaneSet)\r\n return this.doesConvexClipPlaneSetIntersectRange(clipper, range);\r\n\r\n if (clipper instanceof UnionOfConvexClipPlaneSets) {\r\n for (const c of clipper.convexSets) {\r\n if (this.doesConvexClipPlaneSetIntersectRange(c, range))\r\n return true;\r\n }\r\n return false;\r\n }\r\n\r\n if (clipper instanceof ClipPrimitive) {\r\n if (observeInvisibleFlag && clipper.invisible) // um is there an easy way to detect range-completely-inside?\r\n return true;\r\n return this.doesClipperIntersectRange(clipper.fetchClipPlanesRef(), range);\r\n }\r\n\r\n if (clipper instanceof ClipVector) {\r\n const rangeIntersection = range.clone();\r\n for (const c of clipper.clips) {\r\n if (observeInvisibleFlag && c.invisible) {\r\n // trivial range tests do not expose the effects. Assume the hole allows everything.\r\n } else {\r\n const rangeC = this.rangeOfClipperIntersectionWithRange(c, range, observeInvisibleFlag);\r\n rangeIntersection.intersect(rangeC, rangeIntersection);\r\n }\r\n }\r\n return !rangeIntersection.isNull;\r\n }\r\n /** If the case statement above is complete for the variant inputs, this is unreachable .. */\r\n return false;\r\n }\r\n /**\r\n * Emit point loops for intersection of a convex set with a range.\r\n * * return zero length array for (a) null range or (b) no intersections\r\n * @param range range to intersect\r\n * @param includeConvexSetFaces if false, do not compute facets originating as convex set planes.\r\n * @param includeRangeFaces if false, do not compute facets originating as range faces\r\n * @param ignoreInvisiblePlanes if true, do NOT compute a facet for convex set faces marked invisible.\r\n */\r\n public static doesConvexClipPlaneSetIntersectRange(convexSet: ConvexClipPlaneSet, range: Range3d,\r\n includeConvexSetFaces: boolean = true, includeRangeFaces: boolean = true, ignoreInvisiblePlanes = false): boolean {\r\n const work = new GrowableXYZArray();\r\n if (includeConvexSetFaces) {\r\n // Clip convexSet planes to the range and to the rest of the convexSet . .\r\n for (const plane of convexSet.planes) {\r\n if (ignoreInvisiblePlanes && plane.invisible)\r\n continue;\r\n const pointsClippedToRange = plane.intersectRange(range, true);\r\n if (pointsClippedToRange) {\r\n const finalPoints = new GrowableXYZArray();\r\n convexSet.polygonClip(pointsClippedToRange, finalPoints, work, plane);\r\n if (finalPoints.length > 0)\r\n return true;\r\n }\r\n }\r\n }\r\n\r\n if (includeRangeFaces) {\r\n // clip range faces to the convex set . . .\r\n const corners = range.corners();\r\n for (let i = 0; i < 6; i++) {\r\n const indices = Range3d.faceCornerIndices(i);\r\n const finalPoints = new GrowableXYZArray();\r\n const lineString = LineString3d.createIndexedPoints(corners, indices);\r\n convexSet.polygonClip(lineString.packedPoints, finalPoints, work);\r\n if (finalPoints.length > 0)\r\n return true;\r\n }\r\n }\r\n return false;\r\n }\r\n\r\n /** Test for intersection of two ranges in different local coordinates.\r\n * * Useful for clash detection of elements in iModels, using their stored (tight) local ranges and placement transforms.\r\n * @param range0 range in local coordinates of first geometry\r\n * @param local0ToWorld placement transform for first geometry\r\n * @param range1 range in local coordinates of second geometry\r\n * @param local1ToWorld placement transform for second geometry. Assumed to be invertible.\r\n * @param range1Margin optional signed local distance to expand/contract the second range before intersection. Positive expands.\r\n * @return whether the local ranges are adjacent or intersect. Also returns false if local1ToWorld is singular.\r\n */\r\n public static doLocalRangesIntersect(range0: Range3d, local0ToWorld: Transform, range1: Range3d, local1ToWorld: Transform, range1Margin?: number): boolean {\r\n const worldToLocal1 = ClipUtilities._workTransform = local1ToWorld.inverse(ClipUtilities._workTransform);\r\n if (!worldToLocal1)\r\n return false;\r\n let myRange1 = range1;\r\n if (range1Margin) {\r\n myRange1 = ClipUtilities._workRange = range1.clone(ClipUtilities._workRange);\r\n myRange1.expandInPlace(range1Margin);\r\n }\r\n // convert range0 into a clipper in local1 coordinates, then intersect with range1\r\n const local0ToLocal1 = worldToLocal1.multiplyTransformTransform(local0ToWorld, worldToLocal1);\r\n const builder = PolyfaceBuilder.create();\r\n builder.addTransformedRangeMesh(local0ToLocal1, range0);\r\n const mesh0 = builder.claimPolyface();\r\n const clipper = ClipUtilities._workClipper = ConvexClipPlaneSet.createConvexPolyface(mesh0, ClipUtilities._workClipper).clipper;\r\n return ClipUtilities.doesClipperIntersectRange(clipper, myRange1);\r\n }\r\n\r\n /**\r\n * Test if `obj` is a `Clipper` object.\r\n * * This is implemented by testing for each of the methods in the `Clipper` interface.\r\n */\r\n public static isClipper(obj: any): boolean {\r\n if (obj) {\r\n if (obj.isPointOnOrInside\r\n && obj.announceClippedSegmentIntervals\r\n && obj.announceClippedArcIntervals)\r\n return true;\r\n }\r\n return false;\r\n }\r\n /**\r\n * Specialized logic for replacing clip fragments by an equivalent singleton.\r\n * * If there are baseCount + 1 or fewer fragments, do nothing.\r\n * * If there are more than baseCount+1 fragments:\r\n * * drop them all to the cache\r\n * * push a copy of the singleton.\r\n * * The use case for this is that a multi-step clipper (e.g. UnionOfConvexClipPlaneSets) may produce many fragments, and then be able to determine\r\n * that they really are the original pre-clip polygon unchanged.\r\n * * The baseCount+1 case is the case where the entire original singleton is still a singleton and can be left alone.\r\n * * Calling this replacer shuffles the original back into the fragment array, and drops the fragments.\r\n * * This determination is solely within the logic of the caller.\r\n * @param shards array of fragments\r\n * @param baseCount original count\r\n * @param singleton single array which may be a replacement for multiple fragments\r\n * @param cache cache for array management\r\n */\r\n public static restoreSingletonInPlaceOfMultipleShards(fragments: GrowableXYZArray[] | undefined, baseCount: number, singleton: GrowableXYZArray, arrayCache: GrowableXYZArrayCache) {\r\n if (fragments && fragments.length > baseCount + 1) {\r\n while (fragments.length > baseCount) {\r\n const f = fragments.pop();\r\n arrayCache.dropToCache(f);\r\n }\r\n fragments.push(arrayCache.grabAndFill(singleton));\r\n }\r\n }\r\n\r\n /**\r\n * Create a UnionOfConvexClipPlaneSets for a volume defined by a path and offsets.\r\n * @param points points along the path.\r\n * @param positiveOffsetLeft offset to left. 0 is clip on the path.\r\n * @param positiveOffsetRight offset to the right. 0 is clip on the path.\r\n * @param z0 z for lower clipping plane. If undefined, unbounded in positive z\r\n * @param z1 z for upper clipping plane. If undefined, unbounded in negative z.\r\n * @alpha\r\n */\r\n public static createXYOffsetClipFromLineString(points: Point3d[] | IndexedXYZCollection,\r\n leftOffset: number, rightOffset: number, z0: number, z1: number): UnionOfConvexClipPlaneSets {\r\n if (Array.isArray(points)) {\r\n return LineStringOffsetClipperContext.createClipBetweenOffsets(\r\n new Point3dArrayCarrier(points), leftOffset, rightOffset, z0, z1);\r\n }\r\n return LineStringOffsetClipperContext.createClipBetweenOffsets(points, leftOffset, rightOffset, z0, z1);\r\n }\r\n /** if data.length >= minLength threshold, push it to destination; if smaller drop it back to the cache.\r\n */\r\n public static captureOrDrop(data: GrowableXYZArray, minLength: number, destination: GrowableXYZArray[], cache: GrowableXYZArrayCache) {\r\n if (data.length >= minLength)\r\n destination.push(data);\r\n else\r\n cache.dropToCache(data);\r\n }\r\n /**\r\n * Find the portion of a line within a half-plane clip.\r\n * * The half-plane clip is to the left of the line from clipA to clipB.\r\n * * The original clipped segment has fractions 0 and 1 at respective segment points.\r\n * * Caller initializes the interval\r\n * * This method reduces the interval size.\r\n * * See clipSegmentToCCWTriangleXY for typical use.\r\n * @param linePointA First point of clip line\r\n * @param linePointB Second point of clip line\r\n * @param segmentPoint0 First point of clipped segment\r\n * @param segmentPoint1 Second point of clipped segment\r\n * @param interval Live interval.\r\n * @param absoluteTolerance absolute tolerance for both cross product values to indicate \"on\" the line\r\n */\r\n public static clipSegmentToLLeftOfLineXY(linePointA: XAndY, linePointB: XAndY, segmentPoint0: XAndY, segmentPoint1: XAndY, interval: Range1d,\r\n absoluteTolerance: number = 1.0e-14) {\r\n const ux = linePointB.x - linePointA.x;\r\n const uy = linePointB.y - linePointA.y;\r\n // negative is in positive is out ...\r\n const h0 = -(ux * (segmentPoint0.y - linePointA.y) - uy * (segmentPoint0.x - linePointA.x));\r\n const h1 = -(ux * (segmentPoint1.y - linePointA.y) - uy * (segmentPoint1.x - linePointA.x));\r\n if (h0 < absoluteTolerance && h1 < absoluteTolerance) {\r\n // The entire segment is in .....\r\n return;\r\n }\r\n if (h0 * h1 > 0.0) {\r\n if (h0 > 0.0)\r\n interval.setNull();\r\n } else if (h0 * h1 < 0.0) {\r\n // strict crossing with safe fraction . . .\r\n const fraction = -h0 / (h1 - h0);\r\n if (h0 < 0.0) {\r\n return interval.intersectRangeXXInPlace(0.0, fraction);\r\n } else {\r\n return interval.intersectRangeXXInPlace(fraction, 1.0);\r\n }\r\n } else {\r\n // There is an exact hit at one end, possibly non-zero at the other ... the sign of either determines which side is in play\r\n // A zero and a zero or negative is entirely in, which does not alter the prior clip.\r\n if (h0 > 0.0) {\r\n interval.intersectRangeXXInPlace(1.0, 1.0);\r\n } else if (h1 > 0.0) {\r\n interval.intersectRangeXXInPlace(0.0, 0.0);\r\n }\r\n }\r\n }\r\n /**\r\n * Clip an interval of a line segment to a triangle.\r\n * * Triangle is assumed CCW\r\n * @param pointA point of triangle.\r\n * @param pointB point of triangle.\r\n * @param pointC point of triangle.\r\n * @param segment0 start of segment\r\n * @param segment1 end of segment\r\n * @param interval Pre-initialized interval of live part of segment\r\n * @param absoluteTolerance absolute tolerance for begin \"on a line\"\r\n */\r\n public static clipSegmentToCCWTriangleXY(pointA: XAndY, pointB: XAndY, pointC: XAndY, segment0: XAndY, segment1: XAndY, interval: Range1d,\r\n absoluteTolerance: number = 1.0e-14) {\r\n if (!interval.isNull) {\r\n this.clipSegmentToLLeftOfLineXY(pointA, pointB, segment0, segment1, interval, absoluteTolerance);\r\n if (!interval.isNull) {\r\n this.clipSegmentToLLeftOfLineXY(pointB, pointC, segment0, segment1, interval, absoluteTolerance);\r\n if (!interval.isNull) {\r\n this.clipSegmentToLLeftOfLineXY(pointC, pointA, segment0, segment1, interval, absoluteTolerance);\r\n }\r\n }\r\n }\r\n }\r\n\r\n /**\r\n * Find the portion of a line within a half-plane clip.\r\n * * The half-plane clip is to the left of the line from clipA to clipB.\r\n * * The original clipped segment has fractions 0 and 1 at respective segment points.\r\n * * Caller initializes the interval\r\n * * This method reduces the interval size.\r\n * * See clipSegmentToCCWTriangleXY for typical use.\r\n * @param linePointA First point of clip line\r\n * @param linePointB Second point of clip line\r\n * @param segmentPoint0 First point of clipped segment\r\n * @param segmentPoint1 Second point of clipped segment\r\n * @param interval Live interval.\r\n * @param absoluteTolerance absolute tolerance for both cross product values to indicate \"on\" the line\r\n */\r\n public static clipSegmentBelowPlaneXY(plane: Plane3dByOriginAndUnitNormal, segmentPoint0: XAndY, segmentPoint1: XAndY, interval: Range1d,\r\n absoluteTolerance: number = 1.0e-14) {\r\n // negative is in positive is out ...\r\n const h0 = plane.altitudeXY(segmentPoint0.x, segmentPoint0.y);\r\n const h1 = plane.altitudeXY(segmentPoint1.x, segmentPoint1.y);\r\n if (h0 < absoluteTolerance && h1 < absoluteTolerance) {\r\n // The entire segment is in ..... the interval is unaffected.\r\n return;\r\n }\r\n if (h0 * h1 > 0.0) {\r\n if (h0 > 0.0)\r\n interval.setNull();\r\n } else if (h0 * h1 < 0.0) {\r\n // strict crossing with safe fraction . . .\r\n const fraction = -h0 / (h1 - h0);\r\n if (h0 < 0.0) {\r\n return interval.intersectRangeXXInPlace(0.0, fraction);\r\n } else {\r\n return interval.intersectRangeXXInPlace(fraction, 1.0);\r\n }\r\n } else {\r\n // There is an exact hit at one end, possibly non-zero at the other ... the sign of either determines which side is in play\r\n // A zero and a zero or negative is entirely in, which does not alter the prior clip.\r\n if (h0 > 0.0) {\r\n interval.intersectRangeXXInPlace(1.0, 1.0);\r\n } else if (h1 > 0.0) {\r\n interval.intersectRangeXXInPlace(0.0, 0.0);\r\n }\r\n }\r\n }\r\n /**\r\n * Clip an interval of a line segment to an array of planes\r\n * * plane normals assumed OUTWARD\r\n * * planeAltitude is typically a tolerance a tolerance distance.\r\n * * positive altitude makes tha plane move in the direction of the unit normal.\r\n * @param planes array of planes\r\n * @param segment0 start of segment\r\n * @param segment1 end of segment\r\n * @param interval Pre-initialized interval of live part of segment\r\n * @param absoluteTolerance absolute tolerance for begin \"on a line\"\r\n */\r\n public static clipSegmentBelowPlanesXY(planes: Plane3dByOriginAndUnitNormal[], segment0: XAndY, segment1: XAndY, interval: Range1d,\r\n signedAltitude: number = 1.0e-14) {\r\n const numPlanes = planes.length;\r\n for (let i = 0; (!interval.isNull) && i < numPlanes; i++) {\r\n this.clipSegmentBelowPlaneXY(planes[i], segment0, segment1, interval, signedAltitude);\r\n }\r\n }\r\n /**\r\n * Pass line segments from a polyline to the clipper. Resolve the fractional clips to simple points for announcement.\r\n * @param clipper clipper to call\r\n * @param points polyline whose segments are passed to the clipper\r\n * @param announce caller's handler for simple point pairs.\r\n */\r\n public static announcePolylineClip(clipper: Clipper, points: Point3d[], announce: (point0: Point3d, point1: Point3d) => void) {\r\n for (let i = 0; i + 1 < points.length; i++) {\r\n clipper.announceClippedSegmentIntervals(0, 1, points[i], points[i + 1],\r\n (f0: number, f1: number) => {\r\n announce(points[i].interpolate(f0, points[i + 1]), points[i].interpolate(f1, points[i + 1]));\r\n });\r\n }\r\n }\r\n /**\r\n * Pass line segments from a polyline to the clipper. Sum the lengths of the clipped pieces. Return the sum.\r\n * @param clipper clipper to call\r\n * @param points polyline whose segments are passed to the clipper\r\n */\r\n public static sumPolylineClipLength(clipper: Clipper, points: Point3d[]) {\r\n let s = 0;\r\n for (let i = 0; i + 1 < points.length; i++) {\r\n const a = points[i].distance(points[i + 1]);\r\n clipper.announceClippedSegmentIntervals(0, 1, points[i], points[i + 1],\r\n (f0: number, f1: number) => { s += Math.abs(f1 - f0) * a; });\r\n }\r\n return s;\r\n }\r\n /**\r\n * Pass polygon `xyz` through a sequence of PolygonClip steps.\r\n * * At the outset, `xyz` is the (only) entry in a set of candidates.\r\n * * For each clipper, each candidate is presented for appendPolygon to inside and outside parts.\r\n * * Each (in,out) result is distributed among (acceptedIn, acceptedOut, candidates) according to\r\n * (inAction, outAction)\r\n * * At the end, all remaining candidates are distributed among (acceptedIn, acceptedOut, finalUnknown)\r\n * according to finalAction\r\n * * Any clipper that does not have an appendPolygonClip method is skipped.\r\n * @param xyz\r\n * @param clippers\r\n * @param acceptedIn\r\n * @param acceptedOut\r\n * @param finalCandidates\r\n * @param inAction\r\n * @param outAction\r\n * @param finalCandidateAction\r\n */\r\n public static doPolygonClipSequence(\r\n xyz: GrowableXYZArray,\r\n clippers: Clipper[],\r\n acceptedIn: GrowableXYZArray[] | undefined,\r\n acceptedOut: GrowableXYZArray[] | undefined,\r\n finalCandidates: GrowableXYZArray[] | undefined,\r\n inAction: ClipStepAction,\r\n outAction: ClipStepAction,\r\n finalFragmentAction: ClipStepAction,\r\n arrayCache: GrowableXYZArrayCache | undefined,\r\n ) {\r\n if (arrayCache === undefined)\r\n arrayCache = new GrowableXYZArrayCache();\r\n let candidates = [arrayCache.grabAndFill(xyz)];\r\n let nextCandidates: GrowableXYZArray[] = [];\r\n const intermediateIn: GrowableXYZArray[] = [];\r\n const intermediateOut: GrowableXYZArray[] = [];\r\n const oldInsideCount = acceptedIn ? acceptedIn.length : 0;\r\n const oldOutsideCount = acceptedOut ? acceptedOut.length : 0;\r\n let shard;\r\n // At each convex set, carryForwardA is all the fragments that have been outside all previous convex sets.\r\n // Clip each such fragment to the current set, sending the outside parts to carryForwardB, which will got to the next clipper\r\n // The final surviving carryForward really is out.\r\n for (const c of clippers) {\r\n if (c.appendPolygonClip) {\r\n while (undefined !== (shard = candidates.pop())) {\r\n c.appendPolygonClip(shard, intermediateIn, intermediateOut, arrayCache);\r\n distributeFragments(inAction, intermediateIn, acceptedIn, acceptedOut, nextCandidates, arrayCache);\r\n distributeFragments(outAction, intermediateOut, acceptedIn, acceptedOut, nextCandidates, arrayCache);\r\n arrayCache.dropToCache(shard);\r\n }\r\n // candidates is empty !!\r\n const temp = candidates; candidates = nextCandidates; nextCandidates = temp;\r\n }\r\n }\r\n distributeFragments(finalFragmentAction, candidates, acceptedIn, acceptedOut, finalCandidates, arrayCache);\r\n // Note: The following assumes that there were no residual candidates ... need to track if that happened?\r\n // If nothing was out, the inside fragments can be replaced by the original.\r\n if (acceptedOut?.length === oldOutsideCount)\r\n ClipUtilities.restoreSingletonInPlaceOfMultipleShards(acceptedIn, oldInsideCount, xyz, arrayCache);\r\n // If nothing was in, the outside fragments can be replaced by the original.\r\n if (acceptedIn?.length === oldInsideCount)\r\n ClipUtilities.restoreSingletonInPlaceOfMultipleShards(acceptedOut, oldOutsideCount, xyz, arrayCache);\r\n }\r\n /**\r\n * Pass polygon `xyz` through a sequence of PolygonClip steps with \"parity\" rules\r\n */\r\n public static doPolygonClipParitySequence(\r\n xyz: GrowableXYZArray,\r\n clippers: Clipper[],\r\n acceptedIn: GrowableXYZArray[] | undefined,\r\n acceptedOut: GrowableXYZArray[] | undefined,\r\n arrayCache: GrowableXYZArrayCache | undefined,\r\n ) {\r\n if (arrayCache === undefined)\r\n arrayCache = new GrowableXYZArrayCache();\r\n let candidatesOut = [arrayCache.grabAndFill(xyz)];\r\n let candidatesIn: GrowableXYZArray[] = [];\r\n let nextCandidatesIn: GrowableXYZArray[] = [];\r\n let nextCandidatesOut: GrowableXYZArray[] = [];\r\n const intermediateIn: GrowableXYZArray[] = [];\r\n const intermediateOut: GrowableXYZArray[] = [];\r\n let shard;\r\n // at each step ..\r\n // candidatesIn and candidatesOut are evolved in and out\r\n // nextCandidatesIn and nextCandidatesOut are EMPTY\r\n for (const c of clippers) {\r\n if (c.appendPolygonClip) {\r\n // (IN,OUT) parts of IN parts distribute to (OUT,IN)\r\n while (undefined !== (shard = candidatesIn.pop())) {\r\n c.appendPolygonClip(shard, intermediateIn, intermediateOut, arrayCache);\r\n distributeFragments(ClipStepAction.acceptOut, intermediateIn, nextCandidatesIn, nextCandidatesOut, undefined, arrayCache);\r\n distributeFragments(ClipStepAction.acceptIn, intermediateOut, nextCandidatesIn, nextCandidatesOut, undefined, arrayCache);\r\n arrayCache.dropToCache(shard);\r\n }\r\n // (IN,OUT) parts of IN parts distribute to (OUT,IN)\r\n while (undefined !== (shard = candidatesOut.pop())) {\r\n c.appendPolygonClip(shard, intermediateIn, intermediateOut, arrayCache);\r\n distributeFragments(ClipStepAction.acceptIn, intermediateIn, nextCandidatesIn, nextCandidatesOut, undefined, arrayCache);\r\n distributeFragments(ClipStepAction.acceptOut, intermediateOut, nextCandidatesIn, nextCandidatesOut, undefined, arrayCache);\r\n arrayCache.dropToCache(shard);\r\n }\r\n // reload each candidate step\r\n const tempA = candidatesIn; candidatesIn = nextCandidatesIn; nextCandidatesIn = tempA;\r\n const tempB = candidatesOut; candidatesOut = nextCandidatesOut; nextCandidatesOut = tempB;\r\n }\r\n }\r\n // candidatesIn and candidatesOut are final ....\r\n if (candidatesOut.length === 0)\r\n acceptedIn?.push(arrayCache.grabAndFill(xyz));\r\n else if (candidatesOut.length === 0)\r\n acceptedOut?.push(arrayCache.grabAndFill(xyz));\r\n else {\r\n moveFragments(candidatesIn, acceptedIn, arrayCache);\r\n moveFragments(candidatesOut, acceptedOut, arrayCache);\r\n }\r\n }\r\n /** For each plane of clipper, construct a UnionOfConvexClipPlaneSets for an outer (infinite) convex volume that\r\n * abuts the outer volume of the neighbor faces.\r\n *\r\n */\r\n public static createComplementaryClips(clipper: ConvexClipPlaneSet): UnionOfConvexClipPlaneSets {\r\n const planes = clipper.planes;\r\n const interval = Range1d.createNull();\r\n const n = planes.length;\r\n const newClippers: ConvexClipPlaneSet[] = [];\r\n for (const p of planes){\r\n const outerSet = ConvexClipPlaneSet.createEmpty();\r\n outerSet.addPlaneToConvexSet(p.cloneNegated());\r\n newClippers.push(outerSet);\r\n }\r\n for (let i = 0; i < n; i++) {\r\n for (let j = i + 1; j < n; j++) {\r\n const ray = CurveFactory.planePlaneIntersectionRay(planes[i], planes[j]);\r\n if (ray) {\r\n if (clipper.hasIntersectionWithRay(ray, interval)) {\r\n // the normal-to-normal vector is bisector (or close to bisector?)\r\n const newNormal = planes[j].inwardNormalRef.minus(planes[i].inwardNormalRef);\r\n const plane1 = ClipPlane.createNormalAndPoint(newNormal, ray.origin);\r\n if (plane1) {\r\n const plane2 = plane1.cloneNegated();\r\n newClippers[i].addPlaneToConvexSet(plane1);\r\n newClippers[j].addPlaneToConvexSet(plane2);\r\n }\r\n }\r\n }\r\n }\r\n }\r\n return UnionOfConvexClipPlaneSets.createConvexSets(newClippers);\r\n }\r\n}\r\nfunction moveFragments(\r\n fragments: GrowableXYZArray[],\r\n destination: GrowableXYZArray[] | undefined,\r\n arrayCache: GrowableXYZArrayCache) {\r\n if (destination === undefined)\r\n arrayCache.dropAllToCache(fragments);\r\n else {\r\n for (const f of fragments)\r\n destination.push(f);\r\n }\r\n fragments.length = 0;\r\n}\r\n/**\r\n * Distribute fragments among acceptedIn, acceptedOut, and passToNextStep as directed by action.\r\n * * If the indicated destination is unknown, drop the fragments to the arrayCache.\r\n * @param action destination selector\r\n * @param fragments fragments to be distributed\r\n * @param acceptedIn destination for \"in\"\r\n * @param acceptedOut destination for \"out\"\r\n * @param passToNextStep destination for fragments to be passed to a later step\r\n * @param arrayCache destination for un-distributed fragments.\r\n */\r\nfunction distributeFragments(\r\n action: ClipStepAction,\r\n fragments: GrowableXYZArray[],\r\n acceptedIn: GrowableXYZArray[] | undefined,\r\n acceptedOut: GrowableXYZArray[] | undefined,\r\n passToNextStep: GrowableXYZArray[] | undefined,\r\n arrayCache: GrowableXYZArrayCache) {\r\n let destination;\r\n if (action === ClipStepAction.acceptIn)\r\n destination = acceptedIn;\r\n else if (action === ClipStepAction.acceptOut)\r\n destination = acceptedOut;\r\n else if (action === ClipStepAction.passToNextStep)\r\n destination = passToNextStep;\r\n// remark: if action is other than the enum values, destination is undefined\r\n if (destination === undefined)\r\n arrayCache.dropAllToCache(fragments);\r\n else {\r\n for (const f of fragments)\r\n destination.push(f);\r\n }\r\n fragments.length = 0;\r\n}\r\n"]}
|
|
@@ -127,6 +127,7 @@ export * from "./geometry3d/Point3dArrayCarrier";
|
|
|
127
127
|
export * from "./geometry3d/PolylineOps";
|
|
128
128
|
export * from "./geometry3d/PolygonOps";
|
|
129
129
|
export * from "./geometry3d/Range";
|
|
130
|
+
export * from "./geometry3d/Ray2d";
|
|
130
131
|
export * from "./geometry3d/Ray3d";
|
|
131
132
|
export * from "./geometry3d/Segment1d";
|
|
132
133
|
export * from "./geometry3d/Transform";
|
|
@@ -171,17 +172,18 @@ export * from "./curve/CurveCurveIntersectXY";
|
|
|
171
172
|
export * from "./curve/CurveCurveIntersectXYZ";
|
|
172
173
|
export * from "./curve/CurveLocationDetail";
|
|
173
174
|
export * from "./curve/CurveFactory";
|
|
175
|
+
export * from "./curve/CurveOps";
|
|
174
176
|
export * from "./curve/CurvePrimitive";
|
|
175
177
|
export * from "./curve/CurveProcessor";
|
|
176
178
|
export * from "./curve/GeometryQuery";
|
|
177
179
|
export * from "./curve/LineSegment3d";
|
|
178
180
|
export * from "./curve/LineString3d";
|
|
179
181
|
export * from "./curve/Loop";
|
|
182
|
+
export * from "./curve/OffsetOptions";
|
|
180
183
|
export * from "./curve/ParityRegion";
|
|
181
184
|
export * from "./curve/Path";
|
|
182
185
|
export * from "./curve/RegionMomentsXY";
|
|
183
186
|
export * from "./curve/RegionOps";
|
|
184
|
-
export * from "./curve/internalContexts/PolygonOffsetContext";
|
|
185
187
|
export * from "./curve/PointString3d";
|
|
186
188
|
export * from "./curve/ProxyCurve";
|
|
187
189
|
export * from "./curve/StrokeOptions";
|
|
@@ -229,5 +231,4 @@ export * from "./serialization/IModelJsonSchema";
|
|
|
229
231
|
export * from "./serialization/DeepCompare";
|
|
230
232
|
export * from "./serialization/GeometrySamples";
|
|
231
233
|
export { BentleyGeometryFlatBuffer } from "./serialization/BentleyGeometryFlatBuffer";
|
|
232
|
-
export { MultiChainCollector } from "./curve/internalContexts/MultiChainCollector";
|
|
233
234
|
//# sourceMappingURL=core-geometry.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"core-geometry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yB,CAAC;AACxC,cAAc,8BAA8B,CAAC;AAC7C,cAAc,kBAAkB,CAAC;AACjC,cAAc,0BAA0B,CAAC;AACzC,cAAc,+BAA+B,CAAC;AAC9C,cAAc,kCAAkC,CAAC;AACjD,cAAc,6BAA6B,CAAC;AAC5C,cAAc,iCAAiC,CAAC;AAChD,OAAO,EAAE,yBAAyB,EAAE,MAAM,2CAA2C,CAAC"}
|
package/lib/cjs/core-geometry.js
CHANGED
|
@@ -18,7 +18,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
18
18
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
19
19
|
};
|
|
20
20
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
21
|
-
exports.
|
|
21
|
+
exports.BentleyGeometryFlatBuffer = void 0;
|
|
22
22
|
/** @packageDocumentation
|
|
23
23
|
* @module Utility
|
|
24
24
|
*/
|
|
@@ -163,6 +163,7 @@ __exportStar(require("./geometry3d/Point3dArrayCarrier"), exports);
|
|
|
163
163
|
__exportStar(require("./geometry3d/PolylineOps"), exports);
|
|
164
164
|
__exportStar(require("./geometry3d/PolygonOps"), exports);
|
|
165
165
|
__exportStar(require("./geometry3d/Range"), exports);
|
|
166
|
+
__exportStar(require("./geometry3d/Ray2d"), exports);
|
|
166
167
|
__exportStar(require("./geometry3d/Ray3d"), exports);
|
|
167
168
|
__exportStar(require("./geometry3d/Segment1d"), exports);
|
|
168
169
|
__exportStar(require("./geometry3d/Transform"), exports);
|
|
@@ -207,17 +208,18 @@ __exportStar(require("./curve/CurveCurveIntersectXY"), exports);
|
|
|
207
208
|
__exportStar(require("./curve/CurveCurveIntersectXYZ"), exports);
|
|
208
209
|
__exportStar(require("./curve/CurveLocationDetail"), exports);
|
|
209
210
|
__exportStar(require("./curve/CurveFactory"), exports);
|
|
211
|
+
__exportStar(require("./curve/CurveOps"), exports);
|
|
210
212
|
__exportStar(require("./curve/CurvePrimitive"), exports);
|
|
211
213
|
__exportStar(require("./curve/CurveProcessor"), exports);
|
|
212
214
|
__exportStar(require("./curve/GeometryQuery"), exports);
|
|
213
215
|
__exportStar(require("./curve/LineSegment3d"), exports);
|
|
214
216
|
__exportStar(require("./curve/LineString3d"), exports);
|
|
215
217
|
__exportStar(require("./curve/Loop"), exports);
|
|
218
|
+
__exportStar(require("./curve/OffsetOptions"), exports);
|
|
216
219
|
__exportStar(require("./curve/ParityRegion"), exports);
|
|
217
220
|
__exportStar(require("./curve/Path"), exports);
|
|
218
221
|
__exportStar(require("./curve/RegionMomentsXY"), exports);
|
|
219
222
|
__exportStar(require("./curve/RegionOps"), exports);
|
|
220
|
-
__exportStar(require("./curve/internalContexts/PolygonOffsetContext"), exports);
|
|
221
223
|
__exportStar(require("./curve/PointString3d"), exports);
|
|
222
224
|
__exportStar(require("./curve/ProxyCurve"), exports);
|
|
223
225
|
__exportStar(require("./curve/StrokeOptions"), exports);
|
|
@@ -266,7 +268,4 @@ __exportStar(require("./serialization/DeepCompare"), exports);
|
|
|
266
268
|
__exportStar(require("./serialization/GeometrySamples"), exports);
|
|
267
269
|
var BentleyGeometryFlatBuffer_1 = require("./serialization/BentleyGeometryFlatBuffer");
|
|
268
270
|
Object.defineProperty(exports, "BentleyGeometryFlatBuffer", { enumerable: true, get: function () { return BentleyGeometryFlatBuffer_1.BentleyGeometryFlatBuffer; } });
|
|
269
|
-
// temporary export for internal access pending exposure of this functionality via public API
|
|
270
|
-
var MultiChainCollector_1 = require("./curve/internalContexts/MultiChainCollector");
|
|
271
|
-
Object.defineProperty(exports, "MultiChainCollector", { enumerable: true, get: function () { return MultiChainCollector_1.MultiChainCollector; } });
|
|
272
271
|
//# sourceMappingURL=core-geometry.js.map
|