@itwin/core-geometry 4.2.0-dev.3 → 4.2.0-dev.30
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 +59 -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 +20 -8
- package/lib/cjs/clipping/ClipUtils.d.ts.map +1 -1
- package/lib/cjs/clipping/ClipUtils.js +77 -2
- 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/CurveCollection.d.ts +4 -17
- package/lib/cjs/curve/CurveCollection.d.ts.map +1 -1
- package/lib/cjs/curve/CurveCollection.js +3 -22
- 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 +1 -1
- 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 +16 -2
- package/lib/cjs/curve/RegionOps.d.ts.map +1 -1
- package/lib/cjs/curve/RegionOps.js +18 -1
- 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/UnionRegion.d.ts +1 -1
- package/lib/cjs/curve/UnionRegion.js +1 -1
- 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/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.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 +0 -1
- 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 +1 -1
- package/lib/cjs/geometry3d/PolygonOps.d.ts.map +1 -1
- package/lib/cjs/geometry3d/PolygonOps.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/YawPitchRollAngles.js +1 -1
- package/lib/cjs/geometry3d/YawPitchRollAngles.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 +1 -1
- package/lib/cjs/polyface/PolyfaceBuilder.js.map +1 -1
- package/lib/cjs/polyface/PolyfaceClip.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 +1 -1
- package/lib/cjs/solid/SweepContour.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 +20 -8
- package/lib/esm/clipping/ClipUtils.d.ts.map +1 -1
- package/lib/esm/clipping/ClipUtils.js +77 -2
- 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/CurveCollection.d.ts +4 -17
- package/lib/esm/curve/CurveCollection.d.ts.map +1 -1
- package/lib/esm/curve/CurveCollection.js +2 -20
- 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 +1 -1
- 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 +16 -2
- package/lib/esm/curve/RegionOps.d.ts.map +1 -1
- package/lib/esm/curve/RegionOps.js +16 -0
- 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/UnionRegion.d.ts +1 -1
- package/lib/esm/curve/UnionRegion.js +1 -1
- 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/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.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 +0 -1
- 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 +1 -1
- package/lib/esm/geometry3d/PolygonOps.d.ts.map +1 -1
- package/lib/esm/geometry3d/PolygonOps.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/YawPitchRollAngles.js +1 -1
- package/lib/esm/geometry3d/YawPitchRollAngles.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 +1 -1
- package/lib/esm/polyface/PolyfaceBuilder.js.map +1 -1
- package/lib/esm/polyface/PolyfaceClip.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 +1 -1
- package/lib/esm/solid/SweepContour.js.map +1 -1
- package/package.json +3 -3
- 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
package/lib/cjs/curve/{CurveCurveCloseApproachXY.js → internalContexts/CurveCurveCloseApproachXY.js}
RENAMED
|
@@ -8,32 +8,34 @@ exports.CurveCurveCloseApproachXY = void 0;
|
|
|
8
8
|
/** @packageDocumentation
|
|
9
9
|
* @module Curve
|
|
10
10
|
*/
|
|
11
|
-
const BSplineCurve_1 = require("
|
|
12
|
-
const Geometry_1 = require("
|
|
13
|
-
const GeometryHandler_1 = require("
|
|
14
|
-
const GrowableFloat64Array_1 = require("
|
|
15
|
-
const Point3dVector3d_1 = require("
|
|
16
|
-
const Range_1 = require("
|
|
17
|
-
const Polynomials_1 = require("
|
|
18
|
-
const Arc3d_1 = require("
|
|
19
|
-
const
|
|
20
|
-
const
|
|
21
|
-
const
|
|
11
|
+
const BSplineCurve_1 = require("../../bspline/BSplineCurve");
|
|
12
|
+
const Geometry_1 = require("../../Geometry");
|
|
13
|
+
const GeometryHandler_1 = require("../../geometry3d/GeometryHandler");
|
|
14
|
+
const GrowableFloat64Array_1 = require("../../geometry3d/GrowableFloat64Array");
|
|
15
|
+
const Point3dVector3d_1 = require("../../geometry3d/Point3dVector3d");
|
|
16
|
+
const Range_1 = require("../../geometry3d/Range");
|
|
17
|
+
const Polynomials_1 = require("../../numerics/Polynomials");
|
|
18
|
+
const Arc3d_1 = require("../Arc3d");
|
|
19
|
+
const CurveCollection_1 = require("../CurveCollection");
|
|
20
|
+
const CurveLocationDetail_1 = require("../CurveLocationDetail");
|
|
21
|
+
const LineSegment3d_1 = require("../LineSegment3d");
|
|
22
|
+
const LineString3d_1 = require("../LineString3d");
|
|
22
23
|
// cspell:word XYRR
|
|
23
24
|
/**
|
|
24
25
|
* Handler class for XY close approach between _geometryB and another geometry.
|
|
25
|
-
* * Approach means the distance between _geometryB and another geometry.
|
|
26
|
-
* * **NOTE:** GeometryQuery input (_geometryB) should really be AnyCurve.
|
|
26
|
+
* * Approach means the XY distance (z is ignored) between _geometryB and another geometry.
|
|
27
27
|
* * Closest approach is a measure of the proximity of one curve to another. It's the length of the shortest line
|
|
28
28
|
* segment perpendicular to both curves; if the curves intersect, the closest approach is zero. In the context of
|
|
29
29
|
* this class, z-coordinates are ignored, so the closest approach is as seen in the top view. If you have coplanar
|
|
30
|
-
* input curves, rotate them first into a plane parallel to the
|
|
31
|
-
* results back as required.
|
|
30
|
+
* input curves and want to find closest approach in their plane, rotate them first into a plane parallel to the
|
|
31
|
+
* xy-plane, then afterward, rotate the results back as required.
|
|
32
|
+
* * Close approach can also be from a curve endpoint perpendicular to another curve or from a curve endpoint to
|
|
33
|
+
* another curve endpoint.
|
|
32
34
|
* * Instances are initialized and called from CurveCurve.
|
|
33
35
|
* * geometryB is saved for later reference.
|
|
34
36
|
* @internal
|
|
35
37
|
*/
|
|
36
|
-
class CurveCurveCloseApproachXY extends GeometryHandler_1.
|
|
38
|
+
class CurveCurveCloseApproachXY extends GeometryHandler_1.RecurseToCurvesGeometryHandler {
|
|
37
39
|
setGeometryB(geometryB) {
|
|
38
40
|
this._geometryB = geometryB;
|
|
39
41
|
this._circularArcB = undefined;
|
|
@@ -59,13 +61,13 @@ class CurveCurveCloseApproachXY extends GeometryHandler_1.NullGeometryHandler {
|
|
|
59
61
|
this._maxDistanceSquared = Geometry_1.Geometry.smallMetricDistanceSquared;
|
|
60
62
|
this.reinitialize();
|
|
61
63
|
}
|
|
62
|
-
/** Set the (possibly undefined) max distance to accept. */
|
|
64
|
+
/** Set the (possibly undefined) max XY distance (z is ignored) to accept. */
|
|
63
65
|
set maxDistanceToAccept(value) {
|
|
64
66
|
this._maxDistanceToAccept = value;
|
|
65
67
|
if (this._maxDistanceToAccept !== undefined && this._maxDistanceToAccept > 0)
|
|
66
68
|
this._maxDistanceSquared = this._maxDistanceToAccept * this._maxDistanceToAccept;
|
|
67
69
|
}
|
|
68
|
-
/** Access the (possibly undefined) max distance to accept. */
|
|
70
|
+
/** Access the (possibly undefined) max XY distance (z is ignored) to accept. */
|
|
69
71
|
get maxDistanceToAccept() {
|
|
70
72
|
return this._maxDistanceToAccept;
|
|
71
73
|
}
|
|
@@ -77,7 +79,7 @@ class CurveCurveCloseApproachXY extends GeometryHandler_1.NullGeometryHandler {
|
|
|
77
79
|
resetGeometry(geometryB) {
|
|
78
80
|
this.setGeometryB(geometryB);
|
|
79
81
|
}
|
|
80
|
-
/**
|
|
82
|
+
/** returns true if `fraction` is in [0,1] within tolerance */
|
|
81
83
|
acceptFraction(fraction, fractionTol = 1.0e-12) {
|
|
82
84
|
if (fraction < -fractionTol)
|
|
83
85
|
return false;
|
|
@@ -99,6 +101,10 @@ class CurveCurveCloseApproachXY extends GeometryHandler_1.NullGeometryHandler {
|
|
|
99
101
|
sameCurveAndFraction(cp, fraction, detail) {
|
|
100
102
|
return cp === detail.curve && Geometry_1.Geometry.isAlmostEqualNumber(fraction, detail.fraction);
|
|
101
103
|
}
|
|
104
|
+
/**
|
|
105
|
+
* If distance between pointA and pointB is less than maxDistance, record CurveLocationDetailPair which is
|
|
106
|
+
* the approach from pointA to pointB.
|
|
107
|
+
*/
|
|
102
108
|
testAndRecordPointPairApproach(cpA, fA, pointA, cpB, fB, pointB, reversed) {
|
|
103
109
|
const d2 = pointA.distanceSquaredXY(pointB);
|
|
104
110
|
if (d2 < this._maxDistanceSquared) {
|
|
@@ -111,16 +117,24 @@ class CurveCurveCloseApproachXY extends GeometryHandler_1.NullGeometryHandler {
|
|
|
111
117
|
}
|
|
112
118
|
}
|
|
113
119
|
/**
|
|
114
|
-
*
|
|
115
|
-
*
|
|
116
|
-
*
|
|
120
|
+
* Create a close approach pair if XY distance is within maxDistance.
|
|
121
|
+
* @param localFractionA a fraction on first curve
|
|
122
|
+
* @param cpA the first curve
|
|
123
|
+
* @param fractionA0 start of the first curve
|
|
124
|
+
* @param fractionA1 end of the first curve
|
|
125
|
+
* @param localFractionB a fraction on second curve
|
|
126
|
+
* @param cpB the second curve
|
|
127
|
+
* @param fractionB0 start of the second curve
|
|
128
|
+
* @param fractionB1 end of the second curve
|
|
129
|
+
* @param reversed true to have order reversed in final structures
|
|
130
|
+
* @param intervalDetails optional CurveLocationDetailPair
|
|
117
131
|
*/
|
|
118
|
-
recordPointWithLocalFractions(localFractionA, cpA, fractionA0, fractionA1, localFractionB,
|
|
119
|
-
cpB, fractionB0, fractionB1, reversed, intervalDetails) {
|
|
132
|
+
recordPointWithLocalFractions(localFractionA, cpA, fractionA0, fractionA1, localFractionB, cpB, fractionB0, fractionB1, reversed, intervalDetails) {
|
|
120
133
|
let globalFractionA, globalFractionB;
|
|
121
134
|
let globalFractionA1, globalFractionB1;
|
|
122
|
-
const isInterval =
|
|
123
|
-
intervalDetails.detailA.hasFraction1 &&
|
|
135
|
+
const isInterval = intervalDetails !== undefined &&
|
|
136
|
+
intervalDetails.detailA.hasFraction1 &&
|
|
137
|
+
intervalDetails.detailB.hasFraction1;
|
|
124
138
|
if (isInterval) {
|
|
125
139
|
globalFractionA = Geometry_1.Geometry.interpolate(fractionA0, intervalDetails.detailA.fraction, fractionA1);
|
|
126
140
|
globalFractionB = Geometry_1.Geometry.interpolate(fractionB0, intervalDetails.detailB.fraction, fractionB1);
|
|
@@ -131,7 +145,7 @@ class CurveCurveCloseApproachXY extends GeometryHandler_1.NullGeometryHandler {
|
|
|
131
145
|
globalFractionA = globalFractionA1 = Geometry_1.Geometry.interpolate(fractionA0, localFractionA, fractionA1);
|
|
132
146
|
globalFractionB = globalFractionB1 = Geometry_1.Geometry.interpolate(fractionB0, localFractionB, fractionB1);
|
|
133
147
|
}
|
|
134
|
-
// ignore duplicate of most recent
|
|
148
|
+
// ignore duplicate of most recent approach
|
|
135
149
|
const numPrevious = this._results.length;
|
|
136
150
|
if (numPrevious > 0 && !isInterval) {
|
|
137
151
|
const oldDetailA = this._results[numPrevious - 1].detailA;
|
|
@@ -154,6 +168,9 @@ class CurveCurveCloseApproachXY extends GeometryHandler_1.NullGeometryHandler {
|
|
|
154
168
|
detailB.captureFraction1Point1(globalFractionB1, cpB.fractionToPoint(globalFractionB1));
|
|
155
169
|
}
|
|
156
170
|
else {
|
|
171
|
+
const d2 = detailA.point.distanceSquaredXY(detailB.point);
|
|
172
|
+
if (d2 > this._maxDistanceSquared)
|
|
173
|
+
return;
|
|
157
174
|
detailA.setIntervalRole(CurveLocationDetail_1.CurveIntervalRole.isolated);
|
|
158
175
|
detailB.setIntervalRole(CurveLocationDetail_1.CurveIntervalRole.isolated);
|
|
159
176
|
}
|
|
@@ -166,12 +183,21 @@ class CurveCurveCloseApproachXY extends GeometryHandler_1.NullGeometryHandler {
|
|
|
166
183
|
}
|
|
167
184
|
/**
|
|
168
185
|
* Capture a close approach pair that has point and local fraction but not curve.
|
|
169
|
-
* Record with fraction
|
|
186
|
+
* * Record the pair, each detail modified with global fraction and input curve.
|
|
187
|
+
* * Pair is neither modified nor recorded if it would be a duplicate of the last recorded pair.
|
|
188
|
+
* @param pair details computed with local fractions
|
|
189
|
+
* @param cpA curveA
|
|
190
|
+
* @param fractionA0 global start fraction on curveA
|
|
191
|
+
* @param fractionA1 global end fraction on curveA
|
|
192
|
+
* @param cpB curveB
|
|
193
|
+
* @param fractionB0 global start fraction on curveB
|
|
194
|
+
* @param fractionB1 global end fraction on curveB
|
|
195
|
+
* @param reversed whether to reverse the details in the pair
|
|
170
196
|
*/
|
|
171
197
|
capturePairWithLocalFractions(pair, cpA, fractionA0, fractionA1, cpB, fractionB0, fractionB1, reversed) {
|
|
172
198
|
const globalFractionA = Geometry_1.Geometry.interpolate(fractionA0, pair.detailA.fraction, fractionA1);
|
|
173
199
|
const globalFractionB = Geometry_1.Geometry.interpolate(fractionB0, pair.detailB.fraction, fractionB1);
|
|
174
|
-
// ignore duplicate of most recent
|
|
200
|
+
// ignore duplicate of most recent pair
|
|
175
201
|
const numPrevious = this._results.length;
|
|
176
202
|
if (numPrevious > 0) {
|
|
177
203
|
const oldDetailA = this._results[numPrevious - 1].detailA;
|
|
@@ -187,18 +213,17 @@ class CurveCurveCloseApproachXY extends GeometryHandler_1.NullGeometryHandler {
|
|
|
187
213
|
return;
|
|
188
214
|
}
|
|
189
215
|
}
|
|
216
|
+
if (reversed)
|
|
217
|
+
pair.swapDetails();
|
|
218
|
+
// recompute the points just in case
|
|
219
|
+
CurveLocationDetail_1.CurveLocationDetail.createCurveEvaluatedFraction(cpA, globalFractionA, pair.detailA);
|
|
220
|
+
CurveLocationDetail_1.CurveLocationDetail.createCurveEvaluatedFraction(cpB, globalFractionB, pair.detailB);
|
|
190
221
|
pair.detailA.setIntervalRole(CurveLocationDetail_1.CurveIntervalRole.isolated);
|
|
191
222
|
pair.detailB.setIntervalRole(CurveLocationDetail_1.CurveIntervalRole.isolated);
|
|
192
|
-
|
|
193
|
-
this._results.push(pair);
|
|
194
|
-
}
|
|
195
|
-
else {
|
|
196
|
-
pair.swapDetails();
|
|
197
|
-
this._results.push(pair);
|
|
198
|
-
}
|
|
223
|
+
this._results.push(pair);
|
|
199
224
|
}
|
|
200
225
|
/**
|
|
201
|
-
* Emit recordPoint for multiple pairs (on full curve
|
|
226
|
+
* Emit recordPoint for multiple pairs (on full curve) if within maxDistance.
|
|
202
227
|
* @param cpA first curve primitive (possibly different from curve in detailA, but fraction compatible)
|
|
203
228
|
* @param cpB second curve primitive (possibly different from curve in detailA, but fraction compatible)
|
|
204
229
|
* @param pairs array of pairs
|
|
@@ -220,44 +245,40 @@ class CurveCurveCloseApproachXY extends GeometryHandler_1.NullGeometryHandler {
|
|
|
220
245
|
captureDetailPair(detailA, detailB, reversed) {
|
|
221
246
|
if (detailA && detailB) {
|
|
222
247
|
if (reversed) {
|
|
223
|
-
this._results.push(CurveLocationDetail_1.CurveLocationDetailPair.createCapture(
|
|
248
|
+
this._results.push(CurveLocationDetail_1.CurveLocationDetailPair.createCapture(detailB, detailA));
|
|
224
249
|
}
|
|
225
250
|
else {
|
|
226
|
-
this._results.push(CurveLocationDetail_1.CurveLocationDetailPair.createCapture(
|
|
251
|
+
this._results.push(CurveLocationDetail_1.CurveLocationDetailPair.createCapture(detailA, detailB));
|
|
227
252
|
}
|
|
228
253
|
}
|
|
229
254
|
}
|
|
230
|
-
static updatePointToSegmentDistance(fractionA, pointA, pointB0, pointB1, fractionB,
|
|
255
|
+
static updatePointToSegmentDistance(fractionA, pointA, pointB0, pointB1, fractionB, maxDistanceSquared, closestApproach) {
|
|
256
|
+
let updated = false;
|
|
231
257
|
if (fractionB < 0)
|
|
232
258
|
fractionB = 0;
|
|
233
259
|
else if (fractionB > 1)
|
|
234
260
|
fractionB = 1;
|
|
235
261
|
this._workPointB = pointB0.interpolate(fractionB, pointB1, this._workPointB);
|
|
236
262
|
const distanceSquared = this._workPointB.distanceSquaredXY(pointA);
|
|
237
|
-
if (distanceSquared
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
closestApproach.detailA.setFP(fractionA, pointA);
|
|
242
|
-
closestApproach.detailA.a = distanceSquared;
|
|
243
|
-
closestApproach.detailB.setFP(fractionB, this._workPointB);
|
|
244
|
-
closestApproach.detailA.a = distanceSquared;
|
|
245
|
-
}
|
|
263
|
+
if (distanceSquared <= Math.min(maxDistanceSquared, closestApproach.detailA.a)) {
|
|
264
|
+
closestApproach.detailA.setFP(fractionA, pointA, undefined, distanceSquared);
|
|
265
|
+
closestApproach.detailB.setFP(fractionB, this._workPointB, undefined, distanceSquared);
|
|
266
|
+
updated = true;
|
|
246
267
|
}
|
|
247
|
-
return
|
|
268
|
+
return updated;
|
|
248
269
|
}
|
|
249
270
|
/**
|
|
250
|
-
* Return fractions of close approach within
|
|
251
|
-
* *
|
|
252
|
-
* Return the fractional (not xy) coordinates in result.x, result.y
|
|
271
|
+
* Return fractions of close approach within maxDistance between two line segments (a0,a1) and (b0,b1).
|
|
272
|
+
* * Math details can be found at docs/learning/geometry/CurveCurve.md
|
|
253
273
|
* @param a0 start point of line a
|
|
254
|
-
* @param a1
|
|
255
|
-
* @param b0
|
|
274
|
+
* @param a1 end point of line a
|
|
275
|
+
* @param b0 start point of line b
|
|
256
276
|
* @param b1 end point of line b
|
|
257
|
-
* @param
|
|
277
|
+
* @param maxDistanceSquared maximum distance squared (assumed to be positive)
|
|
278
|
+
* @returns the fractional (not xy) coordinates in result.x and result.y. result.x is fraction on line a.
|
|
258
279
|
* result.y is fraction on line b.
|
|
259
280
|
*/
|
|
260
|
-
static segmentSegmentBoundedApproach(a0, a1, b0, b1,
|
|
281
|
+
static segmentSegmentBoundedApproach(a0, a1, b0, b1, maxDistanceSquared) {
|
|
261
282
|
const ux = a1.x - a0.x;
|
|
262
283
|
const uy = a1.y - a0.y;
|
|
263
284
|
const vx = b1.x - b0.x;
|
|
@@ -268,31 +289,61 @@ class CurveCurveCloseApproachXY extends GeometryHandler_1.NullGeometryHandler {
|
|
|
268
289
|
const e01y = b1.y - a0.y;
|
|
269
290
|
const e10x = b0.x - a1.x;
|
|
270
291
|
const e10y = b0.y - a1.y;
|
|
271
|
-
const e11x = b1.x - a1.x;
|
|
272
|
-
const e11y = b1.y - a1.y;
|
|
273
292
|
const hab0 = Geometry_1.Geometry.crossProductXYXY(ux, uy, e00x, e00y);
|
|
274
293
|
const hab1 = Geometry_1.Geometry.crossProductXYXY(ux, uy, e01x, e01y);
|
|
275
294
|
const hba0 = -Geometry_1.Geometry.crossProductXYXY(vx, vy, e00x, e00y);
|
|
276
|
-
const hba1 = -Geometry_1.Geometry.crossProductXYXY(vx, vy,
|
|
277
|
-
if (hab0 * hab1 < 0.0 && hba0 * hba1 < 0.0) {
|
|
278
|
-
// true intersection, strictly within both segments !!!
|
|
295
|
+
const hba1 = -Geometry_1.Geometry.crossProductXYXY(vx, vy, e10x, e10y);
|
|
296
|
+
if (hab0 * hab1 < 0.0 && hba0 * hba1 < 0.0) { // true intersection, strictly within both segments
|
|
279
297
|
const fractionA = -hba0 / (hba1 - hba0);
|
|
280
298
|
const fractionB = -hab0 / (hab1 - hab0);
|
|
281
299
|
return CurveLocationDetail_1.CurveLocationDetailPair.createCapture(CurveLocationDetail_1.CurveLocationDetail.createCurveFractionPoint(undefined, fractionA, a0.interpolate(fractionA, a1)), CurveLocationDetail_1.CurveLocationDetail.createCurveFractionPoint(undefined, fractionB, b0.interpolate(fractionB, b1)));
|
|
282
300
|
}
|
|
283
|
-
|
|
301
|
+
// there's no intersection, so find the closest approach within maxDistance from an endpoint
|
|
302
|
+
const closestApproach = new CurveLocationDetail_1.CurveLocationDetailPair();
|
|
303
|
+
closestApproach.detailA.a = 2 * maxDistanceSquared; // init to an approach that's too far away
|
|
304
|
+
let reversed = false;
|
|
284
305
|
const uu = Geometry_1.Geometry.hypotenuseSquaredXY(ux, uy);
|
|
285
|
-
if (hab0 * hab0
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
306
|
+
if (hab0 * hab0 <= maxDistanceSquared * uu) { // test distance of b0 to u
|
|
307
|
+
const fractionA = Geometry_1.Geometry.dotProductXYXY(ux, uy, e00x, e00y) / uu;
|
|
308
|
+
if (this.updatePointToSegmentDistance(0, b0, a0, a1, fractionA, maxDistanceSquared, closestApproach))
|
|
309
|
+
reversed = true;
|
|
310
|
+
}
|
|
311
|
+
if (hab1 * hab1 <= maxDistanceSquared * uu) { // test distance of b1 to u
|
|
312
|
+
const fractionA = Geometry_1.Geometry.dotProductXYXY(ux, uy, e01x, e01y) / uu;
|
|
313
|
+
if (this.updatePointToSegmentDistance(1, b1, a0, a1, fractionA, maxDistanceSquared, closestApproach))
|
|
314
|
+
reversed = true;
|
|
315
|
+
}
|
|
289
316
|
const vv = Geometry_1.Geometry.hypotenuseSquaredXY(vx, vy);
|
|
290
|
-
if (hba0 * hba0
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
317
|
+
if (hba0 * hba0 <= maxDistanceSquared * vv) { // test distance of a0 to v
|
|
318
|
+
const fractionB = -Geometry_1.Geometry.dotProductXYXY(vx, vy, e00x, e00y) / vv;
|
|
319
|
+
if (this.updatePointToSegmentDistance(0, a0, b0, b1, fractionB, maxDistanceSquared, closestApproach))
|
|
320
|
+
reversed = false;
|
|
321
|
+
}
|
|
322
|
+
if (hba1 * hba1 <= maxDistanceSquared * vv) { // test distance of a1 to v
|
|
323
|
+
const fractionB = -Geometry_1.Geometry.dotProductXYXY(vx, vy, e10x, e10y) / vv;
|
|
324
|
+
if (this.updatePointToSegmentDistance(1, a1, b0, b1, fractionB, maxDistanceSquared, closestApproach))
|
|
325
|
+
reversed = false;
|
|
326
|
+
}
|
|
327
|
+
if (closestApproach.detailA.a > maxDistanceSquared)
|
|
328
|
+
return undefined;
|
|
329
|
+
if (reversed)
|
|
330
|
+
closestApproach.swapDetails();
|
|
294
331
|
return closestApproach;
|
|
295
332
|
}
|
|
333
|
+
/**
|
|
334
|
+
* Check different combination of fractions on curveA and curveB. If distance between points at 2 fractions
|
|
335
|
+
* is less than maxDistance, record CurveLocationDetailPair which is the approach between the 2 points.
|
|
336
|
+
* Optionally, record close approaches of one curve's points if they fall between the other curve's points.
|
|
337
|
+
* @param cpA curveA
|
|
338
|
+
* @param fA0 fraction0 on curveA
|
|
339
|
+
* @param fA1 fraction1 on curveA
|
|
340
|
+
* @param testProjectionOnA whether to record projections of the given curveB points onto curveA
|
|
341
|
+
* @param cpB curveB
|
|
342
|
+
* @param fB0 fraction0 on curveB
|
|
343
|
+
* @param fB1 fraction0 on curveB
|
|
344
|
+
* @param testProjectionOnB whether to record projections of the given curveA points onto curveB
|
|
345
|
+
* @param reversed true to have order reversed in final structures.
|
|
346
|
+
*/
|
|
296
347
|
testAndRecordFractionalPairApproach(cpA, fA0, fA1, testProjectionOnA, cpB, fB0, fB1, testProjectionOnB, reversed) {
|
|
297
348
|
const pointA0 = cpA.fractionToPoint(fA0);
|
|
298
349
|
const pointA1 = cpA.fractionToPoint(fA1);
|
|
@@ -311,12 +362,13 @@ class CurveCurveCloseApproachXY extends GeometryHandler_1.NullGeometryHandler {
|
|
|
311
362
|
this.testAndRecordProjection(cpB, fB1, pointB1, cpA, fA0, fA1, !reversed);
|
|
312
363
|
}
|
|
313
364
|
}
|
|
365
|
+
/** Find the closest approach between pointA and cpB. Add the approach if it's within fB0 and fB1. */
|
|
314
366
|
testAndRecordProjection(cpA, fA, pointA, cpB, fB0, fB1, reversed) {
|
|
315
367
|
// NO NO NO -- this is 3D closest point --- need 2d !!
|
|
316
368
|
const detail = cpB.closestPoint(pointA, false);
|
|
317
369
|
if (detail) {
|
|
318
370
|
const fB = Geometry_1.Geometry.restrictToInterval(detail.fraction, fB0, fB1);
|
|
319
|
-
if (fB === detail.fraction) {
|
|
371
|
+
if (fB === detail.fraction) { // if fraction is within fB0 and fB1
|
|
320
372
|
this.testAndRecordPointPairApproach(cpA, fA, pointA, cpB, detail.fraction, detail.point, reversed);
|
|
321
373
|
}
|
|
322
374
|
}
|
|
@@ -328,53 +380,73 @@ class CurveCurveCloseApproachXY extends GeometryHandler_1.NullGeometryHandler {
|
|
|
328
380
|
* * The fraction mappings allow portions of a linestring to be passed here.
|
|
329
381
|
*/
|
|
330
382
|
computeSegmentSegment3D(cpA, pointA0, fractionA0, pointA1, fractionA1, cpB, pointB0, fractionB0, pointB1, fractionB1, reversed) {
|
|
383
|
+
// compute a pair with fractions local to segments
|
|
331
384
|
const approach = CurveCurveCloseApproachXY.segmentSegmentBoundedApproach(pointA0, pointA1, pointB0, pointB1, this._maxDistanceSquared);
|
|
332
|
-
if
|
|
385
|
+
// adjust the pair to refer to input curves and global fractions, then record it if new
|
|
386
|
+
if (approach) {
|
|
387
|
+
approach.detailA.setCurve(cpA);
|
|
388
|
+
approach.detailB.setCurve(cpB);
|
|
333
389
|
this.capturePairWithLocalFractions(approach, cpA, fractionA0, fractionA1, cpB, fractionB0, fractionB1, reversed);
|
|
390
|
+
}
|
|
334
391
|
}
|
|
335
|
-
|
|
336
|
-
// (The line segment in question might be (a) a full line segment or (b) a fragment within a linestring.
|
|
337
|
-
// The fraction and extend parameters allow all combinations to be passed in)
|
|
338
|
-
// This method applies transform.
|
|
392
|
+
/** Low level dispatch of segment with segment. */
|
|
339
393
|
dispatchSegmentSegment(cpA, pointA0, fractionA0, pointA1, fractionA1, cpB, pointB0, fractionB0, pointB1, fractionB1, reversed) {
|
|
340
394
|
this.computeSegmentSegment3D(cpA, pointA0, fractionA0, pointA1, fractionA1, cpB, pointB0, fractionB0, pointB1, fractionB1, reversed);
|
|
341
395
|
}
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
396
|
+
/**
|
|
397
|
+
* Low level dispatch of segment with arc.
|
|
398
|
+
* Find close approaches within maxDistance between a line segments (pointA0, pointA1) and an arc.
|
|
399
|
+
* To consider:
|
|
400
|
+
* 1) intersection between arc and segment.
|
|
401
|
+
* 2) arc endpoints to segment endpoints or arc endpoints projection to the segment.
|
|
402
|
+
* 3) line parallel to arc tangent.
|
|
403
|
+
* @param cpA curve A (line segment or line string)
|
|
404
|
+
* @param pointA0 start point of the segment
|
|
405
|
+
* @param fractionA0 fraction of the start of the segment
|
|
406
|
+
* @param pointA1 end point of the segment
|
|
407
|
+
* @param fractionA1 fraction of the end of the segment
|
|
408
|
+
* @param arc the arc
|
|
409
|
+
* @param reversed true to have order reversed in final structures
|
|
410
|
+
*/
|
|
345
411
|
dispatchSegmentArc(cpA, pointA0, fractionA0, pointA1, fractionA1, arc, reversed) {
|
|
346
|
-
//
|
|
347
|
-
//
|
|
348
|
-
//
|
|
349
|
-
//
|
|
350
|
-
|
|
351
|
-
//
|
|
352
|
-
// Line: contains points A0,A1
|
|
353
|
-
// Arc point colinear with line if det (A0, A1, X) = 0
|
|
354
|
-
// with homogeneous xyw points and vectors.
|
|
355
|
-
// With equational X: det (A0, A1, C) + c det (A0, A1,U) + s det (A0, A1, V) = 0.
|
|
412
|
+
// 1) intersection between arc and segment
|
|
413
|
+
// Suppose:
|
|
414
|
+
// Arc: X = C + cU + sV where c = cos(theta) and s = sin(theta)
|
|
415
|
+
// Line: contains points A0 and A1
|
|
416
|
+
// The arc intersects the line at point X if det(A0, A1, X) = 0 with homogeneous xyw points and vectors.
|
|
417
|
+
// With equational X: det(A0, A1, C) + c*det(A0, A1, U) + s*det(A0, A1, V) = 0.
|
|
356
418
|
// solve for theta.
|
|
357
419
|
// evaluate points.
|
|
358
420
|
// project back to line.
|
|
421
|
+
let intersectionFound = false;
|
|
359
422
|
const data = arc.toTransformedVectors();
|
|
360
423
|
const pointA0Local = pointA0;
|
|
361
424
|
const pointA1Local = pointA1;
|
|
362
|
-
const alpha = Geometry_1.Geometry.tripleProductXYW(pointA0Local, 1, pointA1Local, 1, data.center, 1);
|
|
363
|
-
const beta = Geometry_1.Geometry.tripleProductXYW(pointA0Local, 1, pointA1Local, 1, data.vector0, 0);
|
|
364
|
-
const gamma = Geometry_1.Geometry.tripleProductXYW(pointA0Local, 1, pointA1Local, 1, data.vector90, 0);
|
|
425
|
+
const alpha = Geometry_1.Geometry.tripleProductXYW(pointA0Local, 1, pointA1Local, 1, data.center, 1); // det(A0, A1, C)
|
|
426
|
+
const beta = Geometry_1.Geometry.tripleProductXYW(pointA0Local, 1, pointA1Local, 1, data.vector0, 0); // det(A0, A1, U)
|
|
427
|
+
const gamma = Geometry_1.Geometry.tripleProductXYW(pointA0Local, 1, pointA1Local, 1, data.vector90, 0); // det(A0, A1, V)
|
|
365
428
|
const cosines = new GrowableFloat64Array_1.GrowableFloat64Array(2);
|
|
366
429
|
const sines = new GrowableFloat64Array_1.GrowableFloat64Array(2);
|
|
367
430
|
const radians = new GrowableFloat64Array_1.GrowableFloat64Array(2);
|
|
368
|
-
const numRoots = Polynomials_1.AnalyticRoots.appendImplicitLineUnitCircleIntersections(
|
|
431
|
+
const numRoots = Polynomials_1.AnalyticRoots.appendImplicitLineUnitCircleIntersections(// solve the equation
|
|
432
|
+
alpha, beta, gamma, cosines, sines, radians);
|
|
369
433
|
for (let i = 0; i < numRoots; i++) {
|
|
370
434
|
const arcPoint = data.center.plus2Scaled(data.vector0, cosines.atUncheckedIndex(i), data.vector90, sines.atUncheckedIndex(i));
|
|
371
435
|
const arcFraction = data.sweep.radiansToSignedPeriodicFraction(radians.atUncheckedIndex(i));
|
|
372
436
|
const lineFraction = Polynomials_1.SmallSystem.lineSegment3dXYClosestPointUnbounded(pointA0Local, pointA1Local, arcPoint);
|
|
437
|
+
// only add if the point is within the start and end fractions of both line segment and arc
|
|
373
438
|
if (lineFraction !== undefined && this.acceptFraction(lineFraction) && this.acceptFraction(arcFraction)) {
|
|
374
439
|
this.recordPointWithLocalFractions(lineFraction, cpA, fractionA0, fractionA1, arcFraction, arc, 0, 1, reversed);
|
|
440
|
+
intersectionFound = true;
|
|
375
441
|
}
|
|
376
442
|
}
|
|
377
|
-
|
|
443
|
+
if (intersectionFound)
|
|
444
|
+
return;
|
|
445
|
+
// 2) endpoints to endpoints or endpoints projection to the other curve
|
|
446
|
+
this.testAndRecordFractionalPairApproach(cpA, fractionA0, fractionA1, true, arc, 0, 1, false, reversed);
|
|
447
|
+
// 3) line parallel to arc tangent.
|
|
448
|
+
// If line does not intersect the arc, then the closest (and/or the furthest) point on arc to the line is a
|
|
449
|
+
// point where the tangent line on arc at that point is parallel to the line.
|
|
378
450
|
const dotUT = data.vector0.crossProductStartEndXY(pointA0, pointA1);
|
|
379
451
|
const dotVT = data.vector90.crossProductStartEndXY(pointA0, pointA1);
|
|
380
452
|
const parallelRadians = Math.atan2(dotVT, dotUT);
|
|
@@ -382,53 +454,43 @@ class CurveCurveCloseApproachXY extends GeometryHandler_1.NullGeometryHandler {
|
|
|
382
454
|
const arcPoint = data.center.plus2Scaled(data.vector0, Math.cos(radians1), data.vector90, Math.sin(radians1));
|
|
383
455
|
const arcFraction = data.sweep.radiansToSignedPeriodicFraction(radians1);
|
|
384
456
|
const lineFraction = Polynomials_1.SmallSystem.lineSegment3dXYClosestPointUnbounded(pointA0Local, pointA1Local, arcPoint);
|
|
457
|
+
// only add if the point is within the start and end fractions of both line segment and arc
|
|
385
458
|
if (lineFraction !== undefined && this.acceptFraction(lineFraction) && this.acceptFraction(arcFraction)) {
|
|
386
459
|
this.recordPointWithLocalFractions(lineFraction, cpA, fractionA0, fractionA1, arcFraction, arc, 0, 1, reversed);
|
|
387
460
|
}
|
|
388
461
|
}
|
|
389
462
|
}
|
|
390
|
-
|
|
463
|
+
/** Low level dispatch of circular arc with circular arc. radiusA must be larger than or equal to radiusB. */
|
|
391
464
|
dispatchCircularCircularOrdered(cpA, radiusA, cpB, radiusB, reversed) {
|
|
392
465
|
const c = cpA.center.distance(cpB.center);
|
|
393
466
|
const e = this._maxDistanceToAccept !== undefined ? this._maxDistanceToAccept : Geometry_1.Geometry.smallMetricDistance;
|
|
394
|
-
if (c > radiusA + radiusB + e) //
|
|
467
|
+
if (c > radiusA + radiusB + e) // distance between circles is more than max distance
|
|
395
468
|
return;
|
|
396
|
-
//
|
|
397
|
-
//
|
|
398
|
-
// 2) true intersection
|
|
399
|
-
// 3) line parallel to arc tangent.
|
|
469
|
+
// TODO: 1) intersection between arcs
|
|
470
|
+
// 2) endpoints to endpoints
|
|
400
471
|
this.testAndRecordFractionalPairApproach(cpA, 0, 1, false, cpB, 0, 1, false, reversed);
|
|
472
|
+
// 3) line from one arc to another (perpendicular to arc tangents along center-center line)
|
|
401
473
|
if (!Geometry_1.Geometry.isSmallMetricDistance(c)) {
|
|
402
|
-
// ?? endpoint hits are recorded. Maybe also need overlap?
|
|
403
474
|
const vectorAB = Point3dVector3d_1.Vector3d.createStartEnd(cpA.center, cpB.center);
|
|
404
475
|
vectorAB.scaleInPlace(1.0 / c);
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
if (detailA) {
|
|
415
|
-
const detailB = this.resolveDirectionToArcXYFraction(cpB, vectorAB, rB);
|
|
416
|
-
if (detailB) {
|
|
417
|
-
this.captureDetailPair(detailA, detailB, reversed);
|
|
418
|
-
}
|
|
419
|
-
}
|
|
476
|
+
for (const rA of [-radiusA, radiusA]) {
|
|
477
|
+
for (const rB of [-radiusB, radiusB]) {
|
|
478
|
+
const tangentDistance = c - rA + rB;
|
|
479
|
+
if (tangentDistance < e) {
|
|
480
|
+
const detailA = this.resolveDirectionToArcXYFraction(cpA, vectorAB, rA);
|
|
481
|
+
if (detailA) {
|
|
482
|
+
const detailB = this.resolveDirectionToArcXYFraction(cpB, vectorAB, rB);
|
|
483
|
+
if (detailB)
|
|
484
|
+
this.captureDetailPair(detailA, detailB, reversed);
|
|
420
485
|
}
|
|
421
486
|
}
|
|
422
487
|
}
|
|
423
488
|
}
|
|
424
489
|
}
|
|
425
490
|
}
|
|
426
|
-
/**
|
|
427
|
-
* Find the fractional point (if any) on an arc, known to be circular and displayed from the center in the
|
|
428
|
-
* direction of a scaled vector.
|
|
429
|
-
*/
|
|
491
|
+
/** Find the fractional point (if any) on the circular `arc` in the direction of `radialVector`. */
|
|
430
492
|
resolveDirectionToArcXYFraction(arc, radialVector, scale) {
|
|
431
|
-
// The scale ultimately only affects the direction --- easiest way to use it is two multiplies
|
|
493
|
+
// The scale ultimately only affects the direction --- easiest way to use it is two multiplies.
|
|
432
494
|
const c = scale * arc.matrixRef.columnDotXYZ(0, radialVector.x, radialVector.y, 0);
|
|
433
495
|
const s = scale * arc.matrixRef.columnDotXYZ(1, radialVector.x, radialVector.y, 0);
|
|
434
496
|
const radians = Math.atan2(s, c);
|
|
@@ -437,10 +499,13 @@ class CurveCurveCloseApproachXY extends GeometryHandler_1.NullGeometryHandler {
|
|
|
437
499
|
return CurveLocationDetail_1.CurveLocationDetail.createCurveEvaluatedFraction(arc, fraction);
|
|
438
500
|
return undefined;
|
|
439
501
|
}
|
|
440
|
-
|
|
441
|
-
// Selects the best conditioned arc (in xy parts) as "circle after inversion"
|
|
442
|
-
// Solves the arc-arc equations
|
|
502
|
+
/** Low level dispatch of arc with arc. Only circular arcs are supported. */
|
|
443
503
|
dispatchArcArc(cpA, cpB, reversed) {
|
|
504
|
+
const rangeA = cpA.range();
|
|
505
|
+
const rangeB = cpB.range();
|
|
506
|
+
rangeA.expandInPlace(this._maxDistanceToAccept);
|
|
507
|
+
if (!rangeB.intersectsRangeXY(rangeA))
|
|
508
|
+
return;
|
|
444
509
|
if (this._circularArcB) {
|
|
445
510
|
const radiusB = this._circularRadiusB;
|
|
446
511
|
const radiusA = cpA.circularRadiusXY();
|
|
@@ -453,17 +518,13 @@ class CurveCurveCloseApproachXY extends GeometryHandler_1.NullGeometryHandler {
|
|
|
453
518
|
}
|
|
454
519
|
}
|
|
455
520
|
}
|
|
456
|
-
|
|
457
|
-
// Selects the best conditioned arc (in xy parts) as "circle after inversion"
|
|
458
|
-
// Solves the arc-arc equations
|
|
521
|
+
/** Low level dispatch of arc with (beziers of) a bspline curve */
|
|
459
522
|
dispatchArcBsplineCurve3d(cpA, cpB, reversed) {
|
|
460
523
|
const ls = LineString3d_1.LineString3d.create();
|
|
461
524
|
cpB.emitStrokes(ls);
|
|
462
525
|
this.computeArcLineString(cpA, ls, reversed);
|
|
463
526
|
}
|
|
464
|
-
|
|
465
|
-
// Selects the best conditioned arc (in xy parts) as "circle after inversion"
|
|
466
|
-
// Solves the arc-arc equations
|
|
527
|
+
/** Low level dispatch of (beziers of) a bspline curve with (beziers of) a bspline curve */
|
|
467
528
|
dispatchBSplineCurve3dBSplineCurve3d(bcurveA, bcurveB, reversed) {
|
|
468
529
|
const lsA = LineString3d_1.LineString3d.create();
|
|
469
530
|
bcurveA.emitStrokes(lsA);
|
|
@@ -478,66 +539,34 @@ class CurveCurveCloseApproachXY extends GeometryHandler_1.NullGeometryHandler {
|
|
|
478
539
|
this.computeLineStringLineString(lsA, lsB, reversed);
|
|
479
540
|
}
|
|
480
541
|
/** Low level dispatch of segment with (beziers of) a bspline curve */
|
|
481
|
-
dispatchSegmentBsplineCurve(
|
|
542
|
+
dispatchSegmentBsplineCurve(segA, curveB, reversed) {
|
|
482
543
|
const lsB = LineString3d_1.LineString3d.create();
|
|
483
544
|
curveB.emitStrokes(lsB);
|
|
484
|
-
this.computeSegmentLineString(
|
|
545
|
+
this.computeSegmentLineString(segA, lsB, reversed);
|
|
485
546
|
}
|
|
486
547
|
/** Detail computation for segment approaching linestring. */
|
|
487
|
-
computeSegmentLineString(
|
|
488
|
-
const pointA0 = lsA.point0Ref;
|
|
489
|
-
const pointA1 = lsA.point1Ref;
|
|
490
|
-
let pointB0 = CurveCurveCloseApproachXY._workPointBB0;
|
|
491
|
-
let pointB1 = CurveCurveCloseApproachXY._workPointBB1;
|
|
492
|
-
let pointB2 = CurveCurveCloseApproachXY._workPointBB2;
|
|
493
|
-
let cross0, cross1, cross2;
|
|
494
|
-
let dot0, dot1, dot2;
|
|
495
|
-
const vectorA = CurveCurveCloseApproachXY._workVectorA;
|
|
496
|
-
Point3dVector3d_1.Vector3d.createStartEnd(pointA0, pointA1, vectorA);
|
|
497
|
-
const aa = vectorA.magnitudeSquared();
|
|
548
|
+
computeSegmentLineString(segA, lsB, reversed) {
|
|
498
549
|
const numB = lsB.numPoints();
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
lsB.packedPoints.getPoint3dAtUncheckedPointIndex(
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
// There is a true minimum at point1 ... see if it is within the line
|
|
512
|
-
if (dot1 >= 0.0 && dot1 <= aa) {
|
|
513
|
-
const fractionA1 = dot1 / aa;
|
|
514
|
-
const projection = pointA0.interpolate(dot1 / aa, pointA1);
|
|
515
|
-
if (pointB1.distanceXY(projection) < this._maxDistanceToAccept) {
|
|
516
|
-
const detailA = CurveLocationDetail_1.CurveLocationDetail.createCurveFractionPoint(lsA, fractionA1, projection);
|
|
517
|
-
const detailB = CurveLocationDetail_1.CurveLocationDetail.createCurveFractionPoint(lsB, iB / (numB - 1), pointB2);
|
|
518
|
-
const pair = CurveLocationDetail_1.CurveLocationDetailPair.createCaptureOptionalReverse(detailA, detailB, reversed);
|
|
519
|
-
this._results.push(pair);
|
|
520
|
-
}
|
|
521
|
-
}
|
|
522
|
-
}
|
|
523
|
-
const tempPoint = pointB0;
|
|
524
|
-
pointB0 = pointB1;
|
|
525
|
-
pointB1 = pointB2;
|
|
526
|
-
pointB2 = tempPoint;
|
|
527
|
-
const tempCross = cross0;
|
|
528
|
-
cross0 = cross1;
|
|
529
|
-
cross1 = cross2;
|
|
530
|
-
cross2 = tempCross;
|
|
531
|
-
const tempDot = dot0;
|
|
532
|
-
dot0 = dot1;
|
|
533
|
-
dot1 = dot2;
|
|
534
|
-
dot2 = tempDot;
|
|
535
|
-
}
|
|
536
|
-
this.testAndRecordFractionalPairApproach(lsA, 0, 1, true, lsB, 0, 1, false, reversed);
|
|
537
|
-
return undefined;
|
|
550
|
+
const deltaFracB = Geometry_1.Geometry.safeDivideFraction(1, numB - 1, 0);
|
|
551
|
+
const pointA0 = segA.point0Ref;
|
|
552
|
+
const pointA1 = segA.point1Ref;
|
|
553
|
+
const pointB0 = CurveCurveCloseApproachXY._workPointBB0;
|
|
554
|
+
const pointB1 = CurveCurveCloseApproachXY._workPointBB1;
|
|
555
|
+
for (let i = 0; i < numB - 1; ++i) {
|
|
556
|
+
const fB0 = i * deltaFracB; // global linestring fractions
|
|
557
|
+
const fB1 = (i + 1 === numB - 1) ? 1.0 : (i + 1) * deltaFracB; // make sure we nail the end fraction
|
|
558
|
+
lsB.packedPoints.getPoint3dAtUncheckedPointIndex(i, pointB0);
|
|
559
|
+
lsB.packedPoints.getPoint3dAtUncheckedPointIndex(i + 1, pointB1);
|
|
560
|
+
this.dispatchSegmentSegment(segA, pointA0, 0.0, pointA1, 1.0, lsB, pointB0, fB0, pointB1, fB1, reversed);
|
|
561
|
+
}
|
|
538
562
|
}
|
|
539
563
|
/** Detail computation for arc approaching linestring. */
|
|
540
564
|
computeArcLineString(arcA, lsB, reversed) {
|
|
565
|
+
const rangeA = arcA.range();
|
|
566
|
+
const rangeB = lsB.range();
|
|
567
|
+
rangeA.expandInPlace(this._maxDistanceToAccept);
|
|
568
|
+
if (!rangeB.intersectsRangeXY(rangeA))
|
|
569
|
+
return;
|
|
541
570
|
const pointB0 = CurveCurveCloseApproachXY._workPointBB0;
|
|
542
571
|
const pointB1 = CurveCurveCloseApproachXY._workPointBB1;
|
|
543
572
|
const numB = lsB.numPoints();
|
|
@@ -555,6 +584,17 @@ class CurveCurveCloseApproachXY extends GeometryHandler_1.NullGeometryHandler {
|
|
|
555
584
|
}
|
|
556
585
|
return undefined;
|
|
557
586
|
}
|
|
587
|
+
/** Low level dispatch of curve collection. */
|
|
588
|
+
dispatchCurveCollection(geomA, geomAHandler) {
|
|
589
|
+
const geomB = this._geometryB; // save
|
|
590
|
+
if (!geomB || !geomB.children || !(geomB instanceof CurveCollection_1.CurveCollection))
|
|
591
|
+
return;
|
|
592
|
+
for (const child of geomB.children) {
|
|
593
|
+
this.resetGeometry(child);
|
|
594
|
+
geomAHandler(geomA);
|
|
595
|
+
}
|
|
596
|
+
this._geometryB = geomB; // restore
|
|
597
|
+
}
|
|
558
598
|
/** Double dispatch handler for strongly typed segment. */
|
|
559
599
|
handleLineSegment3d(segmentA) {
|
|
560
600
|
if (this._geometryB instanceof LineSegment3d_1.LineSegment3d) {
|
|
@@ -570,6 +610,10 @@ class CurveCurveCloseApproachXY extends GeometryHandler_1.NullGeometryHandler {
|
|
|
570
610
|
else if (this._geometryB instanceof BSplineCurve_1.BSplineCurve3d) {
|
|
571
611
|
this.dispatchSegmentBsplineCurve(segmentA, this._geometryB, false);
|
|
572
612
|
}
|
|
613
|
+
else if (this._geometryB instanceof CurveCollection_1.CurveCollection) {
|
|
614
|
+
this.dispatchCurveCollection(segmentA, this.handleLineSegment3d.bind(this));
|
|
615
|
+
}
|
|
616
|
+
return undefined;
|
|
573
617
|
}
|
|
574
618
|
/**
|
|
575
619
|
* Set bits for comparison to range xy
|
|
@@ -577,6 +621,13 @@ class CurveCurveCloseApproachXY extends GeometryHandler_1.NullGeometryHandler {
|
|
|
577
621
|
* * bit 0x02 => x larger than range.high.x
|
|
578
622
|
* * bit 0x04 => y smaller than range.low.y
|
|
579
623
|
* * bit 0x08 => y larger than range.high.y
|
|
624
|
+
* * If we divide XY plane into 9 areas using the range, the function returns 0 for points
|
|
625
|
+
* inside the range. Below is other binary numbers returned by the function for all 9 areas:
|
|
626
|
+
* 1001 | 1000 | 1010
|
|
627
|
+
* ------------------
|
|
628
|
+
* 1 | 0 | 10
|
|
629
|
+
* ------------------
|
|
630
|
+
* 101 | 100 | 110
|
|
580
631
|
* @param xy point to test
|
|
581
632
|
* @param range range for comparison
|
|
582
633
|
*/
|
|
@@ -586,12 +637,14 @@ class CurveCurveCloseApproachXY extends GeometryHandler_1.NullGeometryHandler {
|
|
|
586
637
|
result = 0x01;
|
|
587
638
|
else if (x > range.high.x)
|
|
588
639
|
result = 0x02;
|
|
640
|
+
// note the OR operation
|
|
589
641
|
if (y < range.low.y)
|
|
590
642
|
result |= 0x04;
|
|
591
643
|
else if (y > range.high.y)
|
|
592
644
|
result |= 0x08;
|
|
593
645
|
return result;
|
|
594
646
|
}
|
|
647
|
+
/** Low level dispatch of line string with line string. */
|
|
595
648
|
computeLineStringLineString(lsA, lsB, reversed) {
|
|
596
649
|
const rangeA = lsA.range();
|
|
597
650
|
const rangeB = lsB.range();
|
|
@@ -608,7 +661,6 @@ class CurveCurveCloseApproachXY extends GeometryHandler_1.NullGeometryHandler {
|
|
|
608
661
|
const numA = lsA.numPoints();
|
|
609
662
|
const numB = lsB.numPoints();
|
|
610
663
|
if (numA > 1 && numB > 1) {
|
|
611
|
-
lsA.pointAt(0, pointA0);
|
|
612
664
|
const dfA = 1.0 / (numA - 1);
|
|
613
665
|
const dfB = 1.0 / (numB - 1);
|
|
614
666
|
let fA0 = 0.0;
|
|
@@ -618,6 +670,7 @@ class CurveCurveCloseApproachXY extends GeometryHandler_1.NullGeometryHandler {
|
|
|
618
670
|
fA1 = ia * dfA;
|
|
619
671
|
fB0 = 0.0;
|
|
620
672
|
lsA.pointAt(ia, pointA1);
|
|
673
|
+
// rangeA1 is around line segment [A0,A1] expanded by max distance
|
|
621
674
|
rangeA1.setNull();
|
|
622
675
|
rangeA1.extendPoint(pointA0);
|
|
623
676
|
rangeA1.extendPoint(pointA1);
|
|
@@ -629,10 +682,10 @@ class CurveCurveCloseApproachXY extends GeometryHandler_1.NullGeometryHandler {
|
|
|
629
682
|
lsB.pointAt(ib, pointB1);
|
|
630
683
|
bitB1 = this.classifyBitsPointRangeXY(pointB1.x, pointB1.y, rangeA1);
|
|
631
684
|
fB1 = ib * dfB;
|
|
632
|
-
//
|
|
633
|
-
|
|
685
|
+
// DO NOT study the segment in detail if both bitB bits are on for any of the 4 planes
|
|
686
|
+
// (i.e., no intersection between rangeA1 and the range around line segment [B0,B1])
|
|
687
|
+
if ((bitB0 & bitB1) === 0)
|
|
634
688
|
this.dispatchSegmentSegment(lsA, pointA0, fA0, pointA1, fA1, lsB, pointB0, fB0, pointB1, fB1, reversed);
|
|
635
|
-
}
|
|
636
689
|
}
|
|
637
690
|
}
|
|
638
691
|
}
|
|
@@ -653,6 +706,9 @@ class CurveCurveCloseApproachXY extends GeometryHandler_1.NullGeometryHandler {
|
|
|
653
706
|
else if (this._geometryB instanceof BSplineCurve_1.BSplineCurve3d) {
|
|
654
707
|
this.dispatchLineStringBSplineCurve(lsA, this._geometryB, false);
|
|
655
708
|
}
|
|
709
|
+
else if (this._geometryB instanceof CurveCollection_1.CurveCollection) {
|
|
710
|
+
this.dispatchCurveCollection(lsA, this.handleLineString3d.bind(this));
|
|
711
|
+
}
|
|
656
712
|
return undefined;
|
|
657
713
|
}
|
|
658
714
|
/** Double dispatch handler for strongly typed arc. */
|
|
@@ -669,6 +725,9 @@ class CurveCurveCloseApproachXY extends GeometryHandler_1.NullGeometryHandler {
|
|
|
669
725
|
else if (this._geometryB instanceof BSplineCurve_1.BSplineCurve3d) {
|
|
670
726
|
this.dispatchArcBsplineCurve3d(arc0, this._geometryB, false);
|
|
671
727
|
}
|
|
728
|
+
else if (this._geometryB instanceof CurveCollection_1.CurveCollection) {
|
|
729
|
+
this.dispatchCurveCollection(arc0, this.handleArc3d.bind(this));
|
|
730
|
+
}
|
|
672
731
|
return undefined;
|
|
673
732
|
}
|
|
674
733
|
/** Double dispatch handler for strongly typed bspline curve. */
|
|
@@ -685,6 +744,9 @@ class CurveCurveCloseApproachXY extends GeometryHandler_1.NullGeometryHandler {
|
|
|
685
744
|
else if (this._geometryB instanceof BSplineCurve_1.BSplineCurve3dBase) {
|
|
686
745
|
this.dispatchBSplineCurve3dBSplineCurve3d(curve, this._geometryB, false);
|
|
687
746
|
}
|
|
747
|
+
else if (this._geometryB instanceof CurveCollection_1.CurveCollection) {
|
|
748
|
+
this.dispatchCurveCollection(curve, this.handleBSplineCurve3d.bind(this));
|
|
749
|
+
}
|
|
688
750
|
return undefined;
|
|
689
751
|
}
|
|
690
752
|
/** Double dispatch handler for strongly typed homogeneous bspline curve .. */
|
|
@@ -709,8 +771,6 @@ CurveCurveCloseApproachXY._workPointAA0 = Point3dVector3d_1.Point3d.create();
|
|
|
709
771
|
CurveCurveCloseApproachXY._workPointAA1 = Point3dVector3d_1.Point3d.create();
|
|
710
772
|
CurveCurveCloseApproachXY._workPointBB0 = Point3dVector3d_1.Point3d.create();
|
|
711
773
|
CurveCurveCloseApproachXY._workPointBB1 = Point3dVector3d_1.Point3d.create();
|
|
712
|
-
CurveCurveCloseApproachXY._workPointBB2 = Point3dVector3d_1.Point3d.create();
|
|
713
|
-
CurveCurveCloseApproachXY._workVectorA = Point3dVector3d_1.Vector3d.create();
|
|
714
774
|
CurveCurveCloseApproachXY._workPointB = Point3dVector3d_1.Point3d.create();
|
|
715
775
|
exports.CurveCurveCloseApproachXY = CurveCurveCloseApproachXY;
|
|
716
776
|
//# sourceMappingURL=CurveCurveCloseApproachXY.js.map
|