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