@itwin/core-geometry 4.2.0-dev.3 → 4.2.0-dev.31
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +69 -1
- package/lib/cjs/Geometry.d.ts +2 -2
- package/lib/cjs/Geometry.d.ts.map +1 -1
- package/lib/cjs/Geometry.js.map +1 -1
- package/lib/cjs/clipping/AlternatingConvexClipTree.d.ts +4 -3
- package/lib/cjs/clipping/AlternatingConvexClipTree.d.ts.map +1 -1
- package/lib/cjs/clipping/AlternatingConvexClipTree.js +1 -1
- package/lib/cjs/clipping/AlternatingConvexClipTree.js.map +1 -1
- package/lib/cjs/clipping/BooleanClipNode.d.ts +4 -3
- package/lib/cjs/clipping/BooleanClipNode.d.ts.map +1 -1
- package/lib/cjs/clipping/BooleanClipNode.js.map +1 -1
- package/lib/cjs/clipping/ClipPlane.d.ts +12 -8
- package/lib/cjs/clipping/ClipPlane.d.ts.map +1 -1
- package/lib/cjs/clipping/ClipPlane.js +5 -3
- package/lib/cjs/clipping/ClipPlane.js.map +1 -1
- package/lib/cjs/clipping/ClipUtils.d.ts +27 -9
- package/lib/cjs/clipping/ClipUtils.d.ts.map +1 -1
- package/lib/cjs/clipping/ClipUtils.js +84 -3
- package/lib/cjs/clipping/ClipUtils.js.map +1 -1
- package/lib/cjs/clipping/ClipVector.d.ts +6 -5
- package/lib/cjs/clipping/ClipVector.d.ts.map +1 -1
- package/lib/cjs/clipping/ClipVector.js +1 -1
- package/lib/cjs/clipping/ClipVector.js.map +1 -1
- package/lib/cjs/clipping/ConvexClipPlaneSet.d.ts +6 -4
- package/lib/cjs/clipping/ConvexClipPlaneSet.d.ts.map +1 -1
- package/lib/cjs/clipping/ConvexClipPlaneSet.js +3 -2
- package/lib/cjs/clipping/ConvexClipPlaneSet.js.map +1 -1
- package/lib/cjs/clipping/UnionOfConvexClipPlaneSets.d.ts +4 -3
- package/lib/cjs/clipping/UnionOfConvexClipPlaneSets.d.ts.map +1 -1
- package/lib/cjs/clipping/UnionOfConvexClipPlaneSets.js +2 -2
- package/lib/cjs/clipping/UnionOfConvexClipPlaneSets.js.map +1 -1
- package/lib/cjs/core-geometry.d.ts +1 -3
- package/lib/cjs/core-geometry.d.ts.map +1 -1
- package/lib/cjs/core-geometry.js +1 -3
- package/lib/cjs/core-geometry.js.map +1 -1
- package/lib/cjs/curve/Arc3d.d.ts.map +1 -1
- package/lib/cjs/curve/Arc3d.js +4 -4
- package/lib/cjs/curve/Arc3d.js.map +1 -1
- package/lib/cjs/curve/CoordinateXYZ.d.ts +15 -15
- package/lib/cjs/curve/CoordinateXYZ.d.ts.map +1 -1
- package/lib/cjs/curve/CoordinateXYZ.js +15 -15
- package/lib/cjs/curve/CoordinateXYZ.js.map +1 -1
- package/lib/cjs/curve/CurveChainWithDistanceIndex.js +1 -1
- package/lib/cjs/curve/CurveChainWithDistanceIndex.js.map +1 -1
- package/lib/cjs/curve/CurveCollection.d.ts +20 -20
- package/lib/cjs/curve/CurveCollection.d.ts.map +1 -1
- package/lib/cjs/curve/CurveCollection.js +21 -23
- package/lib/cjs/curve/CurveCollection.js.map +1 -1
- package/lib/cjs/curve/CurveCurve.d.ts +41 -26
- package/lib/cjs/curve/CurveCurve.d.ts.map +1 -1
- package/lib/cjs/curve/CurveCurve.js +73 -40
- package/lib/cjs/curve/CurveCurve.js.map +1 -1
- package/lib/cjs/curve/CurveFactory.d.ts +1 -1
- package/lib/cjs/curve/CurveFactory.js.map +1 -1
- package/lib/cjs/curve/CurveLocationDetail.d.ts +12 -1
- package/lib/cjs/curve/CurveLocationDetail.d.ts.map +1 -1
- package/lib/cjs/curve/CurveLocationDetail.js +13 -2
- package/lib/cjs/curve/CurveLocationDetail.js.map +1 -1
- package/lib/cjs/curve/CurveOps.d.ts +1 -1
- package/lib/cjs/curve/CurveOps.js.map +1 -1
- package/lib/cjs/curve/CurveProcessor.d.ts +1 -1
- package/lib/cjs/curve/CurveProcessor.js.map +1 -1
- package/lib/cjs/curve/CurveTypes.d.ts +19 -0
- package/lib/cjs/curve/CurveTypes.d.ts.map +1 -0
- package/lib/cjs/curve/{CurveChain.js → CurveTypes.js} +1 -1
- package/lib/cjs/curve/CurveTypes.js.map +1 -0
- package/lib/cjs/curve/CurveWireMomentsXYZ.d.ts +1 -1
- package/lib/cjs/curve/CurveWireMomentsXYZ.js.map +1 -1
- package/lib/cjs/curve/ParityRegion.d.ts +3 -3
- package/lib/cjs/curve/ParityRegion.d.ts.map +1 -1
- package/lib/cjs/curve/ParityRegion.js +2 -2
- package/lib/cjs/curve/ParityRegion.js.map +1 -1
- package/lib/cjs/curve/Path.d.ts +1 -1
- package/lib/cjs/curve/Path.d.ts.map +1 -1
- package/lib/cjs/curve/Path.js +1 -1
- package/lib/cjs/curve/Path.js.map +1 -1
- package/lib/cjs/curve/Query/ConsolidateAdjacentPrimitivesContext.d.ts +3 -2
- package/lib/cjs/curve/Query/ConsolidateAdjacentPrimitivesContext.d.ts.map +1 -1
- package/lib/cjs/curve/Query/ConsolidateAdjacentPrimitivesContext.js +2 -2
- package/lib/cjs/curve/Query/ConsolidateAdjacentPrimitivesContext.js.map +1 -1
- package/lib/cjs/curve/Query/CurveSplitContext.d.ts +1 -1
- package/lib/cjs/curve/Query/CurveSplitContext.js.map +1 -1
- package/lib/cjs/curve/Query/CylindricalRange.d.ts +1 -1
- package/lib/cjs/curve/Query/CylindricalRange.js.map +1 -1
- package/lib/cjs/curve/Query/InOutTests.d.ts +1 -1
- package/lib/cjs/curve/Query/InOutTests.js.map +1 -1
- package/lib/cjs/curve/Query/StrokeCountChain.d.ts +1 -1
- package/lib/cjs/curve/Query/StrokeCountChain.js.map +1 -1
- package/lib/cjs/curve/RegionOps.d.ts +54 -5
- package/lib/cjs/curve/RegionOps.d.ts.map +1 -1
- package/lib/cjs/curve/RegionOps.js +154 -3
- package/lib/cjs/curve/RegionOps.js.map +1 -1
- package/lib/cjs/curve/RegionOpsClassificationSweeps.d.ts +1 -1
- package/lib/cjs/curve/RegionOpsClassificationSweeps.js.map +1 -1
- package/lib/cjs/curve/StrokeOptions.d.ts +20 -11
- package/lib/cjs/curve/StrokeOptions.d.ts.map +1 -1
- package/lib/cjs/curve/StrokeOptions.js +22 -11
- package/lib/cjs/curve/StrokeOptions.js.map +1 -1
- package/lib/cjs/curve/UnionRegion.d.ts +3 -3
- package/lib/cjs/curve/UnionRegion.d.ts.map +1 -1
- package/lib/cjs/curve/UnionRegion.js +3 -3
- package/lib/cjs/curve/UnionRegion.js.map +1 -1
- package/lib/cjs/curve/internalContexts/CurveCurveCloseApproachXY.d.ts +225 -0
- package/lib/cjs/curve/internalContexts/CurveCurveCloseApproachXY.d.ts.map +1 -0
- package/lib/cjs/curve/{CurveCurveCloseApproachXY.js → internalContexts/CurveCurveCloseApproachXY.js} +249 -189
- package/lib/cjs/curve/internalContexts/CurveCurveCloseApproachXY.js.map +1 -0
- package/lib/{esm/curve → cjs/curve/internalContexts}/CurveCurveIntersectXY.d.ts +14 -27
- package/lib/cjs/curve/internalContexts/CurveCurveIntersectXY.d.ts.map +1 -0
- package/lib/cjs/curve/{CurveCurveIntersectXY.js → internalContexts/CurveCurveIntersectXY.js} +31 -42
- package/lib/cjs/curve/internalContexts/CurveCurveIntersectXY.js.map +1 -0
- package/lib/cjs/curve/{CurveCurveIntersectXYZ.d.ts → internalContexts/CurveCurveIntersectXYZ.d.ts} +11 -12
- package/lib/cjs/curve/internalContexts/CurveCurveIntersectXYZ.d.ts.map +1 -0
- package/lib/cjs/curve/{CurveCurveIntersectXYZ.js → internalContexts/CurveCurveIntersectXYZ.js} +12 -14
- package/lib/cjs/curve/internalContexts/CurveCurveIntersectXYZ.js.map +1 -0
- package/lib/cjs/curve/internalContexts/MultiChainCollector.d.ts +1 -1
- package/lib/cjs/curve/internalContexts/MultiChainCollector.js.map +1 -1
- package/lib/cjs/geometry3d/BarycentricTriangle.d.ts +1 -0
- package/lib/cjs/geometry3d/BarycentricTriangle.d.ts.map +1 -1
- package/lib/cjs/geometry3d/BarycentricTriangle.js +1 -0
- package/lib/cjs/geometry3d/BarycentricTriangle.js.map +1 -1
- package/lib/cjs/geometry3d/FrameBuilder.d.ts +57 -36
- package/lib/cjs/geometry3d/FrameBuilder.d.ts.map +1 -1
- package/lib/cjs/geometry3d/FrameBuilder.js +99 -74
- package/lib/cjs/geometry3d/FrameBuilder.js.map +1 -1
- package/lib/cjs/geometry3d/GeometryHandler.d.ts +3 -10
- package/lib/cjs/geometry3d/GeometryHandler.d.ts.map +1 -1
- package/lib/cjs/geometry3d/GeometryHandler.js +2 -6
- package/lib/cjs/geometry3d/GeometryHandler.js.map +1 -1
- package/lib/cjs/geometry3d/GrowableXYZArray.d.ts +0 -8
- package/lib/cjs/geometry3d/GrowableXYZArray.d.ts.map +1 -1
- package/lib/cjs/geometry3d/GrowableXYZArray.js +0 -16
- package/lib/cjs/geometry3d/GrowableXYZArray.js.map +1 -1
- package/lib/cjs/geometry3d/IndexedXYZCollection.d.ts +4 -4
- package/lib/cjs/geometry3d/IndexedXYZCollection.d.ts.map +1 -1
- package/lib/cjs/geometry3d/IndexedXYZCollection.js +12 -0
- package/lib/cjs/geometry3d/IndexedXYZCollection.js.map +1 -1
- package/lib/cjs/geometry3d/Matrix3d.d.ts.map +1 -1
- package/lib/cjs/geometry3d/Matrix3d.js +3 -6
- package/lib/cjs/geometry3d/Matrix3d.js.map +1 -1
- package/lib/cjs/geometry3d/Point3dArrayCarrier.d.ts.map +1 -1
- package/lib/cjs/geometry3d/Point3dArrayCarrier.js.map +1 -1
- package/lib/cjs/geometry3d/Point3dVector3d.d.ts +1 -2
- package/lib/cjs/geometry3d/Point3dVector3d.d.ts.map +1 -1
- package/lib/cjs/geometry3d/Point3dVector3d.js +0 -1
- package/lib/cjs/geometry3d/Point3dVector3d.js.map +1 -1
- package/lib/cjs/geometry3d/PolygonOps.d.ts +2 -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.d.ts +1 -1
- package/lib/cjs/geometry3d/Range.js +1 -1
- package/lib/cjs/geometry3d/Range.js.map +1 -1
- package/lib/cjs/geometry3d/Ray3d.d.ts +3 -1
- package/lib/cjs/geometry3d/Ray3d.d.ts.map +1 -1
- package/lib/cjs/geometry3d/Ray3d.js +4 -3
- package/lib/cjs/geometry3d/Ray3d.js.map +1 -1
- package/lib/cjs/geometry3d/ReusableObjectCache.d.ts +2 -1
- package/lib/cjs/geometry3d/ReusableObjectCache.d.ts.map +1 -1
- package/lib/cjs/geometry3d/ReusableObjectCache.js +1 -1
- package/lib/cjs/geometry3d/ReusableObjectCache.js.map +1 -1
- package/lib/cjs/geometry3d/SortablePolygon.d.ts +1 -1
- package/lib/cjs/geometry3d/SortablePolygon.js.map +1 -1
- package/lib/cjs/geometry3d/Transform.d.ts.map +1 -1
- package/lib/cjs/geometry3d/Transform.js +4 -6
- package/lib/cjs/geometry3d/Transform.js.map +1 -1
- package/lib/cjs/geometry3d/YawPitchRollAngles.js +1 -1
- package/lib/cjs/geometry3d/YawPitchRollAngles.js.map +1 -1
- package/lib/cjs/geometry4d/Matrix4d.d.ts.map +1 -1
- package/lib/cjs/geometry4d/Matrix4d.js +4 -2
- package/lib/cjs/geometry4d/Matrix4d.js.map +1 -1
- package/lib/cjs/geometry4d/Point4d.js.map +1 -1
- package/lib/cjs/numerics/Polynomials.d.ts +2 -2
- package/lib/cjs/numerics/Polynomials.d.ts.map +1 -1
- package/lib/cjs/numerics/Polynomials.js +2 -2
- package/lib/cjs/numerics/Polynomials.js.map +1 -1
- package/lib/cjs/polyface/PolyfaceBuilder.d.ts +18 -6
- package/lib/cjs/polyface/PolyfaceBuilder.d.ts.map +1 -1
- package/lib/cjs/polyface/PolyfaceBuilder.js +48 -15
- package/lib/cjs/polyface/PolyfaceBuilder.js.map +1 -1
- package/lib/cjs/polyface/PolyfaceClip.d.ts +16 -7
- package/lib/cjs/polyface/PolyfaceClip.d.ts.map +1 -1
- package/lib/cjs/polyface/PolyfaceClip.js +38 -7
- package/lib/cjs/polyface/PolyfaceClip.js.map +1 -1
- package/lib/cjs/polyface/PolyfaceData.d.ts +5 -39
- package/lib/cjs/polyface/PolyfaceData.d.ts.map +1 -1
- package/lib/cjs/polyface/PolyfaceData.js +7 -41
- package/lib/cjs/polyface/PolyfaceData.js.map +1 -1
- package/lib/cjs/polyface/PolyfaceQuery.d.ts +10 -8
- package/lib/cjs/polyface/PolyfaceQuery.d.ts.map +1 -1
- package/lib/cjs/polyface/PolyfaceQuery.js +64 -18
- package/lib/cjs/polyface/PolyfaceQuery.js.map +1 -1
- package/lib/cjs/serialization/GeometrySamples.d.ts +6 -0
- package/lib/cjs/serialization/GeometrySamples.d.ts.map +1 -1
- package/lib/cjs/serialization/GeometrySamples.js +61 -1
- package/lib/cjs/serialization/GeometrySamples.js.map +1 -1
- package/lib/cjs/solid/LinearSweep.d.ts +1 -1
- package/lib/cjs/solid/LinearSweep.js.map +1 -1
- package/lib/cjs/solid/RotationalSweep.d.ts +1 -1
- package/lib/cjs/solid/RotationalSweep.js.map +1 -1
- package/lib/cjs/solid/RuledSweep.d.ts +1 -1
- package/lib/cjs/solid/RuledSweep.js.map +1 -1
- package/lib/cjs/solid/SweepContour.d.ts +35 -26
- package/lib/cjs/solid/SweepContour.d.ts.map +1 -1
- package/lib/cjs/solid/SweepContour.js +84 -100
- package/lib/cjs/solid/SweepContour.js.map +1 -1
- package/lib/cjs/topology/Graph.d.ts +29 -11
- package/lib/cjs/topology/Graph.d.ts.map +1 -1
- package/lib/cjs/topology/Graph.js +45 -26
- package/lib/cjs/topology/Graph.js.map +1 -1
- package/lib/cjs/topology/HalfEdgeMarkSet.d.ts +2 -2
- package/lib/cjs/topology/HalfEdgeMarkSet.d.ts.map +1 -1
- package/lib/cjs/topology/HalfEdgeMarkSet.js +4 -4
- package/lib/cjs/topology/HalfEdgeMarkSet.js.map +1 -1
- package/lib/cjs/topology/Merging.d.ts +3 -0
- package/lib/cjs/topology/Merging.d.ts.map +1 -1
- package/lib/cjs/topology/Merging.js +19 -5
- package/lib/cjs/topology/Merging.js.map +1 -1
- package/lib/cjs/topology/Triangulation.d.ts +15 -7
- package/lib/cjs/topology/Triangulation.d.ts.map +1 -1
- package/lib/cjs/topology/Triangulation.js +89 -47
- package/lib/cjs/topology/Triangulation.js.map +1 -1
- package/lib/esm/Geometry.d.ts +2 -2
- package/lib/esm/Geometry.d.ts.map +1 -1
- package/lib/esm/Geometry.js.map +1 -1
- package/lib/esm/clipping/AlternatingConvexClipTree.d.ts +4 -3
- package/lib/esm/clipping/AlternatingConvexClipTree.d.ts.map +1 -1
- package/lib/esm/clipping/AlternatingConvexClipTree.js +1 -1
- package/lib/esm/clipping/AlternatingConvexClipTree.js.map +1 -1
- package/lib/esm/clipping/BooleanClipNode.d.ts +4 -3
- package/lib/esm/clipping/BooleanClipNode.d.ts.map +1 -1
- package/lib/esm/clipping/BooleanClipNode.js.map +1 -1
- package/lib/esm/clipping/ClipPlane.d.ts +12 -8
- package/lib/esm/clipping/ClipPlane.d.ts.map +1 -1
- package/lib/esm/clipping/ClipPlane.js +5 -3
- package/lib/esm/clipping/ClipPlane.js.map +1 -1
- package/lib/esm/clipping/ClipUtils.d.ts +27 -9
- package/lib/esm/clipping/ClipUtils.d.ts.map +1 -1
- package/lib/esm/clipping/ClipUtils.js +84 -3
- package/lib/esm/clipping/ClipUtils.js.map +1 -1
- package/lib/esm/clipping/ClipVector.d.ts +6 -5
- package/lib/esm/clipping/ClipVector.d.ts.map +1 -1
- package/lib/esm/clipping/ClipVector.js +1 -1
- package/lib/esm/clipping/ClipVector.js.map +1 -1
- package/lib/esm/clipping/ConvexClipPlaneSet.d.ts +6 -4
- package/lib/esm/clipping/ConvexClipPlaneSet.d.ts.map +1 -1
- package/lib/esm/clipping/ConvexClipPlaneSet.js +3 -2
- package/lib/esm/clipping/ConvexClipPlaneSet.js.map +1 -1
- package/lib/esm/clipping/UnionOfConvexClipPlaneSets.d.ts +4 -3
- package/lib/esm/clipping/UnionOfConvexClipPlaneSets.d.ts.map +1 -1
- package/lib/esm/clipping/UnionOfConvexClipPlaneSets.js +2 -2
- package/lib/esm/clipping/UnionOfConvexClipPlaneSets.js.map +1 -1
- package/lib/esm/core-geometry.d.ts +1 -3
- package/lib/esm/core-geometry.d.ts.map +1 -1
- package/lib/esm/core-geometry.js +1 -3
- package/lib/esm/core-geometry.js.map +1 -1
- package/lib/esm/curve/Arc3d.d.ts.map +1 -1
- package/lib/esm/curve/Arc3d.js +4 -4
- package/lib/esm/curve/Arc3d.js.map +1 -1
- package/lib/esm/curve/CoordinateXYZ.d.ts +15 -15
- package/lib/esm/curve/CoordinateXYZ.d.ts.map +1 -1
- package/lib/esm/curve/CoordinateXYZ.js +15 -15
- package/lib/esm/curve/CoordinateXYZ.js.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 +20 -20
- package/lib/esm/curve/CurveCollection.d.ts.map +1 -1
- package/lib/esm/curve/CurveCollection.js +20 -21
- package/lib/esm/curve/CurveCollection.js.map +1 -1
- package/lib/esm/curve/CurveCurve.d.ts +41 -26
- package/lib/esm/curve/CurveCurve.d.ts.map +1 -1
- package/lib/esm/curve/CurveCurve.js +73 -40
- package/lib/esm/curve/CurveCurve.js.map +1 -1
- package/lib/esm/curve/CurveFactory.d.ts +1 -1
- package/lib/esm/curve/CurveFactory.js.map +1 -1
- package/lib/esm/curve/CurveLocationDetail.d.ts +12 -1
- package/lib/esm/curve/CurveLocationDetail.d.ts.map +1 -1
- package/lib/esm/curve/CurveLocationDetail.js +11 -1
- package/lib/esm/curve/CurveLocationDetail.js.map +1 -1
- package/lib/esm/curve/CurveOps.d.ts +1 -1
- package/lib/esm/curve/CurveOps.js.map +1 -1
- package/lib/esm/curve/CurveProcessor.d.ts +1 -1
- package/lib/esm/curve/CurveProcessor.js.map +1 -1
- package/lib/esm/curve/CurveTypes.d.ts +19 -0
- package/lib/esm/curve/CurveTypes.d.ts.map +1 -0
- package/lib/esm/curve/{CurveChain.js → CurveTypes.js} +1 -1
- package/lib/esm/curve/CurveTypes.js.map +1 -0
- package/lib/esm/curve/CurveWireMomentsXYZ.d.ts +1 -1
- package/lib/esm/curve/CurveWireMomentsXYZ.js.map +1 -1
- package/lib/esm/curve/ParityRegion.d.ts +3 -3
- package/lib/esm/curve/ParityRegion.d.ts.map +1 -1
- package/lib/esm/curve/ParityRegion.js +2 -2
- package/lib/esm/curve/ParityRegion.js.map +1 -1
- package/lib/esm/curve/Path.d.ts +1 -1
- package/lib/esm/curve/Path.d.ts.map +1 -1
- package/lib/esm/curve/Path.js +1 -1
- package/lib/esm/curve/Path.js.map +1 -1
- package/lib/esm/curve/Query/ConsolidateAdjacentPrimitivesContext.d.ts +3 -2
- package/lib/esm/curve/Query/ConsolidateAdjacentPrimitivesContext.d.ts.map +1 -1
- package/lib/esm/curve/Query/ConsolidateAdjacentPrimitivesContext.js +1 -1
- package/lib/esm/curve/Query/ConsolidateAdjacentPrimitivesContext.js.map +1 -1
- package/lib/esm/curve/Query/CurveSplitContext.d.ts +1 -1
- package/lib/esm/curve/Query/CurveSplitContext.js.map +1 -1
- package/lib/esm/curve/Query/CylindricalRange.d.ts +1 -1
- package/lib/esm/curve/Query/CylindricalRange.js.map +1 -1
- package/lib/esm/curve/Query/InOutTests.d.ts +1 -1
- package/lib/esm/curve/Query/InOutTests.js.map +1 -1
- package/lib/esm/curve/Query/StrokeCountChain.d.ts +1 -1
- package/lib/esm/curve/Query/StrokeCountChain.js.map +1 -1
- package/lib/esm/curve/RegionOps.d.ts +54 -5
- package/lib/esm/curve/RegionOps.d.ts.map +1 -1
- package/lib/esm/curve/RegionOps.js +153 -3
- package/lib/esm/curve/RegionOps.js.map +1 -1
- package/lib/esm/curve/RegionOpsClassificationSweeps.d.ts +1 -1
- package/lib/esm/curve/RegionOpsClassificationSweeps.js.map +1 -1
- package/lib/esm/curve/StrokeOptions.d.ts +20 -11
- package/lib/esm/curve/StrokeOptions.d.ts.map +1 -1
- package/lib/esm/curve/StrokeOptions.js +22 -11
- package/lib/esm/curve/StrokeOptions.js.map +1 -1
- package/lib/esm/curve/UnionRegion.d.ts +3 -3
- package/lib/esm/curve/UnionRegion.d.ts.map +1 -1
- package/lib/esm/curve/UnionRegion.js +3 -3
- package/lib/esm/curve/UnionRegion.js.map +1 -1
- package/lib/esm/curve/internalContexts/CurveCurveCloseApproachXY.d.ts +225 -0
- package/lib/esm/curve/internalContexts/CurveCurveCloseApproachXY.d.ts.map +1 -0
- package/lib/esm/curve/{CurveCurveCloseApproachXY.js → internalContexts/CurveCurveCloseApproachXY.js} +249 -189
- package/lib/esm/curve/internalContexts/CurveCurveCloseApproachXY.js.map +1 -0
- package/lib/{cjs/curve → esm/curve/internalContexts}/CurveCurveIntersectXY.d.ts +14 -27
- package/lib/esm/curve/internalContexts/CurveCurveIntersectXY.d.ts.map +1 -0
- package/lib/esm/curve/{CurveCurveIntersectXY.js → internalContexts/CurveCurveIntersectXY.js} +30 -40
- package/lib/esm/curve/internalContexts/CurveCurveIntersectXY.js.map +1 -0
- package/lib/esm/curve/{CurveCurveIntersectXYZ.d.ts → internalContexts/CurveCurveIntersectXYZ.d.ts} +11 -12
- package/lib/esm/curve/internalContexts/CurveCurveIntersectXYZ.d.ts.map +1 -0
- package/lib/esm/curve/{CurveCurveIntersectXYZ.js → internalContexts/CurveCurveIntersectXYZ.js} +11 -13
- package/lib/esm/curve/internalContexts/CurveCurveIntersectXYZ.js.map +1 -0
- package/lib/esm/curve/internalContexts/MultiChainCollector.d.ts +1 -1
- package/lib/esm/curve/internalContexts/MultiChainCollector.js.map +1 -1
- package/lib/esm/geometry3d/BarycentricTriangle.d.ts +1 -0
- package/lib/esm/geometry3d/BarycentricTriangle.d.ts.map +1 -1
- package/lib/esm/geometry3d/BarycentricTriangle.js +1 -0
- package/lib/esm/geometry3d/BarycentricTriangle.js.map +1 -1
- package/lib/esm/geometry3d/FrameBuilder.d.ts +57 -36
- package/lib/esm/geometry3d/FrameBuilder.d.ts.map +1 -1
- package/lib/esm/geometry3d/FrameBuilder.js +99 -74
- package/lib/esm/geometry3d/FrameBuilder.js.map +1 -1
- package/lib/esm/geometry3d/GeometryHandler.d.ts +3 -10
- package/lib/esm/geometry3d/GeometryHandler.d.ts.map +1 -1
- package/lib/esm/geometry3d/GeometryHandler.js +2 -6
- package/lib/esm/geometry3d/GeometryHandler.js.map +1 -1
- package/lib/esm/geometry3d/GrowableXYZArray.d.ts +0 -8
- package/lib/esm/geometry3d/GrowableXYZArray.d.ts.map +1 -1
- package/lib/esm/geometry3d/GrowableXYZArray.js +0 -16
- package/lib/esm/geometry3d/GrowableXYZArray.js.map +1 -1
- package/lib/esm/geometry3d/IndexedXYZCollection.d.ts +4 -4
- package/lib/esm/geometry3d/IndexedXYZCollection.d.ts.map +1 -1
- package/lib/esm/geometry3d/IndexedXYZCollection.js +12 -0
- package/lib/esm/geometry3d/IndexedXYZCollection.js.map +1 -1
- package/lib/esm/geometry3d/Matrix3d.d.ts.map +1 -1
- package/lib/esm/geometry3d/Matrix3d.js +3 -6
- package/lib/esm/geometry3d/Matrix3d.js.map +1 -1
- package/lib/esm/geometry3d/Point3dArrayCarrier.d.ts.map +1 -1
- package/lib/esm/geometry3d/Point3dArrayCarrier.js.map +1 -1
- package/lib/esm/geometry3d/Point3dVector3d.d.ts +1 -2
- package/lib/esm/geometry3d/Point3dVector3d.d.ts.map +1 -1
- package/lib/esm/geometry3d/Point3dVector3d.js +0 -1
- package/lib/esm/geometry3d/Point3dVector3d.js.map +1 -1
- package/lib/esm/geometry3d/PolygonOps.d.ts +2 -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.d.ts +1 -1
- package/lib/esm/geometry3d/Range.js +1 -1
- package/lib/esm/geometry3d/Range.js.map +1 -1
- package/lib/esm/geometry3d/Ray3d.d.ts +3 -1
- package/lib/esm/geometry3d/Ray3d.d.ts.map +1 -1
- package/lib/esm/geometry3d/Ray3d.js +4 -3
- package/lib/esm/geometry3d/Ray3d.js.map +1 -1
- package/lib/esm/geometry3d/ReusableObjectCache.d.ts +2 -1
- package/lib/esm/geometry3d/ReusableObjectCache.d.ts.map +1 -1
- package/lib/esm/geometry3d/ReusableObjectCache.js +1 -1
- package/lib/esm/geometry3d/ReusableObjectCache.js.map +1 -1
- package/lib/esm/geometry3d/SortablePolygon.d.ts +1 -1
- package/lib/esm/geometry3d/SortablePolygon.js.map +1 -1
- package/lib/esm/geometry3d/Transform.d.ts.map +1 -1
- package/lib/esm/geometry3d/Transform.js +4 -6
- package/lib/esm/geometry3d/Transform.js.map +1 -1
- package/lib/esm/geometry3d/YawPitchRollAngles.js +1 -1
- package/lib/esm/geometry3d/YawPitchRollAngles.js.map +1 -1
- package/lib/esm/geometry4d/Matrix4d.d.ts.map +1 -1
- package/lib/esm/geometry4d/Matrix4d.js +4 -2
- package/lib/esm/geometry4d/Matrix4d.js.map +1 -1
- package/lib/esm/geometry4d/Point4d.js.map +1 -1
- package/lib/esm/numerics/Polynomials.d.ts +2 -2
- package/lib/esm/numerics/Polynomials.d.ts.map +1 -1
- package/lib/esm/numerics/Polynomials.js +2 -2
- package/lib/esm/numerics/Polynomials.js.map +1 -1
- package/lib/esm/polyface/PolyfaceBuilder.d.ts +18 -6
- package/lib/esm/polyface/PolyfaceBuilder.d.ts.map +1 -1
- package/lib/esm/polyface/PolyfaceBuilder.js +48 -15
- package/lib/esm/polyface/PolyfaceBuilder.js.map +1 -1
- package/lib/esm/polyface/PolyfaceClip.d.ts +16 -7
- package/lib/esm/polyface/PolyfaceClip.d.ts.map +1 -1
- package/lib/esm/polyface/PolyfaceClip.js +38 -7
- package/lib/esm/polyface/PolyfaceClip.js.map +1 -1
- package/lib/esm/polyface/PolyfaceData.d.ts +5 -39
- package/lib/esm/polyface/PolyfaceData.d.ts.map +1 -1
- package/lib/esm/polyface/PolyfaceData.js +7 -41
- package/lib/esm/polyface/PolyfaceData.js.map +1 -1
- package/lib/esm/polyface/PolyfaceQuery.d.ts +10 -8
- package/lib/esm/polyface/PolyfaceQuery.d.ts.map +1 -1
- package/lib/esm/polyface/PolyfaceQuery.js +64 -18
- package/lib/esm/polyface/PolyfaceQuery.js.map +1 -1
- package/lib/esm/serialization/GeometrySamples.d.ts +6 -0
- package/lib/esm/serialization/GeometrySamples.d.ts.map +1 -1
- package/lib/esm/serialization/GeometrySamples.js +61 -1
- package/lib/esm/serialization/GeometrySamples.js.map +1 -1
- package/lib/esm/solid/LinearSweep.d.ts +1 -1
- package/lib/esm/solid/LinearSweep.js.map +1 -1
- package/lib/esm/solid/RotationalSweep.d.ts +1 -1
- package/lib/esm/solid/RotationalSweep.js.map +1 -1
- package/lib/esm/solid/RuledSweep.d.ts +1 -1
- package/lib/esm/solid/RuledSweep.js.map +1 -1
- package/lib/esm/solid/SweepContour.d.ts +35 -26
- package/lib/esm/solid/SweepContour.d.ts.map +1 -1
- package/lib/esm/solid/SweepContour.js +84 -100
- package/lib/esm/solid/SweepContour.js.map +1 -1
- package/lib/esm/topology/Graph.d.ts +29 -11
- package/lib/esm/topology/Graph.d.ts.map +1 -1
- package/lib/esm/topology/Graph.js +45 -26
- package/lib/esm/topology/Graph.js.map +1 -1
- package/lib/esm/topology/HalfEdgeMarkSet.d.ts +2 -2
- package/lib/esm/topology/HalfEdgeMarkSet.d.ts.map +1 -1
- package/lib/esm/topology/HalfEdgeMarkSet.js +2 -2
- package/lib/esm/topology/HalfEdgeMarkSet.js.map +1 -1
- package/lib/esm/topology/Merging.d.ts +3 -0
- package/lib/esm/topology/Merging.d.ts.map +1 -1
- package/lib/esm/topology/Merging.js +19 -5
- package/lib/esm/topology/Merging.js.map +1 -1
- package/lib/esm/topology/Triangulation.d.ts +15 -7
- package/lib/esm/topology/Triangulation.d.ts.map +1 -1
- package/lib/esm/topology/Triangulation.js +89 -47
- package/lib/esm/topology/Triangulation.js.map +1 -1
- package/package.json +4 -4
- package/lib/cjs/curve/CurveChain.d.ts +0 -17
- package/lib/cjs/curve/CurveChain.d.ts.map +0 -1
- package/lib/cjs/curve/CurveChain.js.map +0 -1
- package/lib/cjs/curve/CurveCurveCloseApproachXY.d.ts +0 -164
- package/lib/cjs/curve/CurveCurveCloseApproachXY.d.ts.map +0 -1
- package/lib/cjs/curve/CurveCurveCloseApproachXY.js.map +0 -1
- package/lib/cjs/curve/CurveCurveIntersectXY.d.ts.map +0 -1
- package/lib/cjs/curve/CurveCurveIntersectXY.js.map +0 -1
- package/lib/cjs/curve/CurveCurveIntersectXYZ.d.ts.map +0 -1
- package/lib/cjs/curve/CurveCurveIntersectXYZ.js.map +0 -1
- package/lib/esm/curve/CurveChain.d.ts +0 -17
- package/lib/esm/curve/CurveChain.d.ts.map +0 -1
- package/lib/esm/curve/CurveChain.js.map +0 -1
- package/lib/esm/curve/CurveCurveCloseApproachXY.d.ts +0 -164
- package/lib/esm/curve/CurveCurveCloseApproachXY.d.ts.map +0 -1
- package/lib/esm/curve/CurveCurveCloseApproachXY.js.map +0 -1
- package/lib/esm/curve/CurveCurveIntersectXY.d.ts.map +0 -1
- package/lib/esm/curve/CurveCurveIntersectXY.js.map +0 -1
- package/lib/esm/curve/CurveCurveIntersectXYZ.d.ts.map +0 -1
- package/lib/esm/curve/CurveCurveIntersectXYZ.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ClipPlane.js","sourceRoot":"","sources":["../../../src/clipping/ClipPlane.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAQ/F,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAGlD,OAAO,EAAE,oBAAoB,EAAE,MAAM,oCAAoC,CAAC;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,CAAC,aAAa,EAAE,CAAC;QAC7C,MAAM,UAAU,GAAG,UAAU,CAAC,aAAa,EAAE,CAAC;QAC9C,8BAA8B,CAAC,oCAAoC,CACjE,IAAI,EAAE,GAAG,EAAE,SAAS,EAAE,UAAU,EAAE,kBAAkB,CACrD,CAAC;QACF,aAAa,CAAC,aAAa,CAAC,SAAS,EAAE,CAAC,EAAE,eAAe,EAAE,UAAU,CAAC,CAAC;QACvE,aAAa,CAAC,aAAa,CAAC,UAAU,EAAE,CAAC,EAAE,gBAAgB,EAAE,UAAU,CAAC,CAAC;IAC3E,CAAC;IACD,6CAA6C;IACtC,mBAAmB,CAAC,UAAmB,EAAE,MAAgB;QAC9D,MAAM,CAAC,GAAG,CAAC,IAAI,CAAC,QAAQ,CAAC,UAAU,CAAC,CAAC;QACrC,OAAO,UAAU,CAAC,OAAO,CAAC,CAAC,GAAG,IAAI,CAAC,aAAa,CAAC,CAAC,EAAE,CAAC,GAAG,IAAI,CAAC,aAAa,CAAC,CAAC,EAAE,CAAC,GAAG,IAAI,CAAC,aAAa,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC;IAClH,CAAC;;AAvMc,+BAAqB,GAAG,IAAI,oBAAoB,EAAE,CAAC;SAhXvD,SAAS","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n\r\n/** @packageDocumentation\r\n * @module CartesianGeometry\r\n */\r\n\r\nimport { Arc3d } from \"../curve/Arc3d\";\r\nimport { AnnounceNumberNumberCurvePrimitive } from \"../curve/CurvePrimitive\";\r\nimport { AxisOrder, Geometry } from \"../Geometry\";\r\nimport { Angle } from \"../geometry3d/Angle\";\r\nimport { XYZProps } from \"../geometry3d/XYZProps\";\r\nimport { GrowableFloat64Array } from \"../geometry3d/GrowableFloat64Array\";\r\nimport { GrowableXYZArray } from \"../geometry3d/GrowableXYZArray\";\r\nimport { Matrix3d } from \"../geometry3d/Matrix3d\";\r\nimport { Plane3dByOriginAndUnitNormal } from \"../geometry3d/Plane3dByOriginAndUnitNormal\";\r\nimport { Point3d, Vector3d } from \"../geometry3d/Point3dVector3d\";\r\nimport { IndexedXYZCollectionPolygonOps } from \"../geometry3d/PolygonOps\";\r\nimport { Range1d, Range3d } from \"../geometry3d/Range\";\r\nimport { Transform } from \"../geometry3d/Transform\";\r\nimport { Matrix4d } from \"../geometry4d/Matrix4d\";\r\nimport { Point4d } from \"../geometry4d/Point4d\";\r\nimport { AnalyticRoots } from \"../numerics/Polynomials\";\r\nimport { Clipper, ClipUtilities, PolygonClipper } from \"./ClipUtils\";\r\nimport { GrowableXYZArrayCache } from \"../geometry3d/ReusableObjectCache\";\r\nimport { Plane3d } from \"../geometry3d/Plane3d\";\r\n\r\n/** Wire format describing a [[ClipPlane]].\r\n * If either [[normal]] or [[dist]] are omitted, defaults to a normal of [[Vector3d.unitZ]] and a distance of zero.\r\n * @public\r\n */\r\nexport interface ClipPlaneProps {\r\n /** The plane's inward normal. */\r\n normal?: XYZProps;\r\n /** The plane's distance from the origin. */\r\n dist?: number;\r\n /** Defaults to `false`. */\r\n invisible?: boolean;\r\n /** Defaults to `false`. */\r\n interior?: boolean;\r\n}\r\n\r\n/**\r\n * A ClipPlane is a single plane represented as\r\n * * An inward unit normal (u,v,w)\r\n * * A signedDistance\r\n *\r\n * Hence\r\n * * The halfspace function evaluation for \"point\" (x,y,z) is `(x,y,z) DOT (u,v,w) - signedDistance`.\r\n * * POSITIVE values of the halfspace function are \"inside\".\r\n * * ZERO value of the halfspace function is \"on\".\r\n * * NEGATIVE value of the halfspace function is \"outside\".\r\n * * A representative point on the plane is (signedDistance * u, signedDistance * v, signedDistance * w).\r\n * * Given a point on the plane and the inward normal of the plane, `signedDistance = point DOT normal`.\r\n * @public\r\n */\r\nexport class ClipPlane extends Plane3d implements Clipper, PolygonClipper {\r\n private _inwardNormal: Vector3d;\r\n /**\r\n * Construct a parallel plane through the origin.\r\n * * Move it to the actual position.\r\n * * _distanceFromOrigin is the distance it moved, with the (inward) normal direction as positive\r\n */\r\n private _distanceFromOrigin: number;\r\n private _invisible: boolean;\r\n private _interior: boolean;\r\n\r\n private constructor(normal: Vector3d, distance: number, invisible: boolean, interior: boolean) {\r\n super();\r\n this._invisible = invisible;\r\n this._interior = interior;\r\n this._inwardNormal = normal;\r\n this._distanceFromOrigin = distance;\r\n }\r\n /*\r\n private safeSetXYZDistance(nx: number, ny: number, nz: number, d: number) {\r\n this._inwardNormal.set(nx, ny, nz);\r\n this._distanceFromOrigin = d;\r\n }\r\n */\r\n /**\r\n * Return true if all members are almostEqual to corresponding members of other.\r\n * @param other clip plane to compare\r\n */\r\n public isAlmostEqual(other: ClipPlane): boolean {\r\n return Geometry.isSameCoordinate(this._distanceFromOrigin, other._distanceFromOrigin)\r\n && this._inwardNormal.isAlmostEqual(other._inwardNormal)\r\n && this._interior === other._interior\r\n && this._invisible === other._invisible;\r\n }\r\n /** Return a cloned plane */\r\n public clone(): ClipPlane {\r\n const result = new ClipPlane(this._inwardNormal.clone(), this._distanceFromOrigin, this._invisible, this._interior);\r\n return result;\r\n }\r\n /** Return a cloned plane with coordinate data negated. */\r\n public cloneNegated(): ClipPlane {\r\n const plane = new ClipPlane(this._inwardNormal.clone(), this._distanceFromOrigin, this._invisible, this._interior);\r\n plane.negateInPlace();\r\n return plane;\r\n }\r\n /** Create a ClipPlane from Plane3dByOriginAndUnitNormal. */\r\n public static createPlane(\r\n plane: Plane3dByOriginAndUnitNormal, invisible: boolean = false, interior: boolean = false, result?: ClipPlane,\r\n ): ClipPlane {\r\n const distance = plane.getNormalRef().dotProduct(plane.getOriginRef());\r\n if (result) {\r\n result._invisible = invisible;\r\n result._interior = interior;\r\n result._inwardNormal = plane.getNormalRef().clone();\r\n result._distanceFromOrigin = distance;\r\n return result;\r\n }\r\n return new ClipPlane(plane.getNormalRef().clone(), distance, invisible, interior);\r\n }\r\n /**\r\n * Create a ClipPlane with direct normal and signedDistance.\r\n * * The vector is normalized for storage.\r\n */\r\n public static createNormalAndDistance(\r\n normal: Vector3d, distance: number, invisible: boolean = false, interior: boolean = false, result?: ClipPlane,\r\n ): ClipPlane | undefined {\r\n const normalized = normal.normalize();\r\n if (normalized) {\r\n if (result) {\r\n result._invisible = invisible;\r\n result._interior = interior;\r\n result._inwardNormal = normalized;\r\n result._distanceFromOrigin = distance;\r\n }\r\n return new ClipPlane(normalized, distance, invisible, interior);\r\n }\r\n return undefined;\r\n }\r\n /**\r\n * Create a ClipPlane\r\n * * \"normal\" is the inward normal of the plane (it is internally normalized).\r\n * * \"point\" is any point of the plane.\r\n * * The stored distance for the plane is the dot product of the point with the normal (i.e. treat the point's xyz as\r\n * a vector from the origin.)\r\n */\r\n public static createNormalAndPoint(\r\n normal: Vector3d, point: Point3d, invisible: boolean = false, interior: boolean = false, result?: ClipPlane,\r\n ): ClipPlane | undefined {\r\n const normalized = normal.normalize();\r\n if (normalized) {\r\n const distance = normalized.dotProduct(point);\r\n if (result) {\r\n result._invisible = invisible;\r\n result._interior = interior;\r\n result._inwardNormal = normalized;\r\n result._distanceFromOrigin = distance;\r\n }\r\n return new ClipPlane(normalized, distance, invisible, interior);\r\n }\r\n return undefined;\r\n }\r\n /**\r\n * Create a clip plane\r\n * @param origin any point on the plane.\r\n * @param vectorA any vector in the plane\r\n * @param vectorB any vector in the plane\r\n * Returns undefined if the vectors are not independent.\r\n * * The stored inward normal is vectorB.crossProduct(vectorA).\r\n * * That is, the vectors are considered as a right-handed pair when viewed from the outside.\r\n */\r\n public static createOriginAndVectors(\r\n origin: Point3d,\r\n vectorA: Vector3d,\r\n vectorB: Vector3d,\r\n invisible: boolean = false,\r\n interior: boolean = false,\r\n result?: ClipPlane,\r\n ): ClipPlane | undefined {\r\n const normalized = vectorB.crossProduct(vectorA);\r\n return this.createNormalAndPoint(normalized, origin, invisible, interior, result);\r\n }\r\n /**\r\n * Create a ClipPlane\r\n * * \"normal\" (normalX, normalY, normalZ) is the inward normal of the plane.\r\n * * \"point\" (originX,originY,originZ) is any point of the plane.\r\n * * The stored distance for the plane is the dot product of the point with the normal (i.e. treat the point's xyz\r\n * as a vector from the origin.)\r\n */\r\n public static createNormalAndPointXYZXYZ(\r\n normalX: number, normalY: number, normalZ: number,\r\n originX: number, originY: number, originZ: number,\r\n invisible: boolean = false, interior: boolean = false,\r\n result?: ClipPlane,\r\n ): ClipPlane | undefined {\r\n const q = Geometry.hypotenuseXYZ(normalX, normalY, normalZ);\r\n const r = Geometry.conditionalDivideFraction(1, q);\r\n if (r !== undefined) {\r\n if (result) {\r\n result._inwardNormal.set(normalX * r, normalY * r, normalZ * r);\r\n result._distanceFromOrigin = result._inwardNormal.dotProductXYZ(originX, originY, originZ);\r\n result._invisible = invisible;\r\n result._interior = interior;\r\n return result;\r\n }\r\n const normal = Vector3d.create(normalX * r, normalY * r, normalZ * r);\r\n return new ClipPlane(normal, normal.dotProductXYZ(originX, originY, originZ), invisible, interior);\r\n }\r\n return undefined;\r\n }\r\n /**\r\n * Return a json object of the form\r\n * `{\"normal\":[u,v,w],\"dist\":signedDistanceValue,\"interior\":true,\"invisible\":true}`\r\n */\r\n public toJSON(): ClipPlaneProps {\r\n const props: ClipPlaneProps = {\r\n normal: this.inwardNormalRef.toJSON(),\r\n dist: this.distance,\r\n };\r\n if (this.interior)\r\n props.interior = true;\r\n if (this.invisible)\r\n props.invisible = true;\r\n return props;\r\n }\r\n /** Parse json object to ClipPlane instance */\r\n public static fromJSON(json: ClipPlaneProps, result?: ClipPlane): ClipPlane | undefined {\r\n if (json && json.normal && undefined !== json.dist && Number.isFinite(json.dist))\r\n return ClipPlane.createNormalAndDistance(\r\n Vector3d.fromJSON(json.normal), json.dist, !!json.invisible, !!json.interior,\r\n );\r\n return ClipPlane.createNormalAndDistance(Vector3d.unitZ(), 0, false, false, result);\r\n }\r\n /** Set both the invisible and interior flags. */\r\n public setFlags(invisible: boolean, interior: boolean) {\r\n this._invisible = invisible;\r\n this._interior = interior;\r\n }\r\n /** Return the stored distanceFromOrigin property. */\r\n public get distance() {\r\n return this._distanceFromOrigin;\r\n }\r\n /** * Return the stored inward normal property. */\r\n public get inwardNormalRef(): Vector3d {\r\n return this._inwardNormal;\r\n }\r\n /** Return the \"interior\" property bit */\r\n public get interior() {\r\n return this._interior;\r\n }\r\n /** Return the \"invisible\" property bit. */\r\n public get invisible() {\r\n return this._invisible;\r\n }\r\n /**\r\n * Create a plane defined by two points, an up vector, and a tilt angle relative to the up vector.\r\n * @param point0 start point of the edge\r\n * @param point1 end point of the edge\r\n * @param upVector vector perpendicular to the plane\r\n * @param tiltAngle angle to tilt the plane around the edge in the direction of the up vector.\r\n * @param result optional preallocated plane\r\n */\r\n public static createEdgeAndUpVector(\r\n point0: Point3d, point1: Point3d, upVector: Vector3d, tiltAngle?: Angle, result?: ClipPlane,\r\n ): ClipPlane | undefined {\r\n const edgeVector = Vector3d.createFrom(point1.minus(point0));\r\n let normal = (upVector.crossProduct(edgeVector)).normalize();\r\n\r\n if (normal) {\r\n if (tiltAngle !== undefined && !tiltAngle.isAlmostZero) {\r\n const tiltNormal = Vector3d.createRotateVectorAroundVector(normal, edgeVector, tiltAngle);\r\n if (tiltNormal) {\r\n normal = tiltNormal.clone();\r\n }\r\n }\r\n normal.negate(normal);\r\n return ClipPlane.createNormalAndPoint(normal, point0, false, false, result);\r\n }\r\n return undefined;\r\n }\r\n /** Create a plane perpendicular to the edge between the xy parts of point0 and point1. */\r\n public static createEdgeXY(point0: Point3d, point1: Point3d, result?: ClipPlane): ClipPlane | undefined {\r\n const normal = Vector3d.create(point0.y - point1.y, point1.x - point0.x);\r\n if (normal.normalizeInPlace())\r\n return ClipPlane.createNormalAndPoint(normal, point0, false, false, result);\r\n return undefined;\r\n }\r\n /**\r\n * Return the Plane3d form of the plane.\r\n * * The plane origin is the point `distance * inwardNormal`\r\n * * The plane normal is the inward normal of the ClipPlane.\r\n */\r\n public getPlane3d(): Plane3dByOriginAndUnitNormal {\r\n const d = this._distanceFromOrigin;\r\n // normal should be normalized, will not return undefined\r\n return Plane3dByOriginAndUnitNormal.create(\r\n Point3d.create(this._inwardNormal.x * d, this._inwardNormal.y * d, this._inwardNormal.z * d),\r\n this._inwardNormal,\r\n )!;\r\n }\r\n /**\r\n * Return the Point4d d form of the plane.\r\n * * The homogeneous xyz are the inward normal xyz.\r\n * * The homogeneous weight is the negated ClipPlane distance.\r\n */\r\n public getPlane4d(): Point4d {\r\n return Point4d.create(\r\n this._inwardNormal.x, this._inwardNormal.y, this._inwardNormal.z, - this._distanceFromOrigin,\r\n );\r\n }\r\n /**\r\n * Set the plane from DPoint4d style plane.\r\n * * The saved plane has its direction normalized.\r\n * * This preserves the plane itself as a zero set but make plane evaluations act as true distances (even if the\r\n * plane coefficients are scaled otherwise).\r\n * @param plane the DPoint4d style plane.\r\n */\r\n public setPlane4d(plane: Point4d) {\r\n const a = Math.sqrt(plane.x * plane.x + plane.y * plane.y + plane.z * plane.z);\r\n const r = a === 0.0 ? 1.0 : 1.0 / a;\r\n this._inwardNormal.x = r * plane.x;\r\n this._inwardNormal.y = r * plane.y;\r\n this._inwardNormal.z = r * plane.z;\r\n this._distanceFromOrigin = -r * plane.w;\r\n }\r\n /**\r\n * Evaluate the altitude in weighted space, i.e. (dot product with inward normal) minus distance, with point.w\r\n * scale applied to distance.\r\n * @param point space point to test.\r\n */\r\n public weightedAltitude(point: Point4d): number {\r\n return point.x * this._inwardNormal.x\r\n + point.y * this._inwardNormal.y\r\n + point.z * this._inwardNormal.z\r\n - point.w * this._distanceFromOrigin;\r\n }\r\n /**\r\n * Evaluate the distance from the plane to a point in space, i.e. (dot product with inward normal) minus distance.\r\n * @param point space point to test.\r\n */\r\n public altitude(point: Point3d): number {\r\n return point.x * this._inwardNormal.x\r\n + point.y * this._inwardNormal.y\r\n + point.z * this._inwardNormal.z\r\n - this._distanceFromOrigin;\r\n }\r\n /**\r\n * Evaluate the distance from the plane to a point in space with point given as x,y,z, i.e. (dot product with\r\n * inward normal) minus distance.\r\n * @param point space point to test.\r\n */\r\n public altitudeXYZ(x: number, y: number, z: number): number {\r\n return x * this._inwardNormal.x\r\n + y * this._inwardNormal.y\r\n + z * this._inwardNormal.z\r\n - this._distanceFromOrigin;\r\n }\r\n /** Return the x component of the normal used to evaluate altitude. */\r\n public normalX(): number {\r\n return this._inwardNormal.x;\r\n }\r\n /** Return the x component of the normal used to evaluate altitude. */\r\n public normalY(): number {\r\n return this._inwardNormal.y;\r\n }\r\n /** Return the z component of the normal used to evaluate altitude. */\r\n public normalZ(): number {\r\n return this._inwardNormal.z;\r\n }\r\n /** Return the dot product of the plane normal with the vector (NOT using the plane's distanceFromOrigin). */\r\n public velocity(vector: Vector3d): number {\r\n return vector.x * this._inwardNormal.x + vector.y * this._inwardNormal.y + vector.z * this._inwardNormal.z;\r\n }\r\n /**\r\n * Return the dot product of the plane normal with the x,yz, vector components (NOT using the plane's\r\n * distanceFromOrigin).\r\n */\r\n public velocityXYZ(x: number, y: number, z: number): number {\r\n return x * this._inwardNormal.x + y * this._inwardNormal.y + z * this._inwardNormal.z;\r\n }\r\n /**\r\n * Return the dot product of the plane normal with the point (treating the point xyz as a vector, and NOT\r\n * using the plane's distanceFromOrigin).\r\n */\r\n public dotProductPlaneNormalPoint(point: Point3d): number {\r\n return point.x * this._inwardNormal.x + point.y * this._inwardNormal.y + point.z * this._inwardNormal.z;\r\n }\r\n /**\r\n * Return true if spacePoint is inside or on the plane, with tolerance applied to \"on\".\r\n * @param spacePoint point to test.\r\n * @param tolerance tolerance for considering \"near plane\" to be \"on plane\"\r\n */\r\n public isPointOnOrInside(spacePoint: Point3d, tolerance: number = Geometry.smallMetricDistance): boolean {\r\n let value = this.altitude(spacePoint);\r\n if (tolerance) { value += tolerance; }\r\n return value >= 0.0;\r\n }\r\n /**\r\n * Return true if spacePoint is strictly inside the halfspace, with tolerance applied to \"on\".\r\n * @param spacePoint point to test.\r\n * @param tolerance tolerance for considering \"near plane\" to be \"on plane\"\r\n */\r\n public isPointInside(point: Point3d, tolerance: number = Geometry.smallMetricDistance): boolean {\r\n let value = this.altitude(point);\r\n if (tolerance) { value -= tolerance; }\r\n return value > 0.0;\r\n }\r\n /**\r\n * Return true if spacePoint is strictly on the plane, within tolerance\r\n * @param spacePoint point to test.\r\n * @param tolerance tolerance for considering \"near plane\" to be \"on plane\"\r\n */\r\n public isPointOn(point: Point3d, tolerance: number = Geometry.smallMetricDistance): boolean {\r\n return Math.abs(this.altitude(point)) <= tolerance;\r\n }\r\n /**\r\n * Compute intersections of an (UNBOUNDED) arc with the plane. Append them (as radians) to a growing array.\r\n * @param arc arc to test. The angle limits of the arc are NOT considered.\r\n * @param intersectionRadians array to receive results\r\n */\r\n public appendIntersectionRadians(arc: Arc3d, intersectionRadians: GrowableFloat64Array) {\r\n const arcVectors = arc.toVectors();\r\n const alpha = this.altitude(arc.center);\r\n const beta = this.velocity(arcVectors.vector0);\r\n const gamma = this.velocity(arcVectors.vector90);\r\n AnalyticRoots.appendImplicitLineUnitCircleIntersections(\r\n alpha, beta, gamma, undefined, undefined, intersectionRadians,\r\n );\r\n }\r\n private static _clipArcFractionArray = new GrowableFloat64Array();\r\n /**\r\n * Announce fractional intervals of arc clip.\r\n * * Each call to `announce(fraction0, fraction1, arc)` announces one interval that is inside the clip plane.\r\n */\r\n public announceClippedArcIntervals(arc: Arc3d, announce?: AnnounceNumberNumberCurvePrimitive): boolean {\r\n const breaks = ClipPlane._clipArcFractionArray;\r\n breaks.clear();\r\n this.appendIntersectionRadians(arc, breaks);\r\n arc.sweep.radiansArrayToPositivePeriodicFractions(breaks);\r\n return ClipUtilities.selectIntervals01(arc, breaks, this, announce);\r\n }\r\n /**\r\n * Compute intersection of (unbounded) segment with the plane.\r\n * * If the ends are on the same side of the plane, return undefined.\r\n * * If the intersection is an endpoint or interior to the segment return the fraction.\r\n * * If both ends are on, return undefined.\r\n */\r\n public getBoundedSegmentSimpleIntersection(pointA: Point3d, pointB: Point3d): number | undefined {\r\n const h0 = this.altitude(pointA);\r\n const h1 = this.altitude(pointB);\r\n if (h0 * h1 > 0.0)\r\n return undefined;\r\n if (h0 === 0.0 && h1 === 0.0) {\r\n return undefined;\r\n }\r\n return - h0 / (h1 - h0);\r\n }\r\n /** Apply transform to the origin. Apply inverse transpose of the matrix part to th normal vector. */\r\n public transformInPlace(transform: Transform): boolean {\r\n const plane: Plane3dByOriginAndUnitNormal = this.getPlane3d();\r\n const matrix: Matrix3d = transform.matrix;\r\n const newPoint = transform.multiplyPoint3d(plane.getOriginRef());\r\n // Normal transforms as the inverse transpose of the matrix part\r\n // BTW: If the matrix is orthogonal, this is a long way to multiply by the matrix part (mumble grumble)\r\n const newNormal = matrix.multiplyInverseTranspose(plane.getNormalRef());\r\n if (!newNormal)\r\n return false;\r\n\r\n plane.set(newPoint, newNormal);\r\n const normalized = (plane.getNormalRef()).normalize();\r\n if (!normalized)\r\n return false;\r\n this._inwardNormal = normalized;\r\n this._distanceFromOrigin = this._inwardNormal.dotProduct(plane.getOriginRef());\r\n return true;\r\n }\r\n /** Set the invisible flag. Interpretation of this is up to the use code algorithms. */\r\n public setInvisible(invisible: boolean) {\r\n this._invisible = invisible;\r\n }\r\n /** Reverse the sign of all coefficients, so outside and inside reverse */\r\n public negateInPlace() {\r\n this._inwardNormal = this._inwardNormal.negate();\r\n this._distanceFromOrigin = - this._distanceFromOrigin;\r\n }\r\n /**\r\n * Move the plane INWARD by given distance\r\n * @param offset distance of shift inwards\r\n */\r\n public offsetDistance(offset: number) {\r\n this._distanceFromOrigin += offset;\r\n }\r\n /**\r\n * Clip a polygon to the inside or outside of the plane.\r\n * * Results with 2 or fewer points are ignored.\r\n * * Other than ensuring capacity in the arrays, there are no object allocations during execution of this function.\r\n * @param xyz input points.\r\n * @param work work buffer\r\n * @param tolerance tolerance for \"on plane\" decision.\r\n */\r\n public clipConvexPolygonInPlace(\r\n xyz: GrowableXYZArray,\r\n work: GrowableXYZArray,\r\n inside: boolean = true,\r\n tolerance: number = Geometry.smallMetricDistance,\r\n ) {\r\n return IndexedXYZCollectionPolygonOps.clipConvexPolygonInPlace(this, xyz, work, inside, tolerance);\r\n }\r\n /**\r\n * Multiply the ClipPlane's DPoint4d by matrix.\r\n * @param matrix matrix to apply.\r\n * @param invert if true, use in verse of the matrix.\r\n * @param transpose if true, use the transpose of the matrix (or inverse, per invert parameter)\r\n * @param matrix matrix to apply\r\n * @return false if unable to invert\r\n * * Note that if matrixA is applied to all of space, the matrix to send to this method to get a corresponding\r\n * effect on the plane is the inverse transpose of matrixA\r\n * * Callers that will apply the same matrix to many planes should pre-invert the matrix for efficiency.\r\n * * Both params default to true to get the full effect of transforming space.\r\n */\r\n public multiplyPlaneByMatrix4d(matrix: Matrix4d, invert: boolean = true, transpose: boolean = true): boolean {\r\n const plane: Point4d = this.getPlane4d();\r\n if (invert) {\r\n const inverse = matrix.createInverse();\r\n if (inverse)\r\n return this.multiplyPlaneByMatrix4d(inverse, false, transpose);\r\n return false;\r\n }\r\n if (transpose)\r\n matrix.multiplyTransposePoint4d(plane, plane);\r\n else\r\n matrix.multiplyPoint4d(plane, plane);\r\n this.setPlane4d(plane);\r\n return true;\r\n }\r\n /** Announce the interval (if any) where a line is within the clip plane half space. */\r\n public announceClippedSegmentIntervals(\r\n f0: number, f1: number, pointA: Point3d, pointB: Point3d, announce?: (fraction0: number, fraction1: number) => void,\r\n ): boolean {\r\n if (f1 < f0)\r\n return false;\r\n const h0 = - this.altitude(pointA);\r\n const h1 = - this.altitude(pointB);\r\n const delta = h1 - h0;\r\n const f = Geometry.conditionalDivideFraction(-h0, delta);\r\n if (f === undefined) { // The segment is parallel to the plane.\r\n if (h0 <= 0.0) { if (announce) announce(f0, f1); return true; }\r\n return false;\r\n }\r\n if (delta > 0) { // segment aims OUT\r\n if (f < f1) f1 = f;\r\n } else {\r\n // segment aims IN\r\n if (f > f0)\r\n f0 = f;\r\n }\r\n if (f1 < f0)\r\n return false;\r\n if (announce) announce(f0, f1);\r\n return true;\r\n }\r\n /**\r\n * Return a coordinate frame with\r\n * * origin at closest point to global origin\r\n * * z axis points in\r\n * * x and y are \"in plane\"\r\n */\r\n public getFrame(): Transform {\r\n const d = this._distanceFromOrigin;\r\n const origin = Point3d.create(this._inwardNormal.x * d, this._inwardNormal.y * d, this._inwardNormal.z * d);\r\n const matrix = Matrix3d.createRigidHeadsUp(this._inwardNormal, AxisOrder.ZXY);\r\n return Transform.createOriginAndMatrix(origin, matrix);\r\n }\r\n /**\r\n * Return the intersection of the plane with a range cube.\r\n * @param range\r\n * @param xyzOut intersection polygon. This is convex.\r\n */\r\n public intersectRange(range: Range3d, addClosurePoint: boolean = false): GrowableXYZArray | undefined {\r\n if (range.isNull)\r\n return undefined;\r\n const corners = range.corners();\r\n const frameOnPlane = this.getFrame();\r\n frameOnPlane.multiplyInversePoint3dArrayInPlace(corners);\r\n const localRange = Range3d.createArray(corners);\r\n if (localRange.low.z * localRange.high.z > 0.0)\r\n return undefined;\r\n // oversized polygon on local z= 0\r\n const xyzOut = new GrowableXYZArray();\r\n xyzOut.pushXYZ(localRange.low.x, localRange.low.y, 0);\r\n xyzOut.pushXYZ(localRange.high.x, localRange.low.y, 0);\r\n xyzOut.pushXYZ(localRange.high.x, localRange.high.y, 0);\r\n xyzOut.pushXYZ(localRange.low.x, localRange.high.y, 0);\r\n xyzOut.multiplyTransformInPlace(frameOnPlane);\r\n IndexedXYZCollectionPolygonOps.intersectRangeConvexPolygonInPlace(range, xyzOut);\r\n if (xyzOut.length === 0)\r\n return undefined;\r\n if (addClosurePoint)\r\n xyzOut.pushWrap(1);\r\n return xyzOut;\r\n }\r\n /** Implement appendPolygonClip, as defined in interface PolygonClipper.\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\r\n * from the cache. This is NOT cleared.\r\n * @param outsideFragments Array to receive \"outside\" fragments. Each fragment is a GrowableXYZArray grabbed\r\n * from the cache. This is NOT cleared.\r\n * @param arrayCache cache for reusable GrowableXYZArray.\r\n */\r\n public appendPolygonClip(\r\n xyz: GrowableXYZArray,\r\n insideFragments: GrowableXYZArray[],\r\n outsideFragments: GrowableXYZArray[],\r\n arrayCache: GrowableXYZArrayCache,\r\n ): void {\r\n const perpendicularRange = Range1d.createNull();\r\n const newInside = arrayCache.grabFromCache();\r\n const newOutside = arrayCache.grabFromCache();\r\n IndexedXYZCollectionPolygonOps.splitConvexPolygonInsideOutsidePlane(\r\n this, xyz, newInside, newOutside, perpendicularRange,\r\n );\r\n ClipUtilities.captureOrDrop(newInside, 3, insideFragments, arrayCache);\r\n ClipUtilities.captureOrDrop(newOutside, 3, outsideFragments, arrayCache);\r\n }\r\n /** Project a point in space to the plane. */\r\n public projectPointToPlane(spacePoint: Point3d, result?: Point3d): Point3d {\r\n const d = -this.altitude(spacePoint);\r\n return spacePoint.plusXYZ(d * this._inwardNormal.x, d * this._inwardNormal.y, d * this._inwardNormal.z, result);\r\n }\r\n}\r\n"]}
|
|
1
|
+
{"version":3,"file":"ClipPlane.js","sourceRoot":"","sources":["../../../src/clipping/ClipPlane.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAQ/F,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAElD,OAAO,EAAE,oBAAoB,EAAE,MAAM,oCAAoC,CAAC;AAC1E,OAAO,EAAE,gBAAgB,EAAE,MAAM,gCAAgC,CAAC;AAElE,OAAO,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAC;AAClD,OAAO,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAC;AAChD,OAAO,EAAE,4BAA4B,EAAE,MAAM,4CAA4C,CAAC;AAC1F,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,+BAA+B,CAAC;AAClE,OAAO,EAAE,8BAA8B,EAAE,MAAM,0BAA0B,CAAC;AAC1E,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC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,mBAAmB,CAAC,UAAmB,EAAE,MAAgB;QAC9D,MAAM,CAAC,GAAG,CAAC,IAAI,CAAC,QAAQ,CAAC,UAAU,CAAC,CAAC;QACrC,OAAO,UAAU,CAAC,OAAO,CAAC,CAAC,GAAG,IAAI,CAAC,aAAa,CAAC,CAAC,EAAE,CAAC,GAAG,IAAI,CAAC,aAAa,CAAC,CAAC,EAAE,CAAC,GAAG,IAAI,CAAC,aAAa,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC;IAClH,CAAC;;AAxMc,+BAAqB,GAAG,IAAI,oBAAoB,EAAE,CAAC;SAhXvD,SAAS","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n\r\n/** @packageDocumentation\r\n * @module CartesianGeometry\r\n */\r\n\r\nimport { Arc3d } from \"../curve/Arc3d\";\r\nimport { AnnounceNumberNumberCurvePrimitive } from \"../curve/CurvePrimitive\";\r\nimport { AxisOrder, Geometry } from \"../Geometry\";\r\nimport { Angle } from \"../geometry3d/Angle\";\r\nimport { GrowableFloat64Array } from \"../geometry3d/GrowableFloat64Array\";\r\nimport { GrowableXYZArray } from \"../geometry3d/GrowableXYZArray\";\r\nimport { IndexedXYZCollection } from \"../geometry3d/IndexedXYZCollection\";\r\nimport { Matrix3d } from \"../geometry3d/Matrix3d\";\r\nimport { Plane3d } from \"../geometry3d/Plane3d\";\r\nimport { Plane3dByOriginAndUnitNormal } from \"../geometry3d/Plane3dByOriginAndUnitNormal\";\r\nimport { Point3d, Vector3d } from \"../geometry3d/Point3dVector3d\";\r\nimport { IndexedXYZCollectionPolygonOps } from \"../geometry3d/PolygonOps\";\r\nimport { Range1d, Range3d } from \"../geometry3d/Range\";\r\nimport { GrowableXYZArrayCache } from \"../geometry3d/ReusableObjectCache\";\r\nimport { Transform } from \"../geometry3d/Transform\";\r\nimport { XYZProps } from \"../geometry3d/XYZProps\";\r\nimport { Matrix4d } from \"../geometry4d/Matrix4d\";\r\nimport { Point4d } from \"../geometry4d/Point4d\";\r\nimport { AnalyticRoots } from \"../numerics/Polynomials\";\r\nimport { Clipper, ClipUtilities, PolygonClipper } from \"./ClipUtils\";\r\n\r\n/**\r\n * Wire format describing a [[ClipPlane]].\r\n * If either [[normal]] or [[dist]] are omitted, defaults to a normal of [[Vector3d.unitZ]] and a distance of zero.\r\n * @public\r\n */\r\nexport interface ClipPlaneProps {\r\n /** The plane's inward normal. */\r\n normal?: XYZProps;\r\n /** The plane's signed distance from the origin. */\r\n dist?: number;\r\n /** Defaults to `false`. */\r\n invisible?: boolean;\r\n /** Defaults to `false`. */\r\n interior?: boolean;\r\n}\r\n\r\n/**\r\n * A ClipPlane is a single plane represented as\r\n * * An inward unit normal (u,v,w)\r\n * * A signedDistance\r\n * More details can be found at docs/learning/geometry/Clipping.md\r\n *\r\n * Hence\r\n * * The halfspace function evaluation for \"point\" (x,y,z) is `(x,y,z) DOT (u,v,w) - signedDistance`.\r\n * * POSITIVE values of the halfspace function are \"inside\".\r\n * * ZERO value of the halfspace function is \"on\".\r\n * * NEGATIVE value of the halfspace function is \"outside\".\r\n * * A representative point on the plane is (signedDistance * u, signedDistance * v, signedDistance * w).\r\n * * Given a point on the plane and the inward normal of the plane, `signedDistance = point DOT normal`.\r\n * @public\r\n */\r\nexport class ClipPlane extends Plane3d implements Clipper, PolygonClipper {\r\n private _inwardNormal: Vector3d;\r\n /**\r\n * Construct a parallel plane through the origin.\r\n * * Move it to the actual position.\r\n * * _distanceFromOrigin is the distance it moved, with the (inward) normal direction as positive\r\n */\r\n private _distanceFromOrigin: number;\r\n private _invisible: boolean;\r\n private _interior: boolean;\r\n\r\n private constructor(normal: Vector3d, distance: number, invisible: boolean, interior: boolean) {\r\n super();\r\n this._invisible = invisible;\r\n this._interior = interior;\r\n this._inwardNormal = normal;\r\n this._distanceFromOrigin = distance;\r\n }\r\n /*\r\n private safeSetXYZDistance(nx: number, ny: number, nz: number, d: number) {\r\n this._inwardNormal.set(nx, ny, nz);\r\n this._distanceFromOrigin = d;\r\n }\r\n */\r\n /**\r\n * Return true if all members are almostEqual to corresponding members of other.\r\n * @param other clip plane to compare\r\n */\r\n public isAlmostEqual(other: ClipPlane): boolean {\r\n return Geometry.isSameCoordinate(this._distanceFromOrigin, other._distanceFromOrigin)\r\n && this._inwardNormal.isAlmostEqual(other._inwardNormal)\r\n && this._interior === other._interior\r\n && this._invisible === other._invisible;\r\n }\r\n /** Return a cloned plane */\r\n public clone(): ClipPlane {\r\n const result = new ClipPlane(this._inwardNormal.clone(), this._distanceFromOrigin, this._invisible, this._interior);\r\n return result;\r\n }\r\n /** Return a cloned plane with coordinate data negated. */\r\n public cloneNegated(): ClipPlane {\r\n const plane = new ClipPlane(this._inwardNormal.clone(), this._distanceFromOrigin, this._invisible, this._interior);\r\n plane.negateInPlace();\r\n return plane;\r\n }\r\n /** Create a ClipPlane from Plane3dByOriginAndUnitNormal. */\r\n public static createPlane(\r\n plane: Plane3dByOriginAndUnitNormal, invisible: boolean = false, interior: boolean = false, result?: ClipPlane,\r\n ): ClipPlane {\r\n const distance = plane.getNormalRef().dotProduct(plane.getOriginRef());\r\n if (result) {\r\n result._invisible = invisible;\r\n result._interior = interior;\r\n result._inwardNormal = plane.getNormalRef().clone();\r\n result._distanceFromOrigin = distance;\r\n return result;\r\n }\r\n return new ClipPlane(plane.getNormalRef().clone(), distance, invisible, interior);\r\n }\r\n /**\r\n * Create a ClipPlane with direct normal and signedDistance.\r\n * * The vector is normalized for storage.\r\n */\r\n public static createNormalAndDistance(\r\n normal: Vector3d, distance: number, invisible: boolean = false, interior: boolean = false, result?: ClipPlane,\r\n ): ClipPlane | undefined {\r\n const normalized = normal.normalize();\r\n if (normalized) {\r\n if (result) {\r\n result._invisible = invisible;\r\n result._interior = interior;\r\n result._inwardNormal = normalized;\r\n result._distanceFromOrigin = distance;\r\n }\r\n return new ClipPlane(normalized, distance, invisible, interior);\r\n }\r\n return undefined;\r\n }\r\n /**\r\n * Create a ClipPlane\r\n * * \"normal\" is the inward normal of the plane (it is internally normalized).\r\n * * \"point\" is any point of the plane.\r\n * * The stored distance for the plane is the dot product of the point with the normal (i.e. treat the point's xyz as\r\n * a vector from the origin.)\r\n */\r\n public static createNormalAndPoint(\r\n normal: Vector3d, point: Point3d, invisible: boolean = false, interior: boolean = false, result?: ClipPlane,\r\n ): ClipPlane | undefined {\r\n const normalized = normal.normalize();\r\n if (normalized) {\r\n const distance = normalized.dotProduct(point);\r\n if (result) {\r\n result._invisible = invisible;\r\n result._interior = interior;\r\n result._inwardNormal = normalized;\r\n result._distanceFromOrigin = distance;\r\n }\r\n return new ClipPlane(normalized, distance, invisible, interior);\r\n }\r\n return undefined;\r\n }\r\n /**\r\n * Create a clip plane\r\n * @param origin any point on the plane.\r\n * @param vectorA any vector in the plane\r\n * @param vectorB any vector in the plane\r\n * Returns undefined if the vectors are not independent.\r\n * * The stored inward normal is vectorB.crossProduct(vectorA).\r\n * * That is, the vectors are considered as a right-handed pair when viewed from the outside.\r\n */\r\n public static createOriginAndVectors(\r\n origin: Point3d,\r\n vectorA: Vector3d,\r\n vectorB: Vector3d,\r\n invisible: boolean = false,\r\n interior: boolean = false,\r\n result?: ClipPlane,\r\n ): ClipPlane | undefined {\r\n const normalized = vectorB.crossProduct(vectorA);\r\n return this.createNormalAndPoint(normalized, origin, invisible, interior, result);\r\n }\r\n /**\r\n * Create a ClipPlane\r\n * * \"normal\" (normalX, normalY, normalZ) is the inward normal of the plane.\r\n * * \"point\" (originX,originY,originZ) is any point of the plane.\r\n * * The stored distance for the plane is the dot product of the point with the normal (i.e. treat the point's xyz\r\n * as a vector from the origin.)\r\n */\r\n public static createNormalAndPointXYZXYZ(\r\n normalX: number, normalY: number, normalZ: number,\r\n originX: number, originY: number, originZ: number,\r\n invisible: boolean = false, interior: boolean = false,\r\n result?: ClipPlane,\r\n ): ClipPlane | undefined {\r\n const q = Geometry.hypotenuseXYZ(normalX, normalY, normalZ);\r\n const r = Geometry.conditionalDivideFraction(1, q);\r\n if (r !== undefined) {\r\n if (result) {\r\n result._inwardNormal.set(normalX * r, normalY * r, normalZ * r);\r\n result._distanceFromOrigin = result._inwardNormal.dotProductXYZ(originX, originY, originZ);\r\n result._invisible = invisible;\r\n result._interior = interior;\r\n return result;\r\n }\r\n const normal = Vector3d.create(normalX * r, normalY * r, normalZ * r);\r\n return new ClipPlane(normal, normal.dotProductXYZ(originX, originY, originZ), invisible, interior);\r\n }\r\n return undefined;\r\n }\r\n /**\r\n * Return a json object of the form\r\n * `{\"normal\":[u,v,w],\"dist\":signedDistanceValue,\"interior\":true,\"invisible\":true}`\r\n */\r\n public toJSON(): ClipPlaneProps {\r\n const props: ClipPlaneProps = {\r\n normal: this.inwardNormalRef.toJSON(),\r\n dist: this.distance,\r\n };\r\n if (this.interior)\r\n props.interior = true;\r\n if (this.invisible)\r\n props.invisible = true;\r\n return props;\r\n }\r\n /** Parse json object to ClipPlane instance */\r\n public static fromJSON(json: ClipPlaneProps, result?: ClipPlane): ClipPlane | undefined {\r\n if (json && json.normal && undefined !== json.dist && Number.isFinite(json.dist))\r\n return ClipPlane.createNormalAndDistance(\r\n Vector3d.fromJSON(json.normal), json.dist, !!json.invisible, !!json.interior,\r\n );\r\n return ClipPlane.createNormalAndDistance(Vector3d.unitZ(), 0, false, false, result);\r\n }\r\n /** Set both the invisible and interior flags. */\r\n public setFlags(invisible: boolean, interior: boolean) {\r\n this._invisible = invisible;\r\n this._interior = interior;\r\n }\r\n /** Return the stored distanceFromOrigin property. */\r\n public get distance() {\r\n return this._distanceFromOrigin;\r\n }\r\n /** * Return the stored inward normal property. */\r\n public get inwardNormalRef(): Vector3d {\r\n return this._inwardNormal;\r\n }\r\n /** Return the \"interior\" property bit */\r\n public get interior() {\r\n return this._interior;\r\n }\r\n /** Return the \"invisible\" property bit. */\r\n public get invisible() {\r\n return this._invisible;\r\n }\r\n /**\r\n * Create a plane defined by two points, an up vector, and a tilt angle relative to the up vector.\r\n * @param point0 start point of the edge\r\n * @param point1 end point of the edge\r\n * @param upVector vector perpendicular to the plane\r\n * @param tiltAngle angle to tilt the plane around the edge in the direction of the up vector.\r\n * @param result optional preallocated plane\r\n */\r\n public static createEdgeAndUpVector(\r\n point0: Point3d, point1: Point3d, upVector: Vector3d, tiltAngle?: Angle, result?: ClipPlane,\r\n ): ClipPlane | undefined {\r\n const edgeVector = Vector3d.createFrom(point1.minus(point0));\r\n let normal = (upVector.crossProduct(edgeVector)).normalize();\r\n\r\n if (normal) {\r\n if (tiltAngle !== undefined && !tiltAngle.isAlmostZero) {\r\n const tiltNormal = Vector3d.createRotateVectorAroundVector(normal, edgeVector, tiltAngle);\r\n if (tiltNormal) {\r\n normal = tiltNormal.clone();\r\n }\r\n }\r\n normal.negate(normal);\r\n return ClipPlane.createNormalAndPoint(normal, point0, false, false, result);\r\n }\r\n return undefined;\r\n }\r\n /** Create a plane perpendicular to the edge between the xy parts of point0 and point1. */\r\n public static createEdgeXY(point0: Point3d, point1: Point3d, result?: ClipPlane): ClipPlane | undefined {\r\n const normal = Vector3d.create(point0.y - point1.y, point1.x - point0.x);\r\n if (normal.normalizeInPlace())\r\n return ClipPlane.createNormalAndPoint(normal, point0, false, false, result);\r\n return undefined;\r\n }\r\n /**\r\n * Return the Plane3d form of the plane.\r\n * * The plane origin is the point `distance * inwardNormal`\r\n * * The plane normal is the inward normal of the ClipPlane.\r\n */\r\n public getPlane3d(): Plane3dByOriginAndUnitNormal {\r\n const d = this._distanceFromOrigin;\r\n // normal should be normalized, will not return undefined\r\n return Plane3dByOriginAndUnitNormal.create(\r\n Point3d.create(this._inwardNormal.x * d, this._inwardNormal.y * d, this._inwardNormal.z * d),\r\n this._inwardNormal,\r\n )!;\r\n }\r\n /**\r\n * Return the Point4d d form of the plane.\r\n * * The homogeneous xyz are the inward normal xyz.\r\n * * The homogeneous weight is the negated ClipPlane distance.\r\n */\r\n public getPlane4d(): Point4d {\r\n return Point4d.create(\r\n this._inwardNormal.x, this._inwardNormal.y, this._inwardNormal.z, - this._distanceFromOrigin,\r\n );\r\n }\r\n /**\r\n * Set the plane from DPoint4d style plane.\r\n * * The saved plane has its direction normalized.\r\n * * This preserves the plane itself as a zero set but make plane evaluations act as true distances (even if the\r\n * plane coefficients are scaled otherwise).\r\n * @param plane the DPoint4d style plane.\r\n */\r\n public setPlane4d(plane: Point4d) {\r\n const a = Math.sqrt(plane.x * plane.x + plane.y * plane.y + plane.z * plane.z);\r\n const r = a === 0.0 ? 1.0 : 1.0 / a;\r\n this._inwardNormal.x = r * plane.x;\r\n this._inwardNormal.y = r * plane.y;\r\n this._inwardNormal.z = r * plane.z;\r\n this._distanceFromOrigin = -r * plane.w;\r\n }\r\n /**\r\n * Evaluate the altitude in weighted space, i.e. (dot product with inward normal) minus distance, with point.w\r\n * scale applied to distance.\r\n * @param point space point to test.\r\n */\r\n public weightedAltitude(point: Point4d): number {\r\n return point.x * this._inwardNormal.x\r\n + point.y * this._inwardNormal.y\r\n + point.z * this._inwardNormal.z\r\n - point.w * this._distanceFromOrigin;\r\n }\r\n /**\r\n * Evaluate the distance from the plane to a point in space, i.e. (dot product with inward normal) minus distance.\r\n * @param point space point to test.\r\n */\r\n public altitude(point: Point3d): number {\r\n return point.x * this._inwardNormal.x\r\n + point.y * this._inwardNormal.y\r\n + point.z * this._inwardNormal.z\r\n - this._distanceFromOrigin;\r\n }\r\n /**\r\n * Evaluate the distance from the plane to a point in space with point given as x,y,z, i.e. (dot product with\r\n * inward normal) minus distance.\r\n * @param point space point to test.\r\n */\r\n public altitudeXYZ(x: number, y: number, z: number): number {\r\n return x * this._inwardNormal.x\r\n + y * this._inwardNormal.y\r\n + z * this._inwardNormal.z\r\n - this._distanceFromOrigin;\r\n }\r\n /** Return the x component of the normal used to evaluate altitude. */\r\n public normalX(): number {\r\n return this._inwardNormal.x;\r\n }\r\n /** Return the x component of the normal used to evaluate altitude. */\r\n public normalY(): number {\r\n return this._inwardNormal.y;\r\n }\r\n /** Return the z component of the normal used to evaluate altitude. */\r\n public normalZ(): number {\r\n return this._inwardNormal.z;\r\n }\r\n /** Return the dot product of the plane normal with the vector (NOT using the plane's distanceFromOrigin). */\r\n public velocity(vector: Vector3d): number {\r\n return vector.x * this._inwardNormal.x + vector.y * this._inwardNormal.y + vector.z * this._inwardNormal.z;\r\n }\r\n /**\r\n * Return the dot product of the plane normal with the x,yz, vector components (NOT using the plane's\r\n * distanceFromOrigin).\r\n */\r\n public velocityXYZ(x: number, y: number, z: number): number {\r\n return x * this._inwardNormal.x + y * this._inwardNormal.y + z * this._inwardNormal.z;\r\n }\r\n /**\r\n * Return the dot product of the plane normal with the point (treating the point xyz as a vector, and NOT\r\n * using the plane's distanceFromOrigin).\r\n */\r\n public dotProductPlaneNormalPoint(point: Point3d): number {\r\n return point.x * this._inwardNormal.x + point.y * this._inwardNormal.y + point.z * this._inwardNormal.z;\r\n }\r\n /**\r\n * Return true if spacePoint is inside or on the plane, with tolerance applied to \"on\".\r\n * @param spacePoint point to test.\r\n * @param tolerance tolerance for considering \"near plane\" to be \"on plane\"\r\n */\r\n public isPointOnOrInside(spacePoint: Point3d, tolerance: number = Geometry.smallMetricDistance): boolean {\r\n let value = this.altitude(spacePoint);\r\n if (tolerance) { value += tolerance; }\r\n return value >= 0.0;\r\n }\r\n /**\r\n * Return true if spacePoint is strictly inside the halfspace, with tolerance applied to \"on\".\r\n * @param spacePoint point to test.\r\n * @param tolerance tolerance for considering \"near plane\" to be \"on plane\"\r\n */\r\n public isPointInside(point: Point3d, tolerance: number = Geometry.smallMetricDistance): boolean {\r\n let value = this.altitude(point);\r\n if (tolerance) { value -= tolerance; }\r\n return value > 0.0;\r\n }\r\n /**\r\n * Return true if spacePoint is strictly on the plane, within tolerance\r\n * @param spacePoint point to test.\r\n * @param tolerance tolerance for considering \"near plane\" to be \"on plane\"\r\n */\r\n public isPointOn(point: Point3d, tolerance: number = Geometry.smallMetricDistance): boolean {\r\n return Math.abs(this.altitude(point)) <= tolerance;\r\n }\r\n /**\r\n * Compute intersections of an (UNBOUNDED) arc with the plane. Append them (as radians) to a growing array.\r\n * @param arc arc to test. The angle limits of the arc are NOT considered.\r\n * @param intersectionRadians array to receive results\r\n */\r\n public appendIntersectionRadians(arc: Arc3d, intersectionRadians: GrowableFloat64Array) {\r\n const arcVectors = arc.toVectors();\r\n const alpha = this.altitude(arc.center);\r\n const beta = this.velocity(arcVectors.vector0);\r\n const gamma = this.velocity(arcVectors.vector90);\r\n AnalyticRoots.appendImplicitLineUnitCircleIntersections(\r\n alpha, beta, gamma, undefined, undefined, intersectionRadians,\r\n );\r\n }\r\n private static _clipArcFractionArray = new GrowableFloat64Array();\r\n /**\r\n * Announce fractional intervals of arc clip.\r\n * * Each call to `announce(fraction0, fraction1, arc)` announces one interval that is inside the clip plane.\r\n */\r\n public announceClippedArcIntervals(arc: Arc3d, announce?: AnnounceNumberNumberCurvePrimitive): boolean {\r\n const breaks = ClipPlane._clipArcFractionArray;\r\n breaks.clear();\r\n this.appendIntersectionRadians(arc, breaks);\r\n arc.sweep.radiansArrayToPositivePeriodicFractions(breaks);\r\n return ClipUtilities.selectIntervals01(arc, breaks, this, announce);\r\n }\r\n /**\r\n * Compute intersection of (unbounded) segment with the plane.\r\n * * If the ends are on the same side of the plane, return undefined.\r\n * * If the intersection is an endpoint or interior to the segment return the fraction.\r\n * * If both ends are on, return undefined.\r\n */\r\n public getBoundedSegmentSimpleIntersection(pointA: Point3d, pointB: Point3d): number | undefined {\r\n const h0 = this.altitude(pointA);\r\n const h1 = this.altitude(pointB);\r\n if (h0 * h1 > 0.0)\r\n return undefined;\r\n if (h0 === 0.0 && h1 === 0.0) {\r\n return undefined;\r\n }\r\n return - h0 / (h1 - h0);\r\n }\r\n /** Apply transform to the origin. Apply inverse transpose of the matrix part to th normal vector. */\r\n public transformInPlace(transform: Transform): boolean {\r\n const plane: Plane3dByOriginAndUnitNormal = this.getPlane3d();\r\n const matrix: Matrix3d = transform.matrix;\r\n const newPoint = transform.multiplyPoint3d(plane.getOriginRef());\r\n // Normal transforms as the inverse transpose of the matrix part\r\n // BTW: If the matrix is orthogonal, this is a long way to multiply by the matrix part (mumble grumble)\r\n const newNormal = matrix.multiplyInverseTranspose(plane.getNormalRef());\r\n if (!newNormal)\r\n return false;\r\n\r\n plane.set(newPoint, newNormal);\r\n const normalized = (plane.getNormalRef()).normalize();\r\n if (!normalized)\r\n return false;\r\n this._inwardNormal = normalized;\r\n this._distanceFromOrigin = this._inwardNormal.dotProduct(plane.getOriginRef());\r\n return true;\r\n }\r\n /** Set the invisible flag. Interpretation of this is up to the use code algorithms. */\r\n public setInvisible(invisible: boolean) {\r\n this._invisible = invisible;\r\n }\r\n /** Reverse the sign of all coefficients, so outside and inside reverse */\r\n public negateInPlace() {\r\n this._inwardNormal = this._inwardNormal.negate();\r\n this._distanceFromOrigin = - this._distanceFromOrigin;\r\n }\r\n /**\r\n * Move the plane INWARD by given distance\r\n * @param offset distance of shift inwards\r\n */\r\n public offsetDistance(offset: number) {\r\n this._distanceFromOrigin += offset;\r\n }\r\n /**\r\n * Clip a polygon to the inside or outside of the plane.\r\n * * Results with 2 or fewer points are ignored.\r\n * * Other than ensuring capacity in the arrays, there are no object allocations during execution of this function.\r\n * @param xyz input points.\r\n * @param work work buffer\r\n * @param tolerance tolerance for \"on plane\" decision.\r\n */\r\n public clipConvexPolygonInPlace(\r\n xyz: GrowableXYZArray,\r\n work: GrowableXYZArray,\r\n inside: boolean = true,\r\n tolerance: number = Geometry.smallMetricDistance,\r\n ) {\r\n return IndexedXYZCollectionPolygonOps.clipConvexPolygonInPlace(this, xyz, work, inside, tolerance);\r\n }\r\n /**\r\n * Multiply the ClipPlane's DPoint4d by matrix.\r\n * @param matrix matrix to apply.\r\n * @param invert if true, use in verse of the matrix.\r\n * @param transpose if true, use the transpose of the matrix (or inverse, per invert parameter)\r\n * @param matrix matrix to apply\r\n * @return false if unable to invert\r\n * * Note that if matrixA is applied to all of space, the matrix to send to this method to get a corresponding\r\n * effect on the plane is the inverse transpose of matrixA\r\n * * Callers that will apply the same matrix to many planes should pre-invert the matrix for efficiency.\r\n * * Both params default to true to get the full effect of transforming space.\r\n */\r\n public multiplyPlaneByMatrix4d(matrix: Matrix4d, invert: boolean = true, transpose: boolean = true): boolean {\r\n const plane: Point4d = this.getPlane4d();\r\n if (invert) {\r\n const inverse = matrix.createInverse();\r\n if (inverse)\r\n return this.multiplyPlaneByMatrix4d(inverse, false, transpose);\r\n return false;\r\n }\r\n if (transpose)\r\n matrix.multiplyTransposePoint4d(plane, plane);\r\n else\r\n matrix.multiplyPoint4d(plane, plane);\r\n this.setPlane4d(plane);\r\n return true;\r\n }\r\n /** Announce the interval (if any) where a line is within the clip plane half space. */\r\n public announceClippedSegmentIntervals(\r\n f0: number, f1: number, pointA: Point3d, pointB: Point3d, announce?: (fraction0: number, fraction1: number) => void,\r\n ): boolean {\r\n if (f1 < f0)\r\n return false;\r\n const h0 = - this.altitude(pointA);\r\n const h1 = - this.altitude(pointB);\r\n const delta = h1 - h0;\r\n const f = Geometry.conditionalDivideFraction(-h0, delta);\r\n if (f === undefined) { // The segment is parallel to the plane.\r\n if (h0 <= 0.0) { if (announce) announce(f0, f1); return true; }\r\n return false;\r\n }\r\n if (delta > 0) { // segment aims OUT\r\n if (f < f1) f1 = f;\r\n } else {\r\n // segment aims IN\r\n if (f > f0)\r\n f0 = f;\r\n }\r\n if (f1 < f0)\r\n return false;\r\n if (announce) announce(f0, f1);\r\n return true;\r\n }\r\n /**\r\n * Return a coordinate frame with\r\n * * origin at closest point to global origin\r\n * * z axis points in\r\n * * x and y are \"in plane\"\r\n */\r\n public getFrame(): Transform {\r\n const d = this._distanceFromOrigin;\r\n const origin = Point3d.create(this._inwardNormal.x * d, this._inwardNormal.y * d, this._inwardNormal.z * d);\r\n const matrix = Matrix3d.createRigidHeadsUp(this._inwardNormal, AxisOrder.ZXY);\r\n return Transform.createOriginAndMatrix(origin, matrix);\r\n }\r\n /**\r\n * Return the intersection of the plane with a range cube.\r\n * @param range\r\n * @param xyzOut intersection polygon. This is convex.\r\n */\r\n public intersectRange(range: Range3d, addClosurePoint: boolean = false): GrowableXYZArray | undefined {\r\n if (range.isNull)\r\n return undefined;\r\n const corners = range.corners();\r\n const frameOnPlane = this.getFrame();\r\n frameOnPlane.multiplyInversePoint3dArrayInPlace(corners);\r\n const localRange = Range3d.createArray(corners);\r\n if (localRange.low.z * localRange.high.z > 0.0)\r\n return undefined;\r\n // oversized polygon on local z= 0\r\n const xyzOut = new GrowableXYZArray();\r\n xyzOut.pushXYZ(localRange.low.x, localRange.low.y, 0);\r\n xyzOut.pushXYZ(localRange.high.x, localRange.low.y, 0);\r\n xyzOut.pushXYZ(localRange.high.x, localRange.high.y, 0);\r\n xyzOut.pushXYZ(localRange.low.x, localRange.high.y, 0);\r\n xyzOut.multiplyTransformInPlace(frameOnPlane);\r\n IndexedXYZCollectionPolygonOps.intersectRangeConvexPolygonInPlace(range, xyzOut);\r\n if (xyzOut.length === 0)\r\n return undefined;\r\n if (addClosurePoint)\r\n xyzOut.pushWrap(1);\r\n return xyzOut;\r\n }\r\n /**\r\n * Implement appendPolygonClip, as defined in interface PolygonClipper.\r\n * @param xyz convex polygon. This is not changed.\r\n * @param insideFragments Array to receive \"inside\" fragments. Each fragment is a GrowableXYZArray grabbed\r\n * from the cache. This is NOT cleared.\r\n * @param outsideFragments Array to receive \"outside\" fragments. Each fragment is a GrowableXYZArray grabbed\r\n * from the cache. This is NOT cleared.\r\n * @param arrayCache cache for reusable GrowableXYZArray.\r\n */\r\n public appendPolygonClip(\r\n xyz: IndexedXYZCollection,\r\n insideFragments: GrowableXYZArray[],\r\n outsideFragments: GrowableXYZArray[],\r\n arrayCache: GrowableXYZArrayCache,\r\n ): void {\r\n const perpendicularRange = Range1d.createNull();\r\n const newInside = arrayCache.grabFromCache();\r\n const newOutside = arrayCache.grabFromCache();\r\n IndexedXYZCollectionPolygonOps.splitConvexPolygonInsideOutsidePlane(\r\n this, xyz, newInside, newOutside, perpendicularRange,\r\n );\r\n ClipUtilities.captureOrDrop(newInside, 3, insideFragments, arrayCache);\r\n ClipUtilities.captureOrDrop(newOutside, 3, outsideFragments, arrayCache);\r\n }\r\n /** Project a point in space to the plane. */\r\n public projectPointToPlane(spacePoint: Point3d, result?: Point3d): Point3d {\r\n const d = -this.altitude(spacePoint);\r\n return spacePoint.plusXYZ(d * this._inwardNormal.x, d * this._inwardNormal.y, d * this._inwardNormal.z, result);\r\n }\r\n}\r\n"]}
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
* @module CartesianGeometry
|
|
3
3
|
*/
|
|
4
4
|
import { Arc3d } from "../curve/Arc3d";
|
|
5
|
+
import { AnyCurve, AnyRegion } from "../curve/CurveTypes";
|
|
5
6
|
import { AnnounceNumberNumber, AnnounceNumberNumberCurvePrimitive, CurvePrimitive } from "../curve/CurvePrimitive";
|
|
6
7
|
import { GeometryQuery } from "../curve/GeometryQuery";
|
|
7
8
|
import { GrowableFloat64Array } from "../geometry3d/GrowableFloat64Array";
|
|
@@ -87,21 +88,22 @@ export interface Clipper {
|
|
|
87
88
|
* Optional polygon clip method.
|
|
88
89
|
* * This is expected to be implemented by planar clip structures.
|
|
89
90
|
* * This is unimplemented for curve clippers (e.g. sphere) for which polygon clip result has curved edges.
|
|
91
|
+
* * The input polygon must be convex.
|
|
90
92
|
*/
|
|
91
93
|
appendPolygonClip?: AppendPolygonClipFunction;
|
|
92
94
|
}
|
|
93
95
|
/**
|
|
94
96
|
* Signature of method to execute polygon clip, distributing fragments of xyz among insideFragments and outsideFragments
|
|
95
|
-
* @param xyz
|
|
97
|
+
* @param xyz convex polygon. This is not changed.
|
|
96
98
|
* @param insideFragments Array to receive "inside" fragments. Each fragment is a GrowableXYZArray grabbed from
|
|
97
99
|
* the cache. This is NOT cleared.
|
|
98
100
|
* @param outsideFragments Array to receive "outside" fragments. Each fragment is a GrowableXYZArray grabbed from
|
|
99
101
|
* the cache. This is NOT cleared.
|
|
100
102
|
* @param arrayCache cache for reusable GrowableXYZArray.
|
|
101
103
|
*/
|
|
102
|
-
type AppendPolygonClipFunction = (xyz:
|
|
104
|
+
type AppendPolygonClipFunction = (xyz: IndexedXYZCollection, insideFragments: GrowableXYZArray[], outsideFragments: GrowableXYZArray[], arrayCache: GrowableXYZArrayCache) => void;
|
|
103
105
|
/**
|
|
104
|
-
* Interface for clipping polygons.
|
|
106
|
+
* Interface for clipping convex polygons.
|
|
105
107
|
* Supported by:
|
|
106
108
|
* * AlternatingCCTreeNode
|
|
107
109
|
* * ConvexClipPlaneSet
|
|
@@ -120,7 +122,7 @@ export declare class ClipUtilities {
|
|
|
120
122
|
private static _workClipper?;
|
|
121
123
|
private static _selectIntervals01TestPoint;
|
|
122
124
|
/**
|
|
123
|
-
*
|
|
125
|
+
* Augment the unsortedFractionsArray with 0 and 1
|
|
124
126
|
* * sort
|
|
125
127
|
* * test the midpoint of each interval with `clipper.isPointOnOrInside`
|
|
126
128
|
* * pass accepted intervals to `announce(f0,f1,curve)`
|
|
@@ -134,10 +136,26 @@ export declare class ClipUtilities {
|
|
|
134
136
|
*/
|
|
135
137
|
static announceNNC(intervals: Range1d[], cp: CurvePrimitive, announce?: AnnounceNumberNumberCurvePrimitive): boolean;
|
|
136
138
|
/**
|
|
137
|
-
*
|
|
138
|
-
*
|
|
139
|
+
* Compute and return portions of the input curve that are within the clipper.
|
|
140
|
+
* @param curve input curve, unmodified
|
|
141
|
+
* @param clipper used to compute the clipped components
|
|
142
|
+
* @return array of clipped curves
|
|
139
143
|
*/
|
|
140
144
|
static collectClippedCurves(curve: CurvePrimitive, clipper: Clipper): CurvePrimitive[];
|
|
145
|
+
/**
|
|
146
|
+
* Compute and return the portions of the input region that are within the clipper.
|
|
147
|
+
* @param region input region, unmodified
|
|
148
|
+
* @param clipper used to compute the clipped components
|
|
149
|
+
* @return clipped subregion, as a single `AnyRegion`
|
|
150
|
+
*/
|
|
151
|
+
static clipAnyRegion(region: AnyRegion, clipper: Clipper): AnyRegion | undefined;
|
|
152
|
+
/**
|
|
153
|
+
* Compute and return portions of the input curve or region that are within the clipper.
|
|
154
|
+
* @param curve input curve or region, unmodified
|
|
155
|
+
* @param clipper used to compute the clipped components
|
|
156
|
+
* @return array of clipped components of the input curve or region that lie inside the clipper
|
|
157
|
+
*/
|
|
158
|
+
static clipAnyCurve(curve: AnyCurve, clipper: Clipper): AnyCurve[];
|
|
141
159
|
/**
|
|
142
160
|
* Clip a polygon down to regions defined by each shape of a ClipShape.
|
|
143
161
|
* @return An multidimensional array of points, where each array is the boundary of part of the remaining polygon.
|
|
@@ -252,7 +270,7 @@ export declare class ClipUtilities {
|
|
|
252
270
|
* @param singleton single array which may be a replacement for multiple fragments
|
|
253
271
|
* @param cache cache for array management
|
|
254
272
|
*/
|
|
255
|
-
static restoreSingletonInPlaceOfMultipleShards(fragments: GrowableXYZArray[] | undefined, baseCount: number, singleton:
|
|
273
|
+
static restoreSingletonInPlaceOfMultipleShards(fragments: GrowableXYZArray[] | undefined, baseCount: number, singleton: IndexedXYZCollection, arrayCache: GrowableXYZArrayCache): void;
|
|
256
274
|
/**
|
|
257
275
|
* Create a UnionOfConvexClipPlaneSets for a volume defined by a path and offsets.
|
|
258
276
|
* @param points points along the path.
|
|
@@ -350,9 +368,9 @@ export declare class ClipUtilities {
|
|
|
350
368
|
* @param outAction
|
|
351
369
|
* @param finalCandidateAction
|
|
352
370
|
*/
|
|
353
|
-
static doPolygonClipSequence(xyz:
|
|
371
|
+
static doPolygonClipSequence(xyz: IndexedXYZCollection, clippers: Clipper[], acceptedIn: GrowableXYZArray[] | undefined, acceptedOut: GrowableXYZArray[] | undefined, finalCandidates: GrowableXYZArray[] | undefined, inAction: ClipStepAction, outAction: ClipStepAction, finalFragmentAction: ClipStepAction, arrayCache: GrowableXYZArrayCache | undefined): void;
|
|
354
372
|
/** Pass polygon `xyz` through a sequence of PolygonClip steps with "parity" rules */
|
|
355
|
-
static doPolygonClipParitySequence(xyz:
|
|
373
|
+
static doPolygonClipParitySequence(xyz: IndexedXYZCollection, clippers: Clipper[], acceptedIn: GrowableXYZArray[] | undefined, acceptedOut: GrowableXYZArray[] | undefined, arrayCache: GrowableXYZArrayCache | undefined): void;
|
|
356
374
|
/**
|
|
357
375
|
* For each plane of clipper, construct a UnionOfConvexClipPlaneSets for an outer (infinite) convex volume that
|
|
358
376
|
* abuts the outer volume of the neighbor faces.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ClipUtils.d.ts","sourceRoot":"","sources":["../../../src/clipping/ClipUtils.ts"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,EAAE,KAAK,EAAE,MAAM,gBAAgB,CAAC;
|
|
1
|
+
{"version":3,"file":"ClipUtils.d.ts","sourceRoot":"","sources":["../../../src/clipping/ClipUtils.ts"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,EAAE,KAAK,EAAE,MAAM,gBAAgB,CAAC;AACvC,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAG1D,OAAO,EAAE,oBAAoB,EAAE,kCAAkC,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AACnH,OAAO,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AAQvD,OAAO,EAAE,oBAAoB,EAAE,MAAM,oCAAoC,CAAC;AAC1E,OAAO,EAAE,gBAAgB,EAAE,MAAM,gCAAgC,CAAC;AAClE,OAAO,EAAE,oBAAoB,EAAE,MAAM,oCAAoC,CAAC;AAC1E,OAAO,EAAE,4BAA4B,EAAE,MAAM,4CAA4C,CAAC;AAE1F,OAAO,EAAE,OAAO,EAAY,MAAM,+BAA+B,CAAC;AAClE,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AACvD,OAAO,EAAE,qBAAqB,EAAE,MAAM,mCAAmC,CAAC;AAC1E,OAAO,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC;AACpD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
|
@@ -5,10 +5,16 @@
|
|
|
5
5
|
/** @packageDocumentation
|
|
6
6
|
* @module CartesianGeometry
|
|
7
7
|
*/
|
|
8
|
+
import { BagOfCurves } from "../curve/CurveCollection";
|
|
8
9
|
import { CurveFactory } from "../curve/CurveFactory";
|
|
10
|
+
import { CurvePrimitive } from "../curve/CurvePrimitive";
|
|
9
11
|
import { LineString3d } from "../curve/LineString3d";
|
|
10
12
|
import { Loop } from "../curve/Loop";
|
|
13
|
+
import { Path } from "../curve/Path";
|
|
14
|
+
import { RegionBinaryOpType, RegionOps } from "../curve/RegionOps";
|
|
15
|
+
import { UnionRegion } from "../curve/UnionRegion";
|
|
11
16
|
import { Geometry } from "../Geometry";
|
|
17
|
+
import { FrameBuilder } from "../geometry3d/FrameBuilder";
|
|
12
18
|
import { GrowableXYZArray } from "../geometry3d/GrowableXYZArray";
|
|
13
19
|
import { Point3dArrayCarrier } from "../geometry3d/Point3dArrayCarrier";
|
|
14
20
|
import { Point3d, Vector3d } from "../geometry3d/Point3dVector3d";
|
|
@@ -66,7 +72,7 @@ export var ClipStatus;
|
|
|
66
72
|
*/
|
|
67
73
|
class ClipUtilities {
|
|
68
74
|
/**
|
|
69
|
-
*
|
|
75
|
+
* Augment the unsortedFractionsArray with 0 and 1
|
|
70
76
|
* * sort
|
|
71
77
|
* * test the midpoint of each interval with `clipper.isPointOnOrInside`
|
|
72
78
|
* * pass accepted intervals to `announce(f0,f1,curve)`
|
|
@@ -113,8 +119,10 @@ class ClipUtilities {
|
|
|
113
119
|
return intervals.length > 0;
|
|
114
120
|
}
|
|
115
121
|
/**
|
|
116
|
-
*
|
|
117
|
-
*
|
|
122
|
+
* Compute and return portions of the input curve that are within the clipper.
|
|
123
|
+
* @param curve input curve, unmodified
|
|
124
|
+
* @param clipper used to compute the clipped components
|
|
125
|
+
* @return array of clipped curves
|
|
118
126
|
*/
|
|
119
127
|
static collectClippedCurves(curve, clipper) {
|
|
120
128
|
const result = [];
|
|
@@ -127,6 +135,79 @@ class ClipUtilities {
|
|
|
127
135
|
});
|
|
128
136
|
return result;
|
|
129
137
|
}
|
|
138
|
+
/**
|
|
139
|
+
* Compute and return the portions of the input region that are within the clipper.
|
|
140
|
+
* @param region input region, unmodified
|
|
141
|
+
* @param clipper used to compute the clipped components
|
|
142
|
+
* @return clipped subregion, as a single `AnyRegion`
|
|
143
|
+
*/
|
|
144
|
+
static clipAnyRegion(region, clipper) {
|
|
145
|
+
let result;
|
|
146
|
+
// Create "local region" which is the result of rotating region to make
|
|
147
|
+
// it parallel to the xy-plane and then translating it to the xy-plane.
|
|
148
|
+
const localToWorld = ClipUtilities._workTransform = FrameBuilder.createRightHandedFrame(undefined, region, ClipUtilities._workTransform);
|
|
149
|
+
if (!localToWorld)
|
|
150
|
+
return result;
|
|
151
|
+
const worldToLocal = localToWorld?.inverse();
|
|
152
|
+
if (!worldToLocal)
|
|
153
|
+
return result;
|
|
154
|
+
const localRegion = region.cloneTransformed(worldToLocal);
|
|
155
|
+
if (!localRegion)
|
|
156
|
+
return result;
|
|
157
|
+
// We can only clip convex polygons with our clipper machinery, but the input region doesn't have to be
|
|
158
|
+
// convex or even a polygon. We get around this limitation by using a Boolean operation, which admits
|
|
159
|
+
// *any* planar regions, albeit in local coordinates. First, we clip a rectangle that covers the input region
|
|
160
|
+
// (in world coordinates), then we intersect the resulting fragments with the input region in local coordinates.
|
|
161
|
+
// Finally, we assemble the results into a UnionRegion back in world coordinates.
|
|
162
|
+
const localRegionRange = ClipUtilities._workRange = localRegion.range();
|
|
163
|
+
const xLength = localRegionRange.xLength();
|
|
164
|
+
const yLength = localRegionRange.yLength();
|
|
165
|
+
const rectangle = LineString3d.createRectangleXY(localRegionRange.low, xLength, yLength, true);
|
|
166
|
+
rectangle.tryTransformInPlace(localToWorld);
|
|
167
|
+
// Clip the rectangle to produce fragment(s) which we can Boolean intersect with the input region.
|
|
168
|
+
const insideFragments = [];
|
|
169
|
+
const outsideFragments = [];
|
|
170
|
+
const cache = new GrowableXYZArrayCache();
|
|
171
|
+
clipper.appendPolygonClip?.(rectangle.packedPoints, insideFragments, outsideFragments, cache);
|
|
172
|
+
if (insideFragments.length === 0)
|
|
173
|
+
return result;
|
|
174
|
+
// Create the "clipped region".
|
|
175
|
+
for (const fragment of insideFragments) {
|
|
176
|
+
const loop = Loop.createPolygon(fragment);
|
|
177
|
+
loop.tryTransformInPlace(worldToLocal);
|
|
178
|
+
const clippedLocalRegion = RegionOps.regionBooleanXY(localRegion, loop, RegionBinaryOpType.Intersection);
|
|
179
|
+
if (clippedLocalRegion) {
|
|
180
|
+
clippedLocalRegion.tryTransformInPlace(localToWorld);
|
|
181
|
+
if (!result)
|
|
182
|
+
result = (clippedLocalRegion instanceof UnionRegion) ? clippedLocalRegion : UnionRegion.create(clippedLocalRegion);
|
|
183
|
+
else if (!result.tryAddChild(clippedLocalRegion))
|
|
184
|
+
result.children.push(...clippedLocalRegion.children);
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
return result;
|
|
188
|
+
}
|
|
189
|
+
/**
|
|
190
|
+
* Compute and return portions of the input curve or region that are within the clipper.
|
|
191
|
+
* @param curve input curve or region, unmodified
|
|
192
|
+
* @param clipper used to compute the clipped components
|
|
193
|
+
* @return array of clipped components of the input curve or region that lie inside the clipper
|
|
194
|
+
*/
|
|
195
|
+
static clipAnyCurve(curve, clipper) {
|
|
196
|
+
if (curve instanceof CurvePrimitive)
|
|
197
|
+
return ClipUtilities.collectClippedCurves(curve, clipper);
|
|
198
|
+
if (curve.isAnyRegion()) {
|
|
199
|
+
const ret = ClipUtilities.clipAnyRegion(curve, clipper);
|
|
200
|
+
return ret ? [ret] : [];
|
|
201
|
+
}
|
|
202
|
+
const result = [];
|
|
203
|
+
if (curve instanceof Path || curve instanceof BagOfCurves) {
|
|
204
|
+
for (const child of curve.children) {
|
|
205
|
+
const partialClip = ClipUtilities.clipAnyCurve(child, clipper);
|
|
206
|
+
result.push(...partialClip);
|
|
207
|
+
}
|
|
208
|
+
}
|
|
209
|
+
return result;
|
|
210
|
+
}
|
|
130
211
|
/**
|
|
131
212
|
* Clip a polygon down to regions defined by each shape of a ClipShape.
|
|
132
213
|
* @return An multidimensional array of points, where each array is the boundary of part of the remaining polygon.
|