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