@itwin/core-geometry 4.1.0-dev.8 → 4.1.0-dev.80
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 +87 -1
- package/lib/cjs/Constant.js.map +1 -1
- package/lib/cjs/Geometry.js.map +1 -1
- package/lib/cjs/bspline/AkimaCurve3d.js.map +1 -1
- package/lib/cjs/bspline/BSpline1dNd.js.map +1 -1
- package/lib/cjs/bspline/BSplineCurve.d.ts +1 -1
- package/lib/cjs/bspline/BSplineCurve.d.ts.map +1 -1
- package/lib/cjs/bspline/BSplineCurve.js +2 -2
- package/lib/cjs/bspline/BSplineCurve.js.map +1 -1
- package/lib/cjs/bspline/BSplineCurve3dH.js.map +1 -1
- package/lib/cjs/bspline/BSplineCurveOps.js.map +1 -1
- package/lib/cjs/bspline/BSplineSurface.d.ts.map +1 -1
- package/lib/cjs/bspline/BSplineSurface.js +1 -1
- package/lib/cjs/bspline/BSplineSurface.js.map +1 -1
- package/lib/cjs/bspline/Bezier1dNd.js.map +1 -1
- package/lib/cjs/bspline/BezierCurve3d.js.map +1 -1
- package/lib/cjs/bspline/BezierCurve3dH.js.map +1 -1
- package/lib/cjs/bspline/BezierCurveBase.d.ts +1 -1
- package/lib/cjs/bspline/BezierCurveBase.d.ts.map +1 -1
- package/lib/cjs/bspline/BezierCurveBase.js +2 -2
- package/lib/cjs/bspline/BezierCurveBase.js.map +1 -1
- package/lib/cjs/bspline/InterpolationCurve3d.js.map +1 -1
- package/lib/cjs/bspline/KnotVector.js.map +1 -1
- package/lib/cjs/bspline/SurfaceLocationDetail.js.map +1 -1
- package/lib/cjs/clipping/AlternatingConvexClipTree.d.ts +15 -17
- package/lib/cjs/clipping/AlternatingConvexClipTree.d.ts.map +1 -1
- package/lib/cjs/clipping/AlternatingConvexClipTree.js +24 -20
- package/lib/cjs/clipping/AlternatingConvexClipTree.js.map +1 -1
- package/lib/cjs/clipping/BooleanClipFactory.d.ts +28 -28
- package/lib/cjs/clipping/BooleanClipFactory.d.ts.map +1 -1
- package/lib/cjs/clipping/BooleanClipFactory.js +28 -28
- package/lib/cjs/clipping/BooleanClipFactory.js.map +1 -1
- package/lib/cjs/clipping/BooleanClipNode.d.ts +11 -11
- package/lib/cjs/clipping/BooleanClipNode.d.ts.map +1 -1
- package/lib/cjs/clipping/BooleanClipNode.js +11 -11
- package/lib/cjs/clipping/BooleanClipNode.js.map +1 -1
- package/lib/cjs/clipping/ClipPlane.d.ts +73 -76
- package/lib/cjs/clipping/ClipPlane.d.ts.map +1 -1
- package/lib/cjs/clipping/ClipPlane.js +105 -86
- package/lib/cjs/clipping/ClipPlane.js.map +1 -1
- package/lib/cjs/clipping/ClipPrimitive.d.ts +78 -47
- package/lib/cjs/clipping/ClipPrimitive.d.ts.map +1 -1
- package/lib/cjs/clipping/ClipPrimitive.js +112 -54
- package/lib/cjs/clipping/ClipPrimitive.js.map +1 -1
- package/lib/cjs/clipping/ClipUtils.d.ts +54 -44
- package/lib/cjs/clipping/ClipUtils.d.ts.map +1 -1
- package/lib/cjs/clipping/ClipUtils.js +33 -29
- package/lib/cjs/clipping/ClipUtils.js.map +1 -1
- package/lib/cjs/clipping/ClipVector.d.ts +39 -25
- package/lib/cjs/clipping/ClipVector.d.ts.map +1 -1
- package/lib/cjs/clipping/ClipVector.js +35 -23
- package/lib/cjs/clipping/ClipVector.js.map +1 -1
- package/lib/cjs/clipping/ConvexClipPlaneSet.d.ts +61 -38
- package/lib/cjs/clipping/ConvexClipPlaneSet.d.ts.map +1 -1
- package/lib/cjs/clipping/ConvexClipPlaneSet.js +64 -41
- package/lib/cjs/clipping/ConvexClipPlaneSet.js.map +1 -1
- package/lib/cjs/clipping/UnionOfConvexClipPlaneSets.d.ts +49 -30
- package/lib/cjs/clipping/UnionOfConvexClipPlaneSets.d.ts.map +1 -1
- package/lib/cjs/clipping/UnionOfConvexClipPlaneSets.js +50 -30
- package/lib/cjs/clipping/UnionOfConvexClipPlaneSets.js.map +1 -1
- package/lib/cjs/clipping/internalContexts/LineStringOffsetClipperContext.d.ts +2 -2
- package/lib/cjs/clipping/internalContexts/LineStringOffsetClipperContext.d.ts.map +1 -1
- package/lib/cjs/clipping/internalContexts/LineStringOffsetClipperContext.js +2 -2
- package/lib/cjs/clipping/internalContexts/LineStringOffsetClipperContext.js.map +1 -1
- package/lib/cjs/core-geometry.d.ts +5 -1
- package/lib/cjs/core-geometry.d.ts.map +1 -1
- package/lib/cjs/core-geometry.js +5 -1
- package/lib/cjs/core-geometry.js.map +1 -1
- package/lib/cjs/curve/Arc3d.d.ts +4 -3
- package/lib/cjs/curve/Arc3d.d.ts.map +1 -1
- package/lib/cjs/curve/Arc3d.js +7 -5
- package/lib/cjs/curve/Arc3d.js.map +1 -1
- package/lib/cjs/curve/ConstructCurveBetweenCurves.js.map +1 -1
- package/lib/cjs/curve/CoordinateXYZ.js.map +1 -1
- package/lib/cjs/curve/CurveChain.js.map +1 -1
- package/lib/cjs/curve/CurveChainWithDistanceIndex.d.ts +62 -42
- package/lib/cjs/curve/CurveChainWithDistanceIndex.d.ts.map +1 -1
- package/lib/cjs/curve/CurveChainWithDistanceIndex.js +71 -48
- package/lib/cjs/curve/CurveChainWithDistanceIndex.js.map +1 -1
- package/lib/cjs/curve/CurveCollection.d.ts +36 -26
- package/lib/cjs/curve/CurveCollection.d.ts.map +1 -1
- package/lib/cjs/curve/CurveCollection.js +46 -39
- package/lib/cjs/curve/CurveCollection.js.map +1 -1
- package/lib/cjs/curve/CurveCurve.d.ts +6 -2
- package/lib/cjs/curve/CurveCurve.d.ts.map +1 -1
- package/lib/cjs/curve/CurveCurve.js +13 -9
- package/lib/cjs/curve/CurveCurve.js.map +1 -1
- package/lib/cjs/curve/CurveCurveCloseApproachXY.d.ts +74 -68
- package/lib/cjs/curve/CurveCurveCloseApproachXY.d.ts.map +1 -1
- package/lib/cjs/curve/CurveCurveCloseApproachXY.js +100 -108
- package/lib/cjs/curve/CurveCurveCloseApproachXY.js.map +1 -1
- package/lib/cjs/curve/CurveCurveIntersectXY.d.ts +46 -48
- package/lib/cjs/curve/CurveCurveIntersectXY.d.ts.map +1 -1
- package/lib/cjs/curve/CurveCurveIntersectXY.js +72 -61
- package/lib/cjs/curve/CurveCurveIntersectXY.js.map +1 -1
- package/lib/cjs/curve/CurveCurveIntersectXYZ.d.ts +32 -38
- package/lib/cjs/curve/CurveCurveIntersectXYZ.d.ts.map +1 -1
- package/lib/cjs/curve/CurveCurveIntersectXYZ.js +86 -97
- package/lib/cjs/curve/CurveCurveIntersectXYZ.js.map +1 -1
- package/lib/cjs/curve/CurveExtendMode.js.map +1 -1
- package/lib/cjs/curve/CurveFactory.d.ts +67 -3
- package/lib/cjs/curve/CurveFactory.d.ts.map +1 -1
- package/lib/cjs/curve/CurveFactory.js +75 -7
- package/lib/cjs/curve/CurveFactory.js.map +1 -1
- package/lib/cjs/curve/CurveLocationDetail.d.ts +6 -6
- package/lib/cjs/curve/CurveLocationDetail.d.ts.map +1 -1
- package/lib/cjs/curve/CurveLocationDetail.js +9 -7
- package/lib/cjs/curve/CurveLocationDetail.js.map +1 -1
- package/lib/cjs/curve/CurveOps.d.ts +77 -0
- package/lib/cjs/curve/CurveOps.d.ts.map +1 -0
- package/lib/cjs/curve/CurveOps.js +160 -0
- package/lib/cjs/curve/CurveOps.js.map +1 -0
- package/lib/cjs/curve/CurvePrimitive.d.ts +26 -18
- package/lib/cjs/curve/CurvePrimitive.d.ts.map +1 -1
- package/lib/cjs/curve/CurvePrimitive.js +4 -3
- package/lib/cjs/curve/CurvePrimitive.js.map +1 -1
- package/lib/cjs/curve/CurveProcessor.js.map +1 -1
- package/lib/cjs/curve/CurveWireMomentsXYZ.js.map +1 -1
- package/lib/cjs/curve/GeometryQuery.d.ts +2 -2
- package/lib/cjs/curve/GeometryQuery.d.ts.map +1 -1
- package/lib/cjs/curve/GeometryQuery.js +2 -2
- package/lib/cjs/curve/GeometryQuery.js.map +1 -1
- package/lib/cjs/curve/LineSegment3d.d.ts +7 -5
- package/lib/cjs/curve/LineSegment3d.d.ts.map +1 -1
- package/lib/cjs/curve/LineSegment3d.js +6 -6
- package/lib/cjs/curve/LineSegment3d.js.map +1 -1
- package/lib/cjs/curve/LineString3d.d.ts +2 -2
- package/lib/cjs/curve/LineString3d.d.ts.map +1 -1
- package/lib/cjs/curve/LineString3d.js +3 -3
- package/lib/cjs/curve/LineString3d.js.map +1 -1
- package/lib/cjs/curve/Loop.d.ts +7 -5
- package/lib/cjs/curve/Loop.d.ts.map +1 -1
- package/lib/cjs/curve/Loop.js +18 -6
- package/lib/cjs/curve/Loop.js.map +1 -1
- package/lib/cjs/curve/OffsetOptions.d.ts +97 -0
- package/lib/cjs/curve/OffsetOptions.d.ts.map +1 -0
- package/lib/cjs/curve/OffsetOptions.js +166 -0
- package/lib/cjs/curve/OffsetOptions.js.map +1 -0
- package/lib/cjs/curve/ParityRegion.d.ts +7 -7
- package/lib/cjs/curve/ParityRegion.d.ts.map +1 -1
- package/lib/cjs/curve/ParityRegion.js +19 -11
- package/lib/cjs/curve/ParityRegion.js.map +1 -1
- package/lib/cjs/curve/Path.d.ts +6 -6
- package/lib/cjs/curve/Path.d.ts.map +1 -1
- package/lib/cjs/curve/Path.js +15 -9
- package/lib/cjs/curve/Path.js.map +1 -1
- package/lib/cjs/curve/PointString3d.js.map +1 -1
- package/lib/cjs/curve/ProxyCurve.d.ts +5 -7
- package/lib/cjs/curve/ProxyCurve.d.ts.map +1 -1
- package/lib/cjs/curve/ProxyCurve.js +7 -7
- package/lib/cjs/curve/ProxyCurve.js.map +1 -1
- package/lib/cjs/curve/Query/ConsolidateAdjacentPrimitivesContext.js.map +1 -1
- package/lib/cjs/curve/Query/CurveSplitContext.js.map +1 -1
- package/lib/cjs/curve/Query/CylindricalRange.js.map +1 -1
- package/lib/cjs/curve/Query/InOutTests.js.map +1 -1
- package/lib/cjs/curve/Query/PlanarSubdivision.js.map +1 -1
- package/lib/cjs/curve/Query/StrokeCountChain.js.map +1 -1
- package/lib/cjs/curve/Query/StrokeCountMap.js.map +1 -1
- package/lib/cjs/curve/RegionMomentsXY.js.map +1 -1
- package/lib/cjs/curve/RegionOps.d.ts +76 -56
- package/lib/cjs/curve/RegionOps.d.ts.map +1 -1
- package/lib/cjs/curve/RegionOps.js +83 -60
- package/lib/cjs/curve/RegionOps.js.map +1 -1
- package/lib/cjs/curve/RegionOpsClassificationSweeps.js +2 -2
- package/lib/cjs/curve/RegionOpsClassificationSweeps.js.map +1 -1
- package/lib/cjs/curve/StrokeOptions.d.ts.map +1 -1
- package/lib/cjs/curve/StrokeOptions.js +6 -2
- package/lib/cjs/curve/StrokeOptions.js.map +1 -1
- package/lib/cjs/curve/UnionRegion.d.ts +6 -5
- package/lib/cjs/curve/UnionRegion.d.ts.map +1 -1
- package/lib/cjs/curve/UnionRegion.js +17 -8
- package/lib/cjs/curve/UnionRegion.js.map +1 -1
- package/lib/cjs/curve/internalContexts/AppendPlaneIntersectionStrokeHandler.js.map +1 -1
- package/lib/cjs/curve/{ChainCollectorContext.d.ts → internalContexts/ChainCollectorContext.d.ts} +4 -4
- package/lib/cjs/curve/internalContexts/ChainCollectorContext.d.ts.map +1 -0
- package/lib/cjs/curve/{ChainCollectorContext.js → internalContexts/ChainCollectorContext.js} +4 -4
- package/lib/cjs/curve/internalContexts/ChainCollectorContext.js.map +1 -0
- package/lib/cjs/curve/internalContexts/CloneCurvesContext.js.map +1 -1
- package/lib/cjs/curve/internalContexts/CloneWithExpandedLineStrings.js.map +1 -1
- package/lib/cjs/curve/internalContexts/ClosestPointStrokeHandler.js.map +1 -1
- package/lib/cjs/curve/internalContexts/CountLinearPartsSearchContext.js.map +1 -1
- package/lib/cjs/curve/internalContexts/CurveLengthContext.js.map +1 -1
- package/lib/cjs/curve/internalContexts/CurveOffsetXYHandler.js.map +1 -1
- package/lib/cjs/curve/internalContexts/GapSearchContext.d.ts +2 -1
- package/lib/cjs/curve/internalContexts/GapSearchContext.d.ts.map +1 -1
- package/lib/cjs/curve/internalContexts/GapSearchContext.js +6 -2
- package/lib/cjs/curve/internalContexts/GapSearchContext.js.map +1 -1
- package/lib/cjs/curve/internalContexts/MultiChainCollector.d.ts +59 -70
- package/lib/cjs/curve/internalContexts/MultiChainCollector.d.ts.map +1 -1
- package/lib/cjs/curve/internalContexts/MultiChainCollector.js +130 -220
- package/lib/cjs/curve/internalContexts/MultiChainCollector.js.map +1 -1
- package/lib/cjs/curve/internalContexts/NewtonRtoRStrokeHandler.js.map +1 -1
- package/lib/cjs/curve/internalContexts/PlaneAltitudeRangeContext.d.ts +14 -8
- package/lib/cjs/curve/internalContexts/PlaneAltitudeRangeContext.d.ts.map +1 -1
- package/lib/cjs/curve/internalContexts/PlaneAltitudeRangeContext.js +14 -8
- package/lib/cjs/curve/internalContexts/PlaneAltitudeRangeContext.js.map +1 -1
- package/lib/cjs/curve/internalContexts/PolygonOffsetContext.d.ts +23 -95
- package/lib/cjs/curve/internalContexts/PolygonOffsetContext.d.ts.map +1 -1
- package/lib/cjs/curve/internalContexts/PolygonOffsetContext.js +89 -178
- package/lib/cjs/curve/internalContexts/PolygonOffsetContext.js.map +1 -1
- package/lib/cjs/curve/internalContexts/SumLengthsContext.d.ts.map +1 -1
- package/lib/cjs/curve/internalContexts/SumLengthsContext.js +4 -1
- package/lib/cjs/curve/internalContexts/SumLengthsContext.js.map +1 -1
- package/lib/cjs/curve/internalContexts/TransformInPlaceContext.js.map +1 -1
- package/lib/cjs/curve/spiral/AustralianRailCorpXYEvaluator.js.map +1 -1
- package/lib/cjs/curve/spiral/ClothoidSeries.js.map +1 -1
- package/lib/cjs/curve/spiral/CubicEvaluator.js.map +1 -1
- package/lib/cjs/curve/spiral/CzechSpiralEvaluator.js.map +1 -1
- package/lib/cjs/curve/spiral/DirectHalfCosineSpiralEvaluator.js.map +1 -1
- package/lib/cjs/curve/spiral/DirectSpiral3d.js.map +1 -1
- package/lib/cjs/curve/spiral/IntegratedSpiral3d.js +1 -1
- package/lib/cjs/curve/spiral/IntegratedSpiral3d.js.map +1 -1
- package/lib/cjs/curve/spiral/MXCubicAlongArcSpiralEvaluator.js.map +1 -1
- package/lib/cjs/curve/spiral/NormalizedTransition.js.map +1 -1
- package/lib/cjs/curve/spiral/PolishCubicSpiralEvaluator.js.map +1 -1
- package/lib/cjs/curve/spiral/TransitionConditionalProperties.js.map +1 -1
- package/lib/cjs/curve/spiral/TransitionSpiral3d.d.ts +1 -1
- package/lib/cjs/curve/spiral/TransitionSpiral3d.d.ts.map +1 -1
- package/lib/cjs/curve/spiral/TransitionSpiral3d.js +2 -2
- package/lib/cjs/curve/spiral/TransitionSpiral3d.js.map +1 -1
- package/lib/cjs/curve/spiral/XYCurveEvaluator.js +1 -1
- package/lib/cjs/curve/spiral/XYCurveEvaluator.js.map +1 -1
- package/lib/cjs/geometry3d/Angle.d.ts +9 -0
- package/lib/cjs/geometry3d/Angle.d.ts.map +1 -1
- package/lib/cjs/geometry3d/Angle.js +13 -0
- package/lib/cjs/geometry3d/Angle.js.map +1 -1
- package/lib/cjs/geometry3d/AngleSweep.js.map +1 -1
- package/lib/cjs/geometry3d/BarycentricTriangle.js.map +1 -1
- package/lib/cjs/geometry3d/BilinearPatch.d.ts +43 -48
- package/lib/cjs/geometry3d/BilinearPatch.d.ts.map +1 -1
- package/lib/cjs/geometry3d/BilinearPatch.js +51 -55
- package/lib/cjs/geometry3d/BilinearPatch.js.map +1 -1
- package/lib/cjs/geometry3d/CoincidentGeometryOps.js.map +1 -1
- package/lib/cjs/geometry3d/Ellipsoid.d.ts +1 -1
- package/lib/cjs/geometry3d/Ellipsoid.js +1 -1
- package/lib/cjs/geometry3d/Ellipsoid.js.map +1 -1
- package/lib/cjs/geometry3d/FrameBuilder.d.ts.map +1 -1
- package/lib/cjs/geometry3d/FrameBuilder.js +13 -11
- package/lib/cjs/geometry3d/FrameBuilder.js.map +1 -1
- package/lib/cjs/geometry3d/FrustumAnimation.js.map +1 -1
- package/lib/cjs/geometry3d/GeometryHandler.d.ts +103 -97
- package/lib/cjs/geometry3d/GeometryHandler.d.ts.map +1 -1
- package/lib/cjs/geometry3d/GeometryHandler.js +247 -124
- package/lib/cjs/geometry3d/GeometryHandler.js.map +1 -1
- package/lib/cjs/geometry3d/GrowableBlockedArray.d.ts.map +1 -1
- package/lib/cjs/geometry3d/GrowableBlockedArray.js +1 -1
- package/lib/cjs/geometry3d/GrowableBlockedArray.js.map +1 -1
- package/lib/cjs/geometry3d/GrowableFloat64Array.d.ts.map +1 -1
- package/lib/cjs/geometry3d/GrowableFloat64Array.js +1 -1
- package/lib/cjs/geometry3d/GrowableFloat64Array.js.map +1 -1
- package/lib/cjs/geometry3d/GrowableXYArray.js.map +1 -1
- package/lib/cjs/geometry3d/GrowableXYZArray.js.map +1 -1
- package/lib/cjs/geometry3d/IndexedCollectionInterval.js.map +1 -1
- package/lib/cjs/geometry3d/IndexedXYCollection.js.map +1 -1
- package/lib/cjs/geometry3d/IndexedXYZCollection.js.map +1 -1
- package/lib/cjs/geometry3d/LongitudeLatitudeAltitude.js.map +1 -1
- package/lib/cjs/geometry3d/Matrix3d.d.ts +18 -0
- package/lib/cjs/geometry3d/Matrix3d.d.ts.map +1 -1
- package/lib/cjs/geometry3d/Matrix3d.js +32 -5
- package/lib/cjs/geometry3d/Matrix3d.js.map +1 -1
- package/lib/cjs/geometry3d/OrderedRotationAngles.js.map +1 -1
- package/lib/cjs/geometry3d/Plane3d.d.ts +41 -32
- package/lib/cjs/geometry3d/Plane3d.d.ts.map +1 -1
- package/lib/cjs/geometry3d/Plane3d.js +11 -8
- package/lib/cjs/geometry3d/Plane3d.js.map +1 -1
- package/lib/cjs/geometry3d/Plane3dByOriginAndUnitNormal.d.ts +37 -34
- package/lib/cjs/geometry3d/Plane3dByOriginAndUnitNormal.d.ts.map +1 -1
- package/lib/cjs/geometry3d/Plane3dByOriginAndUnitNormal.js +65 -43
- package/lib/cjs/geometry3d/Plane3dByOriginAndUnitNormal.js.map +1 -1
- package/lib/cjs/geometry3d/Plane3dByOriginAndVectors.d.ts +36 -32
- package/lib/cjs/geometry3d/Plane3dByOriginAndVectors.d.ts.map +1 -1
- package/lib/cjs/geometry3d/Plane3dByOriginAndVectors.js +37 -32
- package/lib/cjs/geometry3d/Plane3dByOriginAndVectors.js.map +1 -1
- package/lib/cjs/geometry3d/Point2dArrayCarrier.js.map +1 -1
- package/lib/cjs/geometry3d/Point2dVector2d.d.ts +8 -9
- package/lib/cjs/geometry3d/Point2dVector2d.d.ts.map +1 -1
- package/lib/cjs/geometry3d/Point2dVector2d.js +9 -10
- package/lib/cjs/geometry3d/Point2dVector2d.js.map +1 -1
- package/lib/cjs/geometry3d/Point3dArrayCarrier.js.map +1 -1
- package/lib/cjs/geometry3d/Point3dVector3d.d.ts +12 -4
- package/lib/cjs/geometry3d/Point3dVector3d.d.ts.map +1 -1
- package/lib/cjs/geometry3d/Point3dVector3d.js +18 -5
- package/lib/cjs/geometry3d/Point3dVector3d.js.map +1 -1
- package/lib/cjs/geometry3d/PointHelpers.d.ts.map +1 -1
- package/lib/cjs/geometry3d/PointHelpers.js +5 -5
- package/lib/cjs/geometry3d/PointHelpers.js.map +1 -1
- package/lib/cjs/geometry3d/PointStreaming.js.map +1 -1
- package/lib/cjs/geometry3d/PolygonOps.d.ts +6 -2
- package/lib/cjs/geometry3d/PolygonOps.d.ts.map +1 -1
- package/lib/cjs/geometry3d/PolygonOps.js +31 -22
- package/lib/cjs/geometry3d/PolygonOps.js.map +1 -1
- package/lib/cjs/geometry3d/PolylineCompressionByEdgeOffset.js.map +1 -1
- package/lib/cjs/geometry3d/PolylineOps.d.ts +16 -1
- package/lib/cjs/geometry3d/PolylineOps.d.ts.map +1 -1
- package/lib/cjs/geometry3d/PolylineOps.js +55 -0
- package/lib/cjs/geometry3d/PolylineOps.js.map +1 -1
- package/lib/cjs/geometry3d/Range.d.ts +134 -94
- package/lib/cjs/geometry3d/Range.d.ts.map +1 -1
- package/lib/cjs/geometry3d/Range.js +297 -145
- package/lib/cjs/geometry3d/Range.js.map +1 -1
- package/lib/cjs/geometry3d/Ray2d.d.ts +69 -0
- package/lib/cjs/geometry3d/Ray2d.d.ts.map +1 -0
- package/lib/cjs/geometry3d/Ray2d.js +146 -0
- package/lib/cjs/geometry3d/Ray2d.js.map +1 -0
- package/lib/cjs/geometry3d/Ray3d.d.ts.map +1 -1
- package/lib/cjs/geometry3d/Ray3d.js.map +1 -1
- package/lib/cjs/geometry3d/ReusableObjectCache.js.map +1 -1
- package/lib/cjs/geometry3d/Segment1d.js.map +1 -1
- package/lib/cjs/geometry3d/SortablePolygon.js.map +1 -1
- package/lib/cjs/geometry3d/Transform.d.ts +10 -3
- package/lib/cjs/geometry3d/Transform.d.ts.map +1 -1
- package/lib/cjs/geometry3d/Transform.js +18 -6
- package/lib/cjs/geometry3d/Transform.js.map +1 -1
- package/lib/cjs/geometry3d/UVSurfaceOps.js.map +1 -1
- package/lib/cjs/geometry3d/XYZProps.js.map +1 -1
- package/lib/cjs/geometry3d/YawPitchRollAngles.js.map +1 -1
- package/lib/cjs/geometry4d/Map4d.js.map +1 -1
- package/lib/cjs/geometry4d/Matrix4d.js.map +1 -1
- package/lib/cjs/geometry4d/MomentData.js.map +1 -1
- package/lib/cjs/geometry4d/PlaneByOriginAndVectors4d.js.map +1 -1
- package/lib/cjs/geometry4d/Point4d.js.map +1 -1
- package/lib/cjs/numerics/BandedSystem.js.map +1 -1
- package/lib/cjs/numerics/BezierPolynomials.js.map +1 -1
- package/lib/cjs/numerics/ClusterableArray.js.map +1 -1
- package/lib/cjs/numerics/Complex.js.map +1 -1
- package/lib/cjs/numerics/ConvexPolygon2d.d.ts +7 -49
- package/lib/cjs/numerics/ConvexPolygon2d.d.ts.map +1 -1
- package/lib/cjs/numerics/ConvexPolygon2d.js +16 -107
- package/lib/cjs/numerics/ConvexPolygon2d.js.map +1 -1
- package/lib/cjs/numerics/Newton.js.map +1 -1
- package/lib/cjs/numerics/PascalCoefficients.js.map +1 -1
- package/lib/cjs/numerics/PolarData.js.map +1 -1
- package/lib/cjs/numerics/Polynomials.d.ts.map +1 -1
- package/lib/cjs/numerics/Polynomials.js +0 -2
- package/lib/cjs/numerics/Polynomials.js.map +1 -1
- package/lib/cjs/numerics/Quadrature.js +5 -5
- package/lib/cjs/numerics/Quadrature.js.map +1 -1
- package/lib/cjs/numerics/Range1dArray.js.map +1 -1
- package/lib/cjs/numerics/TriDiagonalSystem.js.map +1 -1
- package/lib/cjs/numerics/UnionFind.js.map +1 -1
- package/lib/cjs/numerics/UsageSums.js.map +1 -1
- package/lib/cjs/polyface/AuxData.js.map +1 -1
- package/lib/cjs/polyface/BoxTopology.js.map +1 -1
- package/lib/cjs/polyface/FacetFaceData.js.map +1 -1
- package/lib/cjs/polyface/FacetLocationDetail.js.map +1 -1
- package/lib/cjs/polyface/FacetOrientation.js.map +1 -1
- package/lib/cjs/polyface/GreedyTriangulationBetweenLineStrings.js.map +1 -1
- package/lib/cjs/polyface/IndexedEdgeMatcher.js +1 -1
- package/lib/cjs/polyface/IndexedEdgeMatcher.js.map +1 -1
- package/lib/cjs/polyface/IndexedPolyfaceVisitor.js.map +1 -1
- package/lib/cjs/polyface/Polyface.js.map +1 -1
- package/lib/cjs/polyface/PolyfaceBuilder.d.ts.map +1 -1
- package/lib/cjs/polyface/PolyfaceBuilder.js +2 -2
- package/lib/cjs/polyface/PolyfaceBuilder.js.map +1 -1
- package/lib/cjs/polyface/PolyfaceClip.js.map +1 -1
- package/lib/cjs/polyface/PolyfaceData.js.map +1 -1
- package/lib/cjs/polyface/PolyfaceQuery.d.ts +93 -14
- package/lib/cjs/polyface/PolyfaceQuery.d.ts.map +1 -1
- package/lib/cjs/polyface/PolyfaceQuery.js +173 -34
- package/lib/cjs/polyface/PolyfaceQuery.js.map +1 -1
- package/lib/cjs/polyface/RangeLengthData.js.map +1 -1
- package/lib/cjs/polyface/TaggedNumericData.js +1 -1
- package/lib/cjs/polyface/TaggedNumericData.js.map +1 -1
- package/lib/cjs/polyface/TriangleCandidate.js.map +1 -1
- package/lib/cjs/polyface/multiclip/BuildAverageNormalsContext.js +2 -2
- package/lib/cjs/polyface/multiclip/BuildAverageNormalsContext.js.map +1 -1
- package/lib/cjs/polyface/multiclip/GriddedRaggedRange2dSet.d.ts +27 -19
- package/lib/cjs/polyface/multiclip/GriddedRaggedRange2dSet.d.ts.map +1 -1
- package/lib/cjs/polyface/multiclip/GriddedRaggedRange2dSet.js +30 -12
- package/lib/cjs/polyface/multiclip/GriddedRaggedRange2dSet.js.map +1 -1
- package/lib/cjs/polyface/multiclip/GriddedRaggedRange2dSetWithOverflow.d.ts +12 -8
- package/lib/cjs/polyface/multiclip/GriddedRaggedRange2dSetWithOverflow.d.ts.map +1 -1
- package/lib/cjs/polyface/multiclip/GriddedRaggedRange2dSetWithOverflow.js +18 -4
- package/lib/cjs/polyface/multiclip/GriddedRaggedRange2dSetWithOverflow.js.map +1 -1
- package/lib/cjs/polyface/multiclip/LinearSearchRange2dArray.d.ts +3 -4
- package/lib/cjs/polyface/multiclip/LinearSearchRange2dArray.d.ts.map +1 -1
- package/lib/cjs/polyface/multiclip/LinearSearchRange2dArray.js +3 -5
- package/lib/cjs/polyface/multiclip/LinearSearchRange2dArray.js.map +1 -1
- package/lib/cjs/polyface/multiclip/OffsetMeshContext.js.map +1 -1
- package/lib/cjs/polyface/multiclip/Range2dSearchInterface.d.ts +15 -12
- package/lib/cjs/polyface/multiclip/Range2dSearchInterface.d.ts.map +1 -1
- package/lib/cjs/polyface/multiclip/Range2dSearchInterface.js.map +1 -1
- package/lib/cjs/polyface/multiclip/RangeSearch.js.map +1 -1
- package/lib/cjs/polyface/multiclip/SweepLineStringToFacetContext.d.ts +38 -0
- package/lib/cjs/polyface/multiclip/SweepLineStringToFacetContext.d.ts.map +1 -1
- package/lib/cjs/polyface/multiclip/SweepLineStringToFacetContext.js +104 -1
- package/lib/cjs/polyface/multiclip/SweepLineStringToFacetContext.js.map +1 -1
- package/lib/cjs/polyface/multiclip/XYPointBuckets.js.map +1 -1
- package/lib/cjs/serialization/BGFBAccessors.js.map +1 -1
- package/lib/cjs/serialization/BGFBReader.js.map +1 -1
- package/lib/cjs/serialization/BGFBWriter.js.map +1 -1
- package/lib/cjs/serialization/BentleyGeometryFlatBuffer.js.map +1 -1
- package/lib/cjs/serialization/DeepCompare.js.map +1 -1
- package/lib/cjs/serialization/GeometrySamples.d.ts +11 -0
- package/lib/cjs/serialization/GeometrySamples.d.ts.map +1 -1
- package/lib/cjs/serialization/GeometrySamples.js +30 -0
- package/lib/cjs/serialization/GeometrySamples.js.map +1 -1
- package/lib/cjs/serialization/IModelJsonSchema.d.ts +2 -7
- package/lib/cjs/serialization/IModelJsonSchema.d.ts.map +1 -1
- package/lib/cjs/serialization/IModelJsonSchema.js +2 -7
- package/lib/cjs/serialization/IModelJsonSchema.js.map +1 -1
- package/lib/cjs/solid/Box.js.map +1 -1
- package/lib/cjs/solid/Cone.js.map +1 -1
- package/lib/cjs/solid/LinearSweep.d.ts +2 -1
- package/lib/cjs/solid/LinearSweep.d.ts.map +1 -1
- package/lib/cjs/solid/LinearSweep.js.map +1 -1
- package/lib/cjs/solid/RotationalSweep.d.ts +2 -1
- package/lib/cjs/solid/RotationalSweep.d.ts.map +1 -1
- package/lib/cjs/solid/RotationalSweep.js.map +1 -1
- package/lib/cjs/solid/RuledSweep.d.ts +2 -1
- package/lib/cjs/solid/RuledSweep.d.ts.map +1 -1
- package/lib/cjs/solid/RuledSweep.js.map +1 -1
- package/lib/cjs/solid/SolidPrimitive.js.map +1 -1
- package/lib/cjs/solid/Sphere.js.map +1 -1
- package/lib/cjs/solid/SweepContour.d.ts +2 -2
- package/lib/cjs/solid/SweepContour.d.ts.map +1 -1
- package/lib/cjs/solid/SweepContour.js +9 -0
- package/lib/cjs/solid/SweepContour.js.map +1 -1
- package/lib/cjs/solid/TorusPipe.js.map +1 -1
- package/lib/cjs/topology/ChainMerge.js +1 -1
- package/lib/cjs/topology/ChainMerge.js.map +1 -1
- package/lib/cjs/topology/Graph.js.map +1 -1
- package/lib/cjs/topology/HalfEdgeGraphFromIndexedLoopsContext.js.map +1 -1
- package/lib/cjs/topology/HalfEdgeGraphSearch.d.ts.map +1 -1
- package/lib/cjs/topology/HalfEdgeGraphSearch.js +1 -1
- package/lib/cjs/topology/HalfEdgeGraphSearch.js.map +1 -1
- package/lib/cjs/topology/HalfEdgeGraphSpineContext.js +1 -1
- package/lib/cjs/topology/HalfEdgeGraphSpineContext.js.map +1 -1
- package/lib/cjs/topology/HalfEdgeGraphValidation.js.map +1 -1
- package/lib/cjs/topology/HalfEdgeMarkSet.js.map +1 -1
- package/lib/cjs/topology/HalfEdgeNodeXYZUV.js.map +1 -1
- package/lib/cjs/topology/HalfEdgePointInGraphSearch.js.map +1 -1
- package/lib/cjs/topology/HalfEdgePositionDetail.js.map +1 -1
- package/lib/cjs/topology/HalfEdgePriorityQueue.d.ts.map +1 -1
- package/lib/cjs/topology/HalfEdgePriorityQueue.js +1 -1
- package/lib/cjs/topology/HalfEdgePriorityQueue.js.map +1 -1
- package/lib/cjs/topology/InsertAndRetriangulateContext.js.map +1 -1
- package/lib/cjs/topology/MaskManager.js.map +1 -1
- package/lib/cjs/topology/Merging.js.map +1 -1
- package/lib/cjs/topology/RegularizeFace.js +3 -3
- package/lib/cjs/topology/RegularizeFace.js.map +1 -1
- package/lib/cjs/topology/SignedDataSummary.js.map +1 -1
- package/lib/cjs/topology/SpaceTriangulation.js.map +1 -1
- package/lib/cjs/topology/Triangulation.js +1 -1
- package/lib/cjs/topology/Triangulation.js.map +1 -1
- package/lib/cjs/topology/XYParitySearchContext.js.map +1 -1
- package/lib/esm/Constant.js.map +1 -1
- package/lib/esm/Geometry.js.map +1 -1
- package/lib/esm/bspline/AkimaCurve3d.js.map +1 -1
- package/lib/esm/bspline/BSpline1dNd.js.map +1 -1
- package/lib/esm/bspline/BSplineCurve.d.ts +1 -1
- package/lib/esm/bspline/BSplineCurve.d.ts.map +1 -1
- package/lib/esm/bspline/BSplineCurve.js +1 -1
- package/lib/esm/bspline/BSplineCurve.js.map +1 -1
- package/lib/esm/bspline/BSplineCurve3dH.js.map +1 -1
- package/lib/esm/bspline/BSplineCurveOps.js.map +1 -1
- package/lib/esm/bspline/BSplineSurface.d.ts.map +1 -1
- package/lib/esm/bspline/BSplineSurface.js +1 -1
- package/lib/esm/bspline/BSplineSurface.js.map +1 -1
- package/lib/esm/bspline/Bezier1dNd.js.map +1 -1
- package/lib/esm/bspline/BezierCurve3d.js.map +1 -1
- package/lib/esm/bspline/BezierCurve3dH.js.map +1 -1
- package/lib/esm/bspline/BezierCurveBase.d.ts +1 -1
- package/lib/esm/bspline/BezierCurveBase.d.ts.map +1 -1
- package/lib/esm/bspline/BezierCurveBase.js +1 -1
- package/lib/esm/bspline/BezierCurveBase.js.map +1 -1
- package/lib/esm/bspline/InterpolationCurve3d.js.map +1 -1
- package/lib/esm/bspline/KnotVector.js.map +1 -1
- package/lib/esm/bspline/SurfaceLocationDetail.js.map +1 -1
- package/lib/esm/clipping/AlternatingConvexClipTree.d.ts +15 -17
- package/lib/esm/clipping/AlternatingConvexClipTree.d.ts.map +1 -1
- package/lib/esm/clipping/AlternatingConvexClipTree.js +24 -20
- package/lib/esm/clipping/AlternatingConvexClipTree.js.map +1 -1
- package/lib/esm/clipping/BooleanClipFactory.d.ts +28 -28
- package/lib/esm/clipping/BooleanClipFactory.d.ts.map +1 -1
- package/lib/esm/clipping/BooleanClipFactory.js +28 -28
- package/lib/esm/clipping/BooleanClipFactory.js.map +1 -1
- package/lib/esm/clipping/BooleanClipNode.d.ts +11 -11
- package/lib/esm/clipping/BooleanClipNode.d.ts.map +1 -1
- package/lib/esm/clipping/BooleanClipNode.js +11 -11
- package/lib/esm/clipping/BooleanClipNode.js.map +1 -1
- package/lib/esm/clipping/ClipPlane.d.ts +73 -76
- package/lib/esm/clipping/ClipPlane.d.ts.map +1 -1
- package/lib/esm/clipping/ClipPlane.js +105 -86
- package/lib/esm/clipping/ClipPlane.js.map +1 -1
- package/lib/esm/clipping/ClipPrimitive.d.ts +78 -47
- package/lib/esm/clipping/ClipPrimitive.d.ts.map +1 -1
- package/lib/esm/clipping/ClipPrimitive.js +112 -54
- package/lib/esm/clipping/ClipPrimitive.js.map +1 -1
- package/lib/esm/clipping/ClipUtils.d.ts +54 -44
- package/lib/esm/clipping/ClipUtils.d.ts.map +1 -1
- package/lib/esm/clipping/ClipUtils.js +33 -29
- package/lib/esm/clipping/ClipUtils.js.map +1 -1
- package/lib/esm/clipping/ClipVector.d.ts +39 -25
- package/lib/esm/clipping/ClipVector.d.ts.map +1 -1
- package/lib/esm/clipping/ClipVector.js +35 -23
- package/lib/esm/clipping/ClipVector.js.map +1 -1
- package/lib/esm/clipping/ConvexClipPlaneSet.d.ts +61 -38
- package/lib/esm/clipping/ConvexClipPlaneSet.d.ts.map +1 -1
- package/lib/esm/clipping/ConvexClipPlaneSet.js +64 -41
- package/lib/esm/clipping/ConvexClipPlaneSet.js.map +1 -1
- package/lib/esm/clipping/UnionOfConvexClipPlaneSets.d.ts +49 -30
- package/lib/esm/clipping/UnionOfConvexClipPlaneSets.d.ts.map +1 -1
- package/lib/esm/clipping/UnionOfConvexClipPlaneSets.js +50 -30
- package/lib/esm/clipping/UnionOfConvexClipPlaneSets.js.map +1 -1
- package/lib/esm/clipping/internalContexts/LineStringOffsetClipperContext.d.ts +2 -2
- package/lib/esm/clipping/internalContexts/LineStringOffsetClipperContext.d.ts.map +1 -1
- package/lib/esm/clipping/internalContexts/LineStringOffsetClipperContext.js +2 -2
- package/lib/esm/clipping/internalContexts/LineStringOffsetClipperContext.js.map +1 -1
- package/lib/esm/core-geometry.d.ts +5 -1
- package/lib/esm/core-geometry.d.ts.map +1 -1
- package/lib/esm/core-geometry.js +5 -1
- package/lib/esm/core-geometry.js.map +1 -1
- package/lib/esm/curve/Arc3d.d.ts +4 -3
- package/lib/esm/curve/Arc3d.d.ts.map +1 -1
- package/lib/esm/curve/Arc3d.js +6 -4
- package/lib/esm/curve/Arc3d.js.map +1 -1
- package/lib/esm/curve/ConstructCurveBetweenCurves.js.map +1 -1
- package/lib/esm/curve/CoordinateXYZ.js.map +1 -1
- package/lib/esm/curve/CurveChain.js.map +1 -1
- package/lib/esm/curve/CurveChainWithDistanceIndex.d.ts +62 -42
- package/lib/esm/curve/CurveChainWithDistanceIndex.d.ts.map +1 -1
- package/lib/esm/curve/CurveChainWithDistanceIndex.js +70 -47
- package/lib/esm/curve/CurveChainWithDistanceIndex.js.map +1 -1
- package/lib/esm/curve/CurveCollection.d.ts +36 -26
- package/lib/esm/curve/CurveCollection.d.ts.map +1 -1
- package/lib/esm/curve/CurveCollection.js +46 -39
- package/lib/esm/curve/CurveCollection.js.map +1 -1
- package/lib/esm/curve/CurveCurve.d.ts +6 -2
- package/lib/esm/curve/CurveCurve.d.ts.map +1 -1
- package/lib/esm/curve/CurveCurve.js +13 -9
- package/lib/esm/curve/CurveCurve.js.map +1 -1
- package/lib/esm/curve/CurveCurveCloseApproachXY.d.ts +74 -68
- package/lib/esm/curve/CurveCurveCloseApproachXY.d.ts.map +1 -1
- package/lib/esm/curve/CurveCurveCloseApproachXY.js +100 -108
- package/lib/esm/curve/CurveCurveCloseApproachXY.js.map +1 -1
- package/lib/esm/curve/CurveCurveIntersectXY.d.ts +46 -48
- package/lib/esm/curve/CurveCurveIntersectXY.d.ts.map +1 -1
- package/lib/esm/curve/CurveCurveIntersectXY.js +72 -61
- package/lib/esm/curve/CurveCurveIntersectXY.js.map +1 -1
- package/lib/esm/curve/CurveCurveIntersectXYZ.d.ts +32 -38
- package/lib/esm/curve/CurveCurveIntersectXYZ.d.ts.map +1 -1
- package/lib/esm/curve/CurveCurveIntersectXYZ.js +86 -97
- package/lib/esm/curve/CurveCurveIntersectXYZ.js.map +1 -1
- package/lib/esm/curve/CurveExtendMode.js.map +1 -1
- package/lib/esm/curve/CurveFactory.d.ts +67 -3
- package/lib/esm/curve/CurveFactory.d.ts.map +1 -1
- package/lib/esm/curve/CurveFactory.js +74 -6
- package/lib/esm/curve/CurveFactory.js.map +1 -1
- package/lib/esm/curve/CurveLocationDetail.d.ts +6 -6
- package/lib/esm/curve/CurveLocationDetail.d.ts.map +1 -1
- package/lib/esm/curve/CurveLocationDetail.js +9 -7
- package/lib/esm/curve/CurveLocationDetail.js.map +1 -1
- package/lib/esm/curve/CurveOps.d.ts +77 -0
- package/lib/esm/curve/CurveOps.d.ts.map +1 -0
- package/lib/esm/curve/CurveOps.js +156 -0
- package/lib/esm/curve/CurveOps.js.map +1 -0
- package/lib/esm/curve/CurvePrimitive.d.ts +26 -18
- package/lib/esm/curve/CurvePrimitive.d.ts.map +1 -1
- package/lib/esm/curve/CurvePrimitive.js +4 -3
- package/lib/esm/curve/CurvePrimitive.js.map +1 -1
- package/lib/esm/curve/CurveProcessor.js.map +1 -1
- package/lib/esm/curve/CurveWireMomentsXYZ.js.map +1 -1
- package/lib/esm/curve/GeometryQuery.d.ts +2 -2
- package/lib/esm/curve/GeometryQuery.d.ts.map +1 -1
- package/lib/esm/curve/GeometryQuery.js +2 -2
- package/lib/esm/curve/GeometryQuery.js.map +1 -1
- package/lib/esm/curve/LineSegment3d.d.ts +7 -5
- package/lib/esm/curve/LineSegment3d.d.ts.map +1 -1
- package/lib/esm/curve/LineSegment3d.js +5 -5
- package/lib/esm/curve/LineSegment3d.js.map +1 -1
- package/lib/esm/curve/LineString3d.d.ts +2 -2
- package/lib/esm/curve/LineString3d.d.ts.map +1 -1
- package/lib/esm/curve/LineString3d.js +2 -2
- package/lib/esm/curve/LineString3d.js.map +1 -1
- package/lib/esm/curve/Loop.d.ts +7 -5
- package/lib/esm/curve/Loop.d.ts.map +1 -1
- package/lib/esm/curve/Loop.js +18 -6
- package/lib/esm/curve/Loop.js.map +1 -1
- package/lib/esm/curve/OffsetOptions.d.ts +97 -0
- package/lib/esm/curve/OffsetOptions.d.ts.map +1 -0
- package/lib/esm/curve/OffsetOptions.js +161 -0
- package/lib/esm/curve/OffsetOptions.js.map +1 -0
- package/lib/esm/curve/ParityRegion.d.ts +7 -7
- package/lib/esm/curve/ParityRegion.d.ts.map +1 -1
- package/lib/esm/curve/ParityRegion.js +19 -11
- package/lib/esm/curve/ParityRegion.js.map +1 -1
- package/lib/esm/curve/Path.d.ts +6 -6
- package/lib/esm/curve/Path.d.ts.map +1 -1
- package/lib/esm/curve/Path.js +15 -9
- package/lib/esm/curve/Path.js.map +1 -1
- package/lib/esm/curve/PointString3d.js.map +1 -1
- package/lib/esm/curve/ProxyCurve.d.ts +5 -7
- package/lib/esm/curve/ProxyCurve.d.ts.map +1 -1
- package/lib/esm/curve/ProxyCurve.js +7 -7
- package/lib/esm/curve/ProxyCurve.js.map +1 -1
- package/lib/esm/curve/Query/ConsolidateAdjacentPrimitivesContext.js.map +1 -1
- package/lib/esm/curve/Query/CurveSplitContext.js.map +1 -1
- package/lib/esm/curve/Query/CylindricalRange.js.map +1 -1
- package/lib/esm/curve/Query/InOutTests.js.map +1 -1
- package/lib/esm/curve/Query/PlanarSubdivision.js.map +1 -1
- package/lib/esm/curve/Query/StrokeCountChain.js.map +1 -1
- package/lib/esm/curve/Query/StrokeCountMap.js.map +1 -1
- package/lib/esm/curve/RegionMomentsXY.js.map +1 -1
- package/lib/esm/curve/RegionOps.d.ts +76 -56
- package/lib/esm/curve/RegionOps.d.ts.map +1 -1
- package/lib/esm/curve/RegionOps.js +84 -61
- package/lib/esm/curve/RegionOps.js.map +1 -1
- package/lib/esm/curve/RegionOpsClassificationSweeps.js +2 -2
- package/lib/esm/curve/RegionOpsClassificationSweeps.js.map +1 -1
- package/lib/esm/curve/StrokeOptions.d.ts.map +1 -1
- package/lib/esm/curve/StrokeOptions.js +6 -2
- package/lib/esm/curve/StrokeOptions.js.map +1 -1
- package/lib/esm/curve/UnionRegion.d.ts +6 -5
- package/lib/esm/curve/UnionRegion.d.ts.map +1 -1
- package/lib/esm/curve/UnionRegion.js +17 -8
- package/lib/esm/curve/UnionRegion.js.map +1 -1
- package/lib/esm/curve/internalContexts/AppendPlaneIntersectionStrokeHandler.js.map +1 -1
- package/lib/esm/curve/{ChainCollectorContext.d.ts → internalContexts/ChainCollectorContext.d.ts} +4 -4
- package/lib/esm/curve/internalContexts/ChainCollectorContext.d.ts.map +1 -0
- package/lib/esm/curve/{ChainCollectorContext.js → internalContexts/ChainCollectorContext.js} +4 -4
- package/lib/esm/curve/internalContexts/ChainCollectorContext.js.map +1 -0
- package/lib/esm/curve/internalContexts/CloneCurvesContext.js.map +1 -1
- package/lib/esm/curve/internalContexts/CloneWithExpandedLineStrings.js.map +1 -1
- package/lib/esm/curve/internalContexts/ClosestPointStrokeHandler.js.map +1 -1
- package/lib/esm/curve/internalContexts/CountLinearPartsSearchContext.js.map +1 -1
- package/lib/esm/curve/internalContexts/CurveLengthContext.js.map +1 -1
- package/lib/esm/curve/internalContexts/CurveOffsetXYHandler.js.map +1 -1
- package/lib/esm/curve/internalContexts/GapSearchContext.d.ts +2 -1
- package/lib/esm/curve/internalContexts/GapSearchContext.d.ts.map +1 -1
- package/lib/esm/curve/internalContexts/GapSearchContext.js +6 -2
- package/lib/esm/curve/internalContexts/GapSearchContext.js.map +1 -1
- package/lib/esm/curve/internalContexts/MultiChainCollector.d.ts +59 -70
- package/lib/esm/curve/internalContexts/MultiChainCollector.d.ts.map +1 -1
- package/lib/esm/curve/internalContexts/MultiChainCollector.js +129 -218
- package/lib/esm/curve/internalContexts/MultiChainCollector.js.map +1 -1
- package/lib/esm/curve/internalContexts/NewtonRtoRStrokeHandler.js.map +1 -1
- package/lib/esm/curve/internalContexts/PlaneAltitudeRangeContext.d.ts +14 -8
- package/lib/esm/curve/internalContexts/PlaneAltitudeRangeContext.d.ts.map +1 -1
- package/lib/esm/curve/internalContexts/PlaneAltitudeRangeContext.js +14 -8
- package/lib/esm/curve/internalContexts/PlaneAltitudeRangeContext.js.map +1 -1
- package/lib/esm/curve/internalContexts/PolygonOffsetContext.d.ts +23 -95
- package/lib/esm/curve/internalContexts/PolygonOffsetContext.d.ts.map +1 -1
- package/lib/esm/curve/internalContexts/PolygonOffsetContext.js +86 -173
- package/lib/esm/curve/internalContexts/PolygonOffsetContext.js.map +1 -1
- package/lib/esm/curve/internalContexts/SumLengthsContext.d.ts.map +1 -1
- package/lib/esm/curve/internalContexts/SumLengthsContext.js +4 -1
- package/lib/esm/curve/internalContexts/SumLengthsContext.js.map +1 -1
- package/lib/esm/curve/internalContexts/TransformInPlaceContext.js.map +1 -1
- package/lib/esm/curve/spiral/AustralianRailCorpXYEvaluator.js.map +1 -1
- package/lib/esm/curve/spiral/ClothoidSeries.js.map +1 -1
- package/lib/esm/curve/spiral/CubicEvaluator.js.map +1 -1
- package/lib/esm/curve/spiral/CzechSpiralEvaluator.js.map +1 -1
- package/lib/esm/curve/spiral/DirectHalfCosineSpiralEvaluator.js.map +1 -1
- package/lib/esm/curve/spiral/DirectSpiral3d.js.map +1 -1
- package/lib/esm/curve/spiral/IntegratedSpiral3d.js +1 -1
- package/lib/esm/curve/spiral/IntegratedSpiral3d.js.map +1 -1
- package/lib/esm/curve/spiral/MXCubicAlongArcSpiralEvaluator.js.map +1 -1
- package/lib/esm/curve/spiral/NormalizedTransition.js.map +1 -1
- package/lib/esm/curve/spiral/PolishCubicSpiralEvaluator.js.map +1 -1
- package/lib/esm/curve/spiral/TransitionConditionalProperties.js.map +1 -1
- package/lib/esm/curve/spiral/TransitionSpiral3d.d.ts +1 -1
- package/lib/esm/curve/spiral/TransitionSpiral3d.d.ts.map +1 -1
- package/lib/esm/curve/spiral/TransitionSpiral3d.js +1 -1
- package/lib/esm/curve/spiral/TransitionSpiral3d.js.map +1 -1
- package/lib/esm/curve/spiral/XYCurveEvaluator.js +1 -1
- package/lib/esm/curve/spiral/XYCurveEvaluator.js.map +1 -1
- package/lib/esm/geometry3d/Angle.d.ts +9 -0
- package/lib/esm/geometry3d/Angle.d.ts.map +1 -1
- package/lib/esm/geometry3d/Angle.js +13 -0
- package/lib/esm/geometry3d/Angle.js.map +1 -1
- package/lib/esm/geometry3d/AngleSweep.js.map +1 -1
- package/lib/esm/geometry3d/BarycentricTriangle.js.map +1 -1
- package/lib/esm/geometry3d/BilinearPatch.d.ts +43 -48
- package/lib/esm/geometry3d/BilinearPatch.d.ts.map +1 -1
- package/lib/esm/geometry3d/BilinearPatch.js +51 -55
- package/lib/esm/geometry3d/BilinearPatch.js.map +1 -1
- package/lib/esm/geometry3d/CoincidentGeometryOps.js.map +1 -1
- package/lib/esm/geometry3d/Ellipsoid.d.ts +1 -1
- package/lib/esm/geometry3d/Ellipsoid.js +1 -1
- package/lib/esm/geometry3d/Ellipsoid.js.map +1 -1
- package/lib/esm/geometry3d/FrameBuilder.d.ts.map +1 -1
- package/lib/esm/geometry3d/FrameBuilder.js +13 -11
- package/lib/esm/geometry3d/FrameBuilder.js.map +1 -1
- package/lib/esm/geometry3d/FrustumAnimation.js.map +1 -1
- package/lib/esm/geometry3d/GeometryHandler.d.ts +103 -97
- package/lib/esm/geometry3d/GeometryHandler.d.ts.map +1 -1
- package/lib/esm/geometry3d/GeometryHandler.js +247 -124
- package/lib/esm/geometry3d/GeometryHandler.js.map +1 -1
- package/lib/esm/geometry3d/GrowableBlockedArray.d.ts.map +1 -1
- package/lib/esm/geometry3d/GrowableBlockedArray.js +1 -1
- package/lib/esm/geometry3d/GrowableBlockedArray.js.map +1 -1
- package/lib/esm/geometry3d/GrowableFloat64Array.d.ts.map +1 -1
- package/lib/esm/geometry3d/GrowableFloat64Array.js +1 -1
- package/lib/esm/geometry3d/GrowableFloat64Array.js.map +1 -1
- package/lib/esm/geometry3d/GrowableXYArray.js.map +1 -1
- package/lib/esm/geometry3d/GrowableXYZArray.js.map +1 -1
- package/lib/esm/geometry3d/IndexedCollectionInterval.js.map +1 -1
- package/lib/esm/geometry3d/IndexedXYCollection.js.map +1 -1
- package/lib/esm/geometry3d/IndexedXYZCollection.js.map +1 -1
- package/lib/esm/geometry3d/LongitudeLatitudeAltitude.js.map +1 -1
- package/lib/esm/geometry3d/Matrix3d.d.ts +18 -0
- package/lib/esm/geometry3d/Matrix3d.d.ts.map +1 -1
- package/lib/esm/geometry3d/Matrix3d.js +32 -5
- package/lib/esm/geometry3d/Matrix3d.js.map +1 -1
- package/lib/esm/geometry3d/OrderedRotationAngles.js.map +1 -1
- package/lib/esm/geometry3d/Plane3d.d.ts +41 -32
- package/lib/esm/geometry3d/Plane3d.d.ts.map +1 -1
- package/lib/esm/geometry3d/Plane3d.js +11 -8
- package/lib/esm/geometry3d/Plane3d.js.map +1 -1
- package/lib/esm/geometry3d/Plane3dByOriginAndUnitNormal.d.ts +37 -34
- package/lib/esm/geometry3d/Plane3dByOriginAndUnitNormal.d.ts.map +1 -1
- package/lib/esm/geometry3d/Plane3dByOriginAndUnitNormal.js +65 -43
- package/lib/esm/geometry3d/Plane3dByOriginAndUnitNormal.js.map +1 -1
- package/lib/esm/geometry3d/Plane3dByOriginAndVectors.d.ts +36 -32
- package/lib/esm/geometry3d/Plane3dByOriginAndVectors.d.ts.map +1 -1
- package/lib/esm/geometry3d/Plane3dByOriginAndVectors.js +37 -32
- package/lib/esm/geometry3d/Plane3dByOriginAndVectors.js.map +1 -1
- package/lib/esm/geometry3d/Point2dArrayCarrier.js.map +1 -1
- package/lib/esm/geometry3d/Point2dVector2d.d.ts +8 -9
- package/lib/esm/geometry3d/Point2dVector2d.d.ts.map +1 -1
- package/lib/esm/geometry3d/Point2dVector2d.js +9 -10
- package/lib/esm/geometry3d/Point2dVector2d.js.map +1 -1
- package/lib/esm/geometry3d/Point3dArrayCarrier.js.map +1 -1
- package/lib/esm/geometry3d/Point3dVector3d.d.ts +12 -4
- package/lib/esm/geometry3d/Point3dVector3d.d.ts.map +1 -1
- package/lib/esm/geometry3d/Point3dVector3d.js +18 -5
- package/lib/esm/geometry3d/Point3dVector3d.js.map +1 -1
- package/lib/esm/geometry3d/PointHelpers.d.ts.map +1 -1
- package/lib/esm/geometry3d/PointHelpers.js +5 -5
- package/lib/esm/geometry3d/PointHelpers.js.map +1 -1
- package/lib/esm/geometry3d/PointStreaming.js.map +1 -1
- package/lib/esm/geometry3d/PolygonOps.d.ts +6 -2
- package/lib/esm/geometry3d/PolygonOps.d.ts.map +1 -1
- package/lib/esm/geometry3d/PolygonOps.js +31 -22
- package/lib/esm/geometry3d/PolygonOps.js.map +1 -1
- package/lib/esm/geometry3d/PolylineCompressionByEdgeOffset.js.map +1 -1
- package/lib/esm/geometry3d/PolylineOps.d.ts +16 -1
- package/lib/esm/geometry3d/PolylineOps.d.ts.map +1 -1
- package/lib/esm/geometry3d/PolylineOps.js +56 -1
- package/lib/esm/geometry3d/PolylineOps.js.map +1 -1
- package/lib/esm/geometry3d/Range.d.ts +134 -94
- package/lib/esm/geometry3d/Range.d.ts.map +1 -1
- package/lib/esm/geometry3d/Range.js +297 -145
- package/lib/esm/geometry3d/Range.js.map +1 -1
- package/lib/esm/geometry3d/Ray2d.d.ts +69 -0
- package/lib/esm/geometry3d/Ray2d.d.ts.map +1 -0
- package/lib/esm/geometry3d/Ray2d.js +142 -0
- package/lib/esm/geometry3d/Ray2d.js.map +1 -0
- package/lib/esm/geometry3d/Ray3d.d.ts.map +1 -1
- package/lib/esm/geometry3d/Ray3d.js.map +1 -1
- package/lib/esm/geometry3d/ReusableObjectCache.js.map +1 -1
- package/lib/esm/geometry3d/Segment1d.js.map +1 -1
- package/lib/esm/geometry3d/SortablePolygon.js.map +1 -1
- package/lib/esm/geometry3d/Transform.d.ts +10 -3
- package/lib/esm/geometry3d/Transform.d.ts.map +1 -1
- package/lib/esm/geometry3d/Transform.js +18 -6
- package/lib/esm/geometry3d/Transform.js.map +1 -1
- package/lib/esm/geometry3d/UVSurfaceOps.js.map +1 -1
- package/lib/esm/geometry3d/XYZProps.js.map +1 -1
- package/lib/esm/geometry3d/YawPitchRollAngles.js.map +1 -1
- package/lib/esm/geometry4d/Map4d.js.map +1 -1
- package/lib/esm/geometry4d/Matrix4d.js.map +1 -1
- package/lib/esm/geometry4d/MomentData.js.map +1 -1
- package/lib/esm/geometry4d/PlaneByOriginAndVectors4d.js.map +1 -1
- package/lib/esm/geometry4d/Point4d.js.map +1 -1
- package/lib/esm/numerics/BandedSystem.js.map +1 -1
- package/lib/esm/numerics/BezierPolynomials.js.map +1 -1
- package/lib/esm/numerics/ClusterableArray.js.map +1 -1
- package/lib/esm/numerics/Complex.js.map +1 -1
- package/lib/esm/numerics/ConvexPolygon2d.d.ts +7 -49
- package/lib/esm/numerics/ConvexPolygon2d.d.ts.map +1 -1
- package/lib/esm/numerics/ConvexPolygon2d.js +14 -104
- package/lib/esm/numerics/ConvexPolygon2d.js.map +1 -1
- package/lib/esm/numerics/Newton.js.map +1 -1
- package/lib/esm/numerics/PascalCoefficients.js.map +1 -1
- package/lib/esm/numerics/PolarData.js.map +1 -1
- package/lib/esm/numerics/Polynomials.d.ts.map +1 -1
- package/lib/esm/numerics/Polynomials.js +0 -2
- package/lib/esm/numerics/Polynomials.js.map +1 -1
- package/lib/esm/numerics/Quadrature.js +5 -5
- package/lib/esm/numerics/Quadrature.js.map +1 -1
- package/lib/esm/numerics/Range1dArray.js.map +1 -1
- package/lib/esm/numerics/TriDiagonalSystem.js.map +1 -1
- package/lib/esm/numerics/UnionFind.js.map +1 -1
- package/lib/esm/numerics/UsageSums.js.map +1 -1
- package/lib/esm/polyface/AuxData.js.map +1 -1
- package/lib/esm/polyface/BoxTopology.js.map +1 -1
- package/lib/esm/polyface/FacetFaceData.js.map +1 -1
- package/lib/esm/polyface/FacetLocationDetail.js.map +1 -1
- package/lib/esm/polyface/FacetOrientation.js.map +1 -1
- package/lib/esm/polyface/GreedyTriangulationBetweenLineStrings.js.map +1 -1
- package/lib/esm/polyface/IndexedEdgeMatcher.js +1 -1
- package/lib/esm/polyface/IndexedEdgeMatcher.js.map +1 -1
- package/lib/esm/polyface/IndexedPolyfaceVisitor.js.map +1 -1
- package/lib/esm/polyface/Polyface.js.map +1 -1
- package/lib/esm/polyface/PolyfaceBuilder.d.ts.map +1 -1
- package/lib/esm/polyface/PolyfaceBuilder.js +2 -2
- package/lib/esm/polyface/PolyfaceBuilder.js.map +1 -1
- package/lib/esm/polyface/PolyfaceClip.js.map +1 -1
- package/lib/esm/polyface/PolyfaceData.js.map +1 -1
- package/lib/esm/polyface/PolyfaceQuery.d.ts +93 -14
- package/lib/esm/polyface/PolyfaceQuery.d.ts.map +1 -1
- package/lib/esm/polyface/PolyfaceQuery.js +173 -35
- package/lib/esm/polyface/PolyfaceQuery.js.map +1 -1
- package/lib/esm/polyface/RangeLengthData.js.map +1 -1
- package/lib/esm/polyface/TaggedNumericData.js +1 -1
- package/lib/esm/polyface/TaggedNumericData.js.map +1 -1
- package/lib/esm/polyface/TriangleCandidate.js.map +1 -1
- package/lib/esm/polyface/multiclip/BuildAverageNormalsContext.js +2 -2
- package/lib/esm/polyface/multiclip/BuildAverageNormalsContext.js.map +1 -1
- package/lib/esm/polyface/multiclip/GriddedRaggedRange2dSet.d.ts +27 -19
- package/lib/esm/polyface/multiclip/GriddedRaggedRange2dSet.d.ts.map +1 -1
- package/lib/esm/polyface/multiclip/GriddedRaggedRange2dSet.js +30 -12
- package/lib/esm/polyface/multiclip/GriddedRaggedRange2dSet.js.map +1 -1
- package/lib/esm/polyface/multiclip/GriddedRaggedRange2dSetWithOverflow.d.ts +12 -8
- package/lib/esm/polyface/multiclip/GriddedRaggedRange2dSetWithOverflow.d.ts.map +1 -1
- package/lib/esm/polyface/multiclip/GriddedRaggedRange2dSetWithOverflow.js +18 -4
- package/lib/esm/polyface/multiclip/GriddedRaggedRange2dSetWithOverflow.js.map +1 -1
- package/lib/esm/polyface/multiclip/LinearSearchRange2dArray.d.ts +3 -4
- package/lib/esm/polyface/multiclip/LinearSearchRange2dArray.d.ts.map +1 -1
- package/lib/esm/polyface/multiclip/LinearSearchRange2dArray.js +3 -5
- package/lib/esm/polyface/multiclip/LinearSearchRange2dArray.js.map +1 -1
- package/lib/esm/polyface/multiclip/OffsetMeshContext.js.map +1 -1
- package/lib/esm/polyface/multiclip/Range2dSearchInterface.d.ts +15 -12
- package/lib/esm/polyface/multiclip/Range2dSearchInterface.d.ts.map +1 -1
- package/lib/esm/polyface/multiclip/Range2dSearchInterface.js.map +1 -1
- package/lib/esm/polyface/multiclip/RangeSearch.js.map +1 -1
- package/lib/esm/polyface/multiclip/SweepLineStringToFacetContext.d.ts +38 -0
- package/lib/esm/polyface/multiclip/SweepLineStringToFacetContext.d.ts.map +1 -1
- package/lib/esm/polyface/multiclip/SweepLineStringToFacetContext.js +102 -1
- package/lib/esm/polyface/multiclip/SweepLineStringToFacetContext.js.map +1 -1
- package/lib/esm/polyface/multiclip/XYPointBuckets.js.map +1 -1
- package/lib/esm/serialization/BGFBAccessors.js.map +1 -1
- package/lib/esm/serialization/BGFBReader.js.map +1 -1
- package/lib/esm/serialization/BGFBWriter.js.map +1 -1
- package/lib/esm/serialization/BentleyGeometryFlatBuffer.js.map +1 -1
- package/lib/esm/serialization/DeepCompare.js.map +1 -1
- package/lib/esm/serialization/GeometrySamples.d.ts +11 -0
- package/lib/esm/serialization/GeometrySamples.d.ts.map +1 -1
- package/lib/esm/serialization/GeometrySamples.js +30 -0
- package/lib/esm/serialization/GeometrySamples.js.map +1 -1
- package/lib/esm/serialization/IModelJsonSchema.d.ts +2 -7
- package/lib/esm/serialization/IModelJsonSchema.d.ts.map +1 -1
- package/lib/esm/serialization/IModelJsonSchema.js +2 -7
- package/lib/esm/serialization/IModelJsonSchema.js.map +1 -1
- package/lib/esm/solid/Box.js.map +1 -1
- package/lib/esm/solid/Cone.js.map +1 -1
- package/lib/esm/solid/LinearSweep.d.ts +2 -1
- package/lib/esm/solid/LinearSweep.d.ts.map +1 -1
- package/lib/esm/solid/LinearSweep.js.map +1 -1
- package/lib/esm/solid/RotationalSweep.d.ts +2 -1
- package/lib/esm/solid/RotationalSweep.d.ts.map +1 -1
- package/lib/esm/solid/RotationalSweep.js.map +1 -1
- package/lib/esm/solid/RuledSweep.d.ts +2 -1
- package/lib/esm/solid/RuledSweep.d.ts.map +1 -1
- package/lib/esm/solid/RuledSweep.js.map +1 -1
- package/lib/esm/solid/SolidPrimitive.js.map +1 -1
- package/lib/esm/solid/Sphere.js.map +1 -1
- package/lib/esm/solid/SweepContour.d.ts +2 -2
- package/lib/esm/solid/SweepContour.d.ts.map +1 -1
- package/lib/esm/solid/SweepContour.js +9 -0
- package/lib/esm/solid/SweepContour.js.map +1 -1
- package/lib/esm/solid/TorusPipe.js.map +1 -1
- package/lib/esm/topology/ChainMerge.js +1 -1
- package/lib/esm/topology/ChainMerge.js.map +1 -1
- package/lib/esm/topology/Graph.js.map +1 -1
- package/lib/esm/topology/HalfEdgeGraphFromIndexedLoopsContext.js.map +1 -1
- package/lib/esm/topology/HalfEdgeGraphSearch.d.ts.map +1 -1
- package/lib/esm/topology/HalfEdgeGraphSearch.js +1 -1
- package/lib/esm/topology/HalfEdgeGraphSearch.js.map +1 -1
- package/lib/esm/topology/HalfEdgeGraphSpineContext.js +1 -1
- package/lib/esm/topology/HalfEdgeGraphSpineContext.js.map +1 -1
- package/lib/esm/topology/HalfEdgeGraphValidation.js.map +1 -1
- package/lib/esm/topology/HalfEdgeMarkSet.js.map +1 -1
- package/lib/esm/topology/HalfEdgeNodeXYZUV.js.map +1 -1
- package/lib/esm/topology/HalfEdgePointInGraphSearch.js.map +1 -1
- package/lib/esm/topology/HalfEdgePositionDetail.js.map +1 -1
- package/lib/esm/topology/HalfEdgePriorityQueue.d.ts.map +1 -1
- package/lib/esm/topology/HalfEdgePriorityQueue.js +1 -1
- package/lib/esm/topology/HalfEdgePriorityQueue.js.map +1 -1
- package/lib/esm/topology/InsertAndRetriangulateContext.js.map +1 -1
- package/lib/esm/topology/MaskManager.js.map +1 -1
- package/lib/esm/topology/Merging.js.map +1 -1
- package/lib/esm/topology/RegularizeFace.js +3 -3
- package/lib/esm/topology/RegularizeFace.js.map +1 -1
- package/lib/esm/topology/SignedDataSummary.js.map +1 -1
- package/lib/esm/topology/SpaceTriangulation.js.map +1 -1
- package/lib/esm/topology/Triangulation.js +1 -1
- package/lib/esm/topology/Triangulation.js.map +1 -1
- package/lib/esm/topology/XYParitySearchContext.js.map +1 -1
- package/package.json +6 -17
- package/lib/cjs/curve/ChainCollectorContext.d.ts.map +0 -1
- package/lib/cjs/curve/ChainCollectorContext.js.map +0 -1
- package/lib/esm/curve/ChainCollectorContext.d.ts.map +0 -1
- package/lib/esm/curve/ChainCollectorContext.js.map +0 -1
|
@@ -12,29 +12,20 @@ const BSplineCurve_1 = require("../bspline/BSplineCurve");
|
|
|
12
12
|
const Geometry_1 = require("../Geometry");
|
|
13
13
|
const GeometryHandler_1 = require("../geometry3d/GeometryHandler");
|
|
14
14
|
const Plane3dByOriginAndUnitNormal_1 = require("../geometry3d/Plane3dByOriginAndUnitNormal");
|
|
15
|
-
// import { Arc3d } from "./Arc3d";
|
|
16
15
|
const Point2dVector2d_1 = require("../geometry3d/Point2dVector2d");
|
|
17
|
-
// import { XYAndZ } from "../geometry3d/XYZProps";
|
|
18
16
|
const Point3dVector3d_1 = require("../geometry3d/Point3dVector3d");
|
|
19
|
-
// import { LineString3d } from "./LineString3d";
|
|
20
17
|
const Polynomials_1 = require("../numerics/Polynomials");
|
|
21
|
-
// import { Point4d } from "../geometry4d/Point4d";
|
|
22
|
-
// import { Transform } from "../geometry3d/Transform";
|
|
23
|
-
// import { Matrix3d } from "../geometry3d/Matrix3d";
|
|
24
18
|
const Arc3d_1 = require("./Arc3d");
|
|
25
|
-
// import { Range3d } from "../geometry3d/Range";
|
|
26
19
|
const CurveCurveIntersectXY_1 = require("./CurveCurveIntersectXY");
|
|
27
20
|
const CurveLocationDetail_1 = require("./CurveLocationDetail");
|
|
28
21
|
const LineSegment3d_1 = require("./LineSegment3d");
|
|
29
22
|
const LineString3d_1 = require("./LineString3d");
|
|
30
23
|
// cspell:word XYRR
|
|
31
24
|
/**
|
|
32
|
-
*
|
|
25
|
+
* Handler class for XYZ intersections between _geometryB and another geometry.
|
|
26
|
+
* * **NOTE:** GeometryQuery input (_geometryB) should really be AnyCurve.
|
|
33
27
|
* * Instances are initialized and called from CurveCurve.
|
|
34
|
-
* *
|
|
35
|
-
* * geometryB is saved for later reference
|
|
36
|
-
* * type-specific handler methods will "see" geometry A repeatedly.
|
|
37
|
-
* * Hence geometryA is NOT saved by the constructor.
|
|
28
|
+
* * geometryB is saved for later reference.
|
|
38
29
|
* @internal
|
|
39
30
|
*/
|
|
40
31
|
class CurveCurveIntersectXYZ extends GeometryHandler_1.NullGeometryHandler {
|
|
@@ -42,15 +33,12 @@ class CurveCurveIntersectXYZ extends GeometryHandler_1.NullGeometryHandler {
|
|
|
42
33
|
this._results = new CurveCurveIntersectXY_1.CurveLocationDetailArrayPair();
|
|
43
34
|
}
|
|
44
35
|
/**
|
|
45
|
-
*
|
|
46
|
-
* @param _geometryA first curve for intersection. This is NOT saved.
|
|
47
|
-
* @param extendA flag to enable using extension of geometryA.
|
|
36
|
+
* @param extendA flag to enable using extension of the other geometry.
|
|
48
37
|
* @param geometryB second curve for intersection. Saved for reference by specific handler methods.
|
|
49
38
|
* @param extendB flag for extension of geometryB.
|
|
50
39
|
*/
|
|
51
|
-
constructor(
|
|
40
|
+
constructor(extendA, geometryB, extendB) {
|
|
52
41
|
super();
|
|
53
|
-
// this.geometryA = _geometryA;
|
|
54
42
|
this._extendA = extendA;
|
|
55
43
|
this._geometryB = geometryB;
|
|
56
44
|
this._extendB = extendB;
|
|
@@ -59,7 +47,6 @@ class CurveCurveIntersectXYZ extends GeometryHandler_1.NullGeometryHandler {
|
|
|
59
47
|
/**
|
|
60
48
|
* * Return the results structure for the intersection calculation.
|
|
61
49
|
* @param reinitialize if true, a new results structure is created for use by later calls.
|
|
62
|
-
*
|
|
63
50
|
*/
|
|
64
51
|
grabResults(reinitialize = false) {
|
|
65
52
|
const result = this._results;
|
|
@@ -74,10 +61,11 @@ class CurveCurveIntersectXYZ extends GeometryHandler_1.NullGeometryHandler {
|
|
|
74
61
|
return false;
|
|
75
62
|
return true;
|
|
76
63
|
}
|
|
77
|
-
/**
|
|
78
|
-
*
|
|
79
|
-
*
|
|
80
|
-
*
|
|
64
|
+
/**
|
|
65
|
+
* Compute intersection of two line segments.
|
|
66
|
+
* Filter by extension rules.
|
|
67
|
+
* Reject if evaluated points do not match coordinates (e.g. close approach point).
|
|
68
|
+
* Record with fraction mapping.
|
|
81
69
|
*/
|
|
82
70
|
recordPointWithLocalFractions(localFractionA, cpA, fractionA0, fractionA1, localFractionB, // Computed intersection fraction
|
|
83
71
|
cpB, fractionB0, fractionB1, reversed) {
|
|
@@ -89,11 +77,13 @@ class CurveCurveIntersectXYZ extends GeometryHandler_1.NullGeometryHandler {
|
|
|
89
77
|
const topFractionA = this._results.dataA[numPrevious - 1].fraction;
|
|
90
78
|
const topFractionB = this._results.dataB[numPrevious - 1].fraction;
|
|
91
79
|
if (reversed) {
|
|
92
|
-
if (Geometry_1.Geometry.isAlmostEqualNumber(topFractionA, globalFractionB) &&
|
|
80
|
+
if (Geometry_1.Geometry.isAlmostEqualNumber(topFractionA, globalFractionB) &&
|
|
81
|
+
Geometry_1.Geometry.isAlmostEqualNumber(topFractionB, globalFractionA))
|
|
93
82
|
return;
|
|
94
83
|
}
|
|
95
84
|
else {
|
|
96
|
-
if (Geometry_1.Geometry.isAlmostEqualNumber(topFractionA, globalFractionA) &&
|
|
85
|
+
if (Geometry_1.Geometry.isAlmostEqualNumber(topFractionA, globalFractionA) &&
|
|
86
|
+
Geometry_1.Geometry.isAlmostEqualNumber(topFractionB, globalFractionB))
|
|
97
87
|
return;
|
|
98
88
|
}
|
|
99
89
|
}
|
|
@@ -114,15 +104,15 @@ class CurveCurveIntersectXYZ extends GeometryHandler_1.NullGeometryHandler {
|
|
|
114
104
|
this._results.dataB.push(detailB);
|
|
115
105
|
}
|
|
116
106
|
}
|
|
117
|
-
/**
|
|
118
|
-
*
|
|
119
|
-
*
|
|
107
|
+
/**
|
|
108
|
+
* Compute intersection of two line segments.
|
|
109
|
+
* Filter by extension rules.
|
|
110
|
+
* Record with fraction mapping.
|
|
120
111
|
*/
|
|
121
112
|
computeSegmentSegment3D(cpA, extendA0, pointA0, fractionA0, pointA1, fractionA1, extendA1, cpB, extendB0, pointB0, fractionB0, pointB1, fractionB1, extendB1, reversed) {
|
|
122
113
|
const uv = CurveCurveIntersectXYZ._workVector2dA;
|
|
123
|
-
if (Polynomials_1.SmallSystem.lineSegment3dClosestApproachUnbounded(pointA0, pointA1, pointB0, pointB1, uv)
|
|
124
|
-
|
|
125
|
-
&& this.acceptFraction(extendB0, uv.y, extendB1)) {
|
|
114
|
+
if (Polynomials_1.SmallSystem.lineSegment3dClosestApproachUnbounded(pointA0, pointA1, pointB0, pointB1, uv) &&
|
|
115
|
+
this.acceptFraction(extendA0, uv.x, extendA1) && this.acceptFraction(extendB0, uv.y, extendB1)) {
|
|
126
116
|
this.recordPointWithLocalFractions(uv.x, cpA, fractionA0, fractionA1, uv.y, cpB, fractionB0, fractionB1, reversed);
|
|
127
117
|
}
|
|
128
118
|
}
|
|
@@ -134,14 +124,16 @@ class CurveCurveIntersectXYZ extends GeometryHandler_1.NullGeometryHandler {
|
|
|
134
124
|
this.computeSegmentSegment3D(cpA, extendA0, pointA0, fractionA0, pointA1, fractionA1, extendA1, cpB, extendB0, pointB0, fractionB0, pointB1, fractionB1, extendB1, reversed);
|
|
135
125
|
}
|
|
136
126
|
/**
|
|
137
|
-
* Create a plane whose normal is the "better" cross product: `vectorA.crossProduct(vectorB)` or
|
|
127
|
+
* Create a plane whose normal is the "better" cross product: `vectorA.crossProduct(vectorB)` or
|
|
128
|
+
* `vectorA.crossProduct(vectorC)`
|
|
138
129
|
* * The heuristic for "better" is:
|
|
139
|
-
* * first choice is cross product with `vectorB`, if `vectorA` and `vectorB` are sufficiently far from parallel
|
|
130
|
+
* * first choice is cross product with `vectorB`, if `vectorA` and `vectorB` are sufficiently far from parallel
|
|
131
|
+
* (or anti-parallel).
|
|
140
132
|
* * otherwise use vectorC
|
|
141
133
|
* @param origin plane origin
|
|
142
134
|
* @param vectorA vector which must be in the plane.
|
|
143
|
-
* @param cosineValue largest cosine of the angle theta between vectorA and vectorB to prefer their cross product,
|
|
144
|
-
*
|
|
135
|
+
* @param cosineValue largest cosine of the angle theta between vectorA and vectorB to prefer their cross product, e.g.
|
|
136
|
+
* passing 0.94 ~ cos(20deg) will switch to using vectorC in the cross product if theta < ~20deg or theta > ~160deg.
|
|
145
137
|
* @param vectorB first candidate for additional in-plane vector
|
|
146
138
|
* @param vectorC second candidate for additional in-plane vector
|
|
147
139
|
*/
|
|
@@ -239,7 +231,7 @@ class CurveCurveIntersectXYZ extends GeometryHandler_1.NullGeometryHandler {
|
|
|
239
231
|
// Caller accesses data from two arcs.
|
|
240
232
|
// Selects the best conditioned arc (in xy parts) as "circle after inversion"
|
|
241
233
|
// Solves the arc-arc equations
|
|
242
|
-
dispatchArcBsplineCurve3d(
|
|
234
|
+
dispatchArcBsplineCurve3d(_arc, _extendA, _cpB, _extendB, _reversed) {
|
|
243
235
|
/*
|
|
244
236
|
// Arc: X = C + cU + sV
|
|
245
237
|
// implicitize the arc as viewed. This "3d" matrix is homogeneous "XYW" not "xyz"
|
|
@@ -299,7 +291,7 @@ class CurveCurveIntersectXYZ extends GeometryHandler_1.NullGeometryHandler {
|
|
|
299
291
|
}
|
|
300
292
|
}
|
|
301
293
|
}
|
|
302
|
-
|
|
294
|
+
*/
|
|
303
295
|
}
|
|
304
296
|
/*
|
|
305
297
|
// apply the transformation to bezier curves. optionally construct ranges.
|
|
@@ -310,7 +302,7 @@ class CurveCurveIntersectXYZ extends GeometryHandler_1.NullGeometryHandler {
|
|
|
310
302
|
for (const bezier of beziers) bezier.tryMultiplyMatrix4dInPlace(this._worldToLocalPerspective);
|
|
311
303
|
}
|
|
312
304
|
}
|
|
313
|
-
|
|
305
|
+
*/
|
|
314
306
|
/*
|
|
315
307
|
private getRanges(beziers: BezierCurveBase[]): Range3d[] {
|
|
316
308
|
const ranges: Range3d[] = [];
|
|
@@ -338,23 +330,20 @@ class CurveCurveIntersectXYZ extends GeometryHandler_1.NullGeometryHandler {
|
|
|
338
330
|
if (!this._xyzwA1) this._xyzwA1 = Point4d.create();
|
|
339
331
|
if (!this._xyzwPlane) this._xyzwPlane = Point4d.create();
|
|
340
332
|
if (!this._xyzwB) this._xyzwB = Point4d.create();
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
}
|
|
356
|
-
}
|
|
357
|
-
*-/
|
|
333
|
+
const roots = univariateBezierG.roots(0.0, true);
|
|
334
|
+
if (roots) {
|
|
335
|
+
for (const root of roots) {
|
|
336
|
+
const fractionB = bezier.fractionToParentFraction(root);
|
|
337
|
+
// The univariate bezier (which has been transformed by the view transform) evaluates into xyw space
|
|
338
|
+
const bcurvePoint4d = bezier.fractionToPoint4d(root);
|
|
339
|
+
const c = bcurvePoint4d.dotProductXYZW(axx, axy, axz, axw);
|
|
340
|
+
const s = bcurvePoint4d.dotProductXYZW(ayx, ayy, ayz, ayw);
|
|
341
|
+
const arcFraction = cpA.sweep.radiansToSignedPeriodicFraction(Math.atan2(s, c));
|
|
342
|
+
if (this.acceptFraction(extendA, arcFraction, extendA) && this.acceptFraction(extendB, fractionB, extendB)) {
|
|
343
|
+
this.recordPointWithLocalFractions(arcFraction, cpA, 0, 1,
|
|
344
|
+
fractionB, cpB, 0, 1, reversed);
|
|
345
|
+
}
|
|
346
|
+
}
|
|
358
347
|
bezierA.fractionToPoint4d(0.0, this._xyzwA0);
|
|
359
348
|
let f0 = 0.0;
|
|
360
349
|
let f1 = 1.0;
|
|
@@ -382,10 +371,9 @@ class CurveCurveIntersectXYZ extends GeometryHandler_1.NullGeometryHandler {
|
|
|
382
371
|
bezierAFraction = newtonSearcher.getU();
|
|
383
372
|
bezierBFraction = newtonSearcher.getV();
|
|
384
373
|
}
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
// NEEDS WORK -- just accept . . .
|
|
374
|
+
// We have a near intersection at fractions on the two beziers !!!
|
|
375
|
+
// Iterate on the curves for a true intersection ....
|
|
376
|
+
// NEEDS WORK -- just accept . . .
|
|
389
377
|
const bcurveAFraction = bezierA.fractionToParentFraction(bezierAFraction);
|
|
390
378
|
const bcurveBFraction = bezierB.fractionToParentFraction(bezierBFraction);
|
|
391
379
|
const xyzA0 = bezierA.fractionToPoint(bezierAFraction);
|
|
@@ -408,38 +396,39 @@ class CurveCurveIntersectXYZ extends GeometryHandler_1.NullGeometryHandler {
|
|
|
408
396
|
}
|
|
409
397
|
}
|
|
410
398
|
}
|
|
411
|
-
|
|
399
|
+
*/
|
|
412
400
|
// Caller accesses data from two arcs.
|
|
413
401
|
// Selects the best conditioned arc (in xy parts) as "circle after inversion"
|
|
414
402
|
// Solves the arc-arc equations
|
|
415
403
|
dispatchBSplineCurve3dBSplineCurve3d(_bcurveA, _bcurveB, _reversed) {
|
|
416
404
|
/*
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
405
|
+
const bezierSpanA = bcurveA.collectBezierSpans(true) as BezierCurve3dH[];
|
|
406
|
+
const bezierSpanB = bcurveB.collectBezierSpans(true) as BezierCurve3dH[];
|
|
407
|
+
const numA = bezierSpanA.length;
|
|
408
|
+
const numB = bezierSpanB.length;
|
|
409
|
+
this.transformBeziers(bezierSpanA);
|
|
410
|
+
this.transformBeziers(bezierSpanB);
|
|
411
|
+
const rangeA = this.getRanges(bezierSpanA);
|
|
412
|
+
const rangeB = this.getRanges(bezierSpanB);
|
|
413
|
+
const orderA = bcurveA.order;
|
|
414
|
+
const orderB = bcurveB.order;
|
|
415
|
+
const univariateCoffsA = new UnivariateBezier(orderA);
|
|
416
|
+
const univariateCoffsB = new UnivariateBezier(orderB);
|
|
417
|
+
for (let a = 0; a < numA; a++) {
|
|
418
|
+
for (let b = 0; b < numB; b++) {
|
|
419
|
+
if (rangeA[a].intersectsRangeXY(rangeB[b])) {
|
|
420
|
+
const strokeCountA = bezierSpanA[a].computeStrokeCountForOptions();
|
|
421
|
+
const strokeCountB = bezierSpanB[b].computeStrokeCountForOptions();
|
|
422
|
+
if (strokeCountA < strokeCountB)
|
|
423
|
+
this.dispatchBezierBezierStrokeFirst(bezierSpanA[a], bcurveA, strokeCountA, bezierSpanB[b], bcurveB, strokeCountB, univariateCoffsB, !_reversed);
|
|
424
|
+
else
|
|
425
|
+
this.dispatchBezierBezierStrokeFirst(bezierSpanB[b], bcurveB, strokeCountB, bezierSpanA[a], bcurveA, strokeCountA, univariateCoffsA, _reversed);
|
|
426
|
+
}
|
|
438
427
|
}
|
|
439
428
|
}
|
|
440
|
-
|
|
441
|
-
*/
|
|
429
|
+
*/
|
|
442
430
|
}
|
|
431
|
+
/*
|
|
443
432
|
/**
|
|
444
433
|
* Apply the projection transform (if any) to (xyz, w)
|
|
445
434
|
* @param xyz xyz parts of input point.
|
|
@@ -467,7 +456,7 @@ class CurveCurveIntersectXYZ extends GeometryHandler_1.NullGeometryHandler {
|
|
|
467
456
|
npcPlane.clone(worldPlane);
|
|
468
457
|
}
|
|
469
458
|
}
|
|
470
|
-
|
|
459
|
+
*/
|
|
471
460
|
// Caller accesses data from segment and bsplineCurve
|
|
472
461
|
// Selects the best conditioned arc (in xy parts) as "circle after inversion"
|
|
473
462
|
// Solves the arc-arc equations
|
|
@@ -492,9 +481,9 @@ class CurveCurveIntersectXYZ extends GeometryHandler_1.NullGeometryHandler {
|
|
|
492
481
|
fractionB, bcurve, 0, 1, reversed);
|
|
493
482
|
}
|
|
494
483
|
}
|
|
495
|
-
|
|
484
|
+
*/
|
|
496
485
|
}
|
|
497
|
-
/**
|
|
486
|
+
/** Low level dispatch of linestring with (beziers of) a bspline curve */
|
|
498
487
|
dispatchLineStringBSplineCurve(_lsA, _extendA, _curveB, _extendB, _reversed) {
|
|
499
488
|
/*
|
|
500
489
|
const numA = lsA.numPoints();
|
|
@@ -515,9 +504,9 @@ class CurveCurveIntersectXYZ extends GeometryHandler_1.NullGeometryHandler {
|
|
|
515
504
|
}
|
|
516
505
|
}
|
|
517
506
|
return undefined;
|
|
518
|
-
|
|
507
|
+
*/
|
|
519
508
|
}
|
|
520
|
-
/**
|
|
509
|
+
/** Detail computation for segment intersecting linestring. */
|
|
521
510
|
computeSegmentLineString(lsA, extendA, lsB, extendB, reversed) {
|
|
522
511
|
const pointA0 = lsA.point0Ref;
|
|
523
512
|
const pointA1 = lsA.point1Ref;
|
|
@@ -538,7 +527,7 @@ class CurveCurveIntersectXYZ extends GeometryHandler_1.NullGeometryHandler {
|
|
|
538
527
|
}
|
|
539
528
|
return undefined;
|
|
540
529
|
}
|
|
541
|
-
/**
|
|
530
|
+
/** Detail computation for arc intersecting linestring. */
|
|
542
531
|
computeArcLineString(arcA, extendA, lsB, extendB, reversed) {
|
|
543
532
|
const pointB0 = CurveCurveIntersectXYZ._workPointBB0;
|
|
544
533
|
const pointB1 = CurveCurveIntersectXYZ._workPointBB1;
|
|
@@ -557,7 +546,7 @@ class CurveCurveIntersectXYZ extends GeometryHandler_1.NullGeometryHandler {
|
|
|
557
546
|
}
|
|
558
547
|
return undefined;
|
|
559
548
|
}
|
|
560
|
-
/**
|
|
549
|
+
/** Double dispatch handler for strongly typed segment. */
|
|
561
550
|
handleLineSegment3d(segmentA) {
|
|
562
551
|
if (this._geometryB instanceof LineSegment3d_1.LineSegment3d) {
|
|
563
552
|
const segmentB = this._geometryB;
|
|
@@ -588,9 +577,7 @@ class CurveCurveIntersectXYZ extends GeometryHandler_1.NullGeometryHandler {
|
|
|
588
577
|
const dfA = 1.0 / (numA - 1);
|
|
589
578
|
const dfB = 1.0 / (numB - 1);
|
|
590
579
|
let fA0 = 0.0;
|
|
591
|
-
let fB0;
|
|
592
|
-
let fA1;
|
|
593
|
-
let fB1;
|
|
580
|
+
let fA1, fB0, fB1;
|
|
594
581
|
const extendA = this._extendA;
|
|
595
582
|
const extendB = this._extendB;
|
|
596
583
|
lsA.pointAt(0, pointA0);
|
|
@@ -618,7 +605,7 @@ class CurveCurveIntersectXYZ extends GeometryHandler_1.NullGeometryHandler {
|
|
|
618
605
|
}
|
|
619
606
|
return undefined;
|
|
620
607
|
}
|
|
621
|
-
/**
|
|
608
|
+
/** Double dispatch handler for strongly typed arc. */
|
|
622
609
|
handleArc3d(arc0) {
|
|
623
610
|
if (this._geometryB instanceof LineSegment3d_1.LineSegment3d) {
|
|
624
611
|
this.dispatchSegmentArc(this._geometryB, this._extendB, this._geometryB.point0Ref, 0.0, this._geometryB.point1Ref, 1.0, this._extendB, arc0, this._extendA, this._extendA, true);
|
|
@@ -634,7 +621,7 @@ class CurveCurveIntersectXYZ extends GeometryHandler_1.NullGeometryHandler {
|
|
|
634
621
|
}
|
|
635
622
|
return undefined;
|
|
636
623
|
}
|
|
637
|
-
/**
|
|
624
|
+
/** Double dispatch handler for strongly typed bspline curve.. */
|
|
638
625
|
handleBSplineCurve3d(curve) {
|
|
639
626
|
if (this._geometryB instanceof LineSegment3d_1.LineSegment3d) {
|
|
640
627
|
this.dispatchSegmentBsplineCurve(this._geometryB, this._extendB, this._geometryB.point0Ref, 0.0, this._geometryB.point1Ref, 1.0, this._extendB, curve, this._extendA, true);
|
|
@@ -650,9 +637,11 @@ class CurveCurveIntersectXYZ extends GeometryHandler_1.NullGeometryHandler {
|
|
|
650
637
|
}
|
|
651
638
|
return undefined;
|
|
652
639
|
}
|
|
653
|
-
/**
|
|
640
|
+
/** Double dispatch handler for strongly typed homogeneous bspline curve. */
|
|
654
641
|
handleBSplineCurve3dH(_curve) {
|
|
655
|
-
/*
|
|
642
|
+
/*
|
|
643
|
+
// NEEDS WORK -- make "dispatch" methods tolerant of both 3d and 3dH
|
|
644
|
+
// "easy" if both present BezierCurve3dH span loaders
|
|
656
645
|
if (this._geometryB instanceof LineSegment3d) {
|
|
657
646
|
this.dispatchSegmentBsplineCurve(
|
|
658
647
|
this._geometryB, this._extendB, this._geometryB.point0Ref, 0.0, this._geometryB.point1Ref, 1.0, this._extendB,
|
|
@@ -662,7 +651,7 @@ class CurveCurveIntersectXYZ extends GeometryHandler_1.NullGeometryHandler {
|
|
|
662
651
|
} else if (this._geometryB instanceof Arc3d) {
|
|
663
652
|
this.dispatchArcBsplineCurve3d(this._geometryB, this._extendB, curve, this._extendA, true);
|
|
664
653
|
}
|
|
665
|
-
|
|
654
|
+
*/
|
|
666
655
|
return undefined;
|
|
667
656
|
}
|
|
668
657
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CurveCurveIntersectXYZ.js","sourceRoot":"","sources":["../../../src/curve/CurveCurveIntersectXYZ.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;;;AAE/F;;GAEG;AAEH,0DAA6E;AAK7E,0CAAuC;AACvC,mEAAoE;AACpE,6FAA0F;AAC1F,mCAAmC;AACnC,mEAAyD;AACzD,mDAAmD;AACnD,mEAAkE;AAClE,iDAAiD;AACjD,yDAAsE;AACtE,mDAAmD;AACnD,uDAAuD;AACvD,qDAAqD;AACrD,mCAAgC;AAChC,iDAAiD;AACjD,mEAAuE;AACvE,+DAA+E;AAG/E,mDAAgD;AAChD,iDAA8C;AAE9C,mBAAmB;AACnB;;;;;;;;GAQG;AACH,MAAa,sBAAuB,SAAQ,qCAAmB;IAMrD,YAAY;QAClB,IAAI,CAAC,QAAQ,GAAG,IAAI,oDAA4B,EAAE,CAAC;IACrD,CAAC;IACD;;;;;;OAMG;IACH,YAAmB,UAAyB,EAAE,OAAgB,EAAE,SAAwB,EAAE,OAAgB;QACxG,KAAK,EAAE,CAAC;QACR,+BAA+B;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AAE,IAAI,CAAC,CAAC;SACjG;aAAM,IAAI,IAAI,CAAC,UAAU,YAAY,aAAK,EAAE;YAC3C,IAAI,CAAC,yBAAyB,CAAC,IAAI,CAAC,UAAU,EAAE,IAAI,CAAC,QAAQ,EAAE,KAAK,EAAE,IAAI,CAAC,QAAQ,EAAE,IAAI,CAAC,CAAC;SAC5F;aAAM,IAAI,IAAI,CAAC,UAAU,YAAY,iCAAkB,EAAE;YACxD,IAAI,CAAC,oCAAoC,CAAC,KAAK,EAAE,IAAI,CAAC,UAAU,EAAE,KAAK,CAAC,CAAC;SAC1E;QACD,OAAO,SAAS,CAAC;IACnB,CAAC;IACD,4EAA4E;IAC5D,qBAAqB,CAAC,MAAuB;QAC3D;;;;;;;;;;WAUG;QACH,OAAO,SAAS,CAAC;IACnB,CAAC;;AA/sBc,qCAAc,GAAG,0BAAQ,CAAC,MAAM,EAAE,CAAC;AAshBnC,oCAAa,GAAG,yBAAO,CAAC,MAAM,EAAE,CAAC;AACjC,oCAAa,GAAG,yBAAO,CAAC,MAAM,EAAE,CAAC;AACjC,oCAAa,GAAG,yBAAO,CAAC,MAAM,EAAE,CAAC;AACjC,oCAAa,GAAG,yBAAO,CAAC,MAAM,EAAE,CAAC;AA7jBrC,wDAAsB","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n\r\n/** @packageDocumentation\r\n * @module Curve\r\n */\r\n\r\nimport { BSplineCurve3d, BSplineCurve3dBase } from \"../bspline/BSplineCurve\";\r\n// import { BezierCurveBase } from \"../bspline/BezierCurveBase\";\r\n// import { BezierCurve3dH } from \"../bspline/BezierCurve3dH\";\r\n// import { UnivariateBezier } from \"../numerics/BezierPolynomials\";\r\nimport { BSplineCurve3dH } from \"../bspline/BSplineCurve3dH\";\r\nimport { Geometry } from \"../Geometry\";\r\nimport { NullGeometryHandler } from \"../geometry3d/GeometryHandler\";\r\nimport { Plane3dByOriginAndUnitNormal } from \"../geometry3d/Plane3dByOriginAndUnitNormal\";\r\n// import { Arc3d } from \"./Arc3d\";\r\nimport { Vector2d } from \"../geometry3d/Point2dVector2d\";\r\n// import { XYAndZ } from \"../geometry3d/XYZProps\";\r\nimport { Point3d, Vector3d } from \"../geometry3d/Point3dVector3d\";\r\n// import { LineString3d } from \"./LineString3d\";\r\nimport { SmallSystem, TrigPolynomial } from \"../numerics/Polynomials\";\r\n// import { Point4d } from \"../geometry4d/Point4d\";\r\n// import { Transform } from \"../geometry3d/Transform\";\r\n// import { Matrix3d } from \"../geometry3d/Matrix3d\";\r\nimport { Arc3d } from \"./Arc3d\";\r\n// import { Range3d } from \"../geometry3d/Range\";\r\nimport { CurveLocationDetailArrayPair } from \"./CurveCurveIntersectXY\";\r\nimport { CurveIntervalRole, CurveLocationDetail } from \"./CurveLocationDetail\";\r\nimport { CurvePrimitive } from \"./CurvePrimitive\";\r\nimport { GeometryQuery } from \"./GeometryQuery\";\r\nimport { LineSegment3d } from \"./LineSegment3d\";\r\nimport { LineString3d } from \"./LineString3d\";\r\n\r\n// cspell:word XYRR\r\n/**\r\n * * Handler class for XYZ intersections.\r\n * * Instances are initialized and called from CurveCurve.\r\n * * Constructor is told two geometry items A and B\r\n * * geometryB is saved for later reference\r\n * * type-specific handler methods will \"see\" geometry A repeatedly.\r\n * * Hence geometryA is NOT saved by the constructor.\r\n * @internal\r\n */\r\nexport class CurveCurveIntersectXYZ extends NullGeometryHandler {\r\n // private geometryA: GeometryQuery; // nb never used -- passed through handlers.\r\n private _extendA: boolean;\r\n private _geometryB: GeometryQuery;\r\n private _extendB: boolean;\r\n private _results!: CurveLocationDetailArrayPair;\r\n private reinitialize() {\r\n this._results = new CurveLocationDetailArrayPair();\r\n }\r\n /**\r\n *\r\n * @param _geometryA first curve for intersection. This is NOT saved.\r\n * @param extendA flag to enable using extension of geometryA.\r\n * @param geometryB second curve for intersection. Saved for reference by specific handler methods.\r\n * @param extendB flag for extension of geometryB.\r\n */\r\n public constructor(_geometryA: GeometryQuery, extendA: boolean, geometryB: GeometryQuery, extendB: boolean) {\r\n super();\r\n // this.geometryA = _geometryA;\r\n this._extendA = extendA;\r\n this._geometryB = geometryB;\r\n this._extendB = extendB;\r\n this.reinitialize();\r\n }\r\n /**\r\n * * Return the results structure for the intersection calculation.\r\n * @param reinitialize if true, a new results structure is created for use by later calls.\r\n *\r\n */\r\n public grabResults(reinitialize: boolean = false): CurveLocationDetailArrayPair {\r\n const result = this._results;\r\n if (reinitialize)\r\n this.reinitialize();\r\n return result;\r\n }\r\n\r\n private static _workVector2dA = Vector2d.create();\r\n\r\n private acceptFraction(extend0: boolean, fraction: number, extend1: boolean) {\r\n if (!extend0 && fraction < 0.0)\r\n return false;\r\n if (!extend1 && fraction > 1.0)\r\n return false;\r\n return true;\r\n }\r\n\r\n /** compute intersection of two line segments.\r\n * filter by extension rules.\r\n * reject if evaluated points do not match coordinates (e.g. close approach point)\r\n * record with fraction mapping.\r\n */\r\n private recordPointWithLocalFractions(\r\n localFractionA: number,\r\n cpA: CurvePrimitive,\r\n fractionA0: number,\r\n fractionA1: number,\r\n localFractionB: number, // Computed intersection fraction\r\n cpB: CurvePrimitive,\r\n fractionB0: number,\r\n fractionB1: number,\r\n reversed: boolean,\r\n ) {\r\n const globalFractionA = Geometry.interpolate(fractionA0, localFractionA, fractionA1);\r\n const globalFractionB = Geometry.interpolate(fractionB0, localFractionB, fractionB1);\r\n // ignore duplicate of most recent point . ..\r\n const numPrevious = this._results.dataA.length;\r\n if (numPrevious > 0) {\r\n const topFractionA = this._results.dataA[numPrevious - 1].fraction;\r\n const topFractionB = this._results.dataB[numPrevious - 1].fraction;\r\n if (reversed) {\r\n if (Geometry.isAlmostEqualNumber(topFractionA, globalFractionB) && Geometry.isAlmostEqualNumber(topFractionB, globalFractionA))\r\n return;\r\n } else {\r\n if (Geometry.isAlmostEqualNumber(topFractionA, globalFractionA) && Geometry.isAlmostEqualNumber(topFractionB, globalFractionB))\r\n return;\r\n }\r\n }\r\n const pointA = cpA.fractionToPoint(globalFractionA);\r\n const pointB = cpB.fractionToPoint(globalFractionB);\r\n if (!pointA.isAlmostEqualMetric(pointB))\r\n return;\r\n\r\n const detailA = CurveLocationDetail.createCurveFractionPoint(cpA,\r\n globalFractionA, pointA);\r\n detailA.setIntervalRole(CurveIntervalRole.isolated);\r\n const detailB = CurveLocationDetail.createCurveFractionPoint(cpB,\r\n globalFractionB, pointB);\r\n detailB.setIntervalRole(CurveIntervalRole.isolated);\r\n if (reversed) {\r\n this._results.dataA.push(detailB);\r\n this._results.dataB.push(detailA);\r\n } else {\r\n this._results.dataA.push(detailA);\r\n this._results.dataB.push(detailB);\r\n }\r\n }\r\n /** compute intersection of two line segments.\r\n * filter by extension rules.\r\n * record with fraction mapping.\r\n */\r\n private computeSegmentSegment3D(\r\n cpA: CurvePrimitive,\r\n extendA0: boolean,\r\n pointA0: Point3d,\r\n fractionA0: number,\r\n pointA1: Point3d,\r\n fractionA1: number,\r\n extendA1: boolean,\r\n cpB: CurvePrimitive,\r\n extendB0: boolean,\r\n pointB0: Point3d,\r\n fractionB0: number,\r\n pointB1: Point3d,\r\n fractionB1: number,\r\n extendB1: boolean,\r\n reversed: boolean,\r\n ) {\r\n const uv = CurveCurveIntersectXYZ._workVector2dA;\r\n if (SmallSystem.lineSegment3dClosestApproachUnbounded(\r\n pointA0, pointA1,\r\n pointB0, pointB1, uv)\r\n && this.acceptFraction(extendA0, uv.x, extendA1)\r\n && this.acceptFraction(extendB0, uv.y, extendB1)\r\n ) {\r\n this.recordPointWithLocalFractions(uv.x, cpA, fractionA0, fractionA1, uv.y, cpB, fractionB0, fractionB1, reversed);\r\n }\r\n }\r\n // Caller accesses data from a line segment and passes to here.\r\n // (The line segment in question might be (a) a full line segment or (b) a fragment within a linestring. The fraction and extend parameters\r\n // allow all combinations to be passed in)\r\n // This method applies transform.\r\n private dispatchSegmentSegment(\r\n cpA: CurvePrimitive,\r\n extendA0: boolean,\r\n pointA0: Point3d,\r\n fractionA0: number,\r\n pointA1: Point3d,\r\n fractionA1: number,\r\n extendA1: boolean,\r\n cpB: CurvePrimitive,\r\n extendB0: boolean,\r\n pointB0: Point3d,\r\n fractionB0: number,\r\n pointB1: Point3d,\r\n fractionB1: number,\r\n extendB1: boolean,\r\n reversed: boolean,\r\n ) {\r\n this.computeSegmentSegment3D(\r\n cpA, extendA0, pointA0, fractionA0, pointA1, fractionA1, extendA1,\r\n cpB, extendB0, pointB0, fractionB0, pointB1, fractionB1, extendB1,\r\n reversed);\r\n }\r\n /**\r\n * Create a plane whose normal is the \"better\" cross product: `vectorA.crossProduct(vectorB)` or `vectorA.crossProduct(vectorC)`\r\n * * The heuristic for \"better\" is:\r\n * * first choice is cross product with `vectorB`, if `vectorA` and `vectorB` are sufficiently far from parallel (or anti-parallel).\r\n * * otherwise use vectorC\r\n * @param origin plane origin\r\n * @param vectorA vector which must be in the plane.\r\n * @param cosineValue largest cosine of the angle theta between vectorA and vectorB to prefer their cross product,\r\n * e.g. passing 0.94 ~ cos(20deg) will switch to using vectorC in the cross product if theta < ~20deg or theta > ~160deg.\r\n * @param vectorB first candidate for additional in-plane vector\r\n * @param vectorC second candidate for additional in-plane vector\r\n */\r\n public createPlaneWithPreferredPerpendicular(origin: Point3d, vectorA: Vector3d, cosineValue: number, vectorB: Vector3d, vectorC: Vector3d): Plane3dByOriginAndUnitNormal | undefined {\r\n cosineValue = Geometry.restrictToInterval(Math.abs(cosineValue), 0.0, 1.0 - Geometry.smallFraction);\r\n const dotAA = vectorA.magnitudeSquared();\r\n const dotBB = vectorB.magnitudeSquared();\r\n const dotAB = Math.abs(vectorA.dotProduct(vectorB));\r\n const cross = vectorA.unitCrossProduct(dotAB * dotAB <= cosineValue * cosineValue * dotAA * dotBB ? vectorB : vectorC);\r\n if (cross)\r\n return Plane3dByOriginAndUnitNormal.create(origin, cross);\r\n return undefined;\r\n }\r\n // Caller accesses data from a linestring or segment and passes it here.\r\n // (The line segment in question might be (a) a full line segment or (b) a fragment within a linestring. The fraction and extend parameters\r\n // allow all combinations to be passed in)\r\n private dispatchSegmentArc(\r\n cpA: CurvePrimitive,\r\n extendA0: boolean,\r\n pointA0: Point3d,\r\n fractionA0: number,\r\n pointA1: Point3d,\r\n fractionA1: number,\r\n extendA1: boolean,\r\n arc: Arc3d,\r\n extendB0: boolean,\r\n extendB1: boolean,\r\n reversed: boolean,\r\n ) {\r\n const lineVector = Vector3d.createStartEnd(pointA0, pointA1);\r\n const plane = this.createPlaneWithPreferredPerpendicular(pointA0, lineVector, 0.94, arc.perpendicularVector, arc.vector0);\r\n if (plane !== undefined) {\r\n const candidates: CurveLocationDetail[] = [];\r\n arc.appendPlaneIntersectionPoints(plane, candidates);\r\n let lineFraction;\r\n let linePoint: Point3d | undefined;\r\n for (const c of candidates) {\r\n if (this.acceptFraction(extendB0, c.fraction, extendB1)) {\r\n lineFraction = SmallSystem.lineSegment3dClosestPointUnbounded(pointA0, pointA1, c.point);\r\n if (lineFraction !== undefined) {\r\n linePoint = pointA0.interpolate(lineFraction, pointA1, linePoint);\r\n if (linePoint.isAlmostEqualMetric(c.point)\r\n && this.acceptFraction(extendA0, lineFraction, extendA1)) {\r\n this.recordPointWithLocalFractions(lineFraction, cpA, fractionA0, fractionA1,\r\n c.fraction, arc, 0, 1, reversed);\r\n\r\n }\r\n }\r\n }\r\n }\r\n }\r\n }\r\n\r\n // Caller promises arcs are coplanar.\r\n // Passes \"other\" as {center, vector0, vector90} in local xy space of cpA\r\n // Solves the arc-arc equations for that local ellipse with unit circle.\r\n // Solution fractions map directly to original arcs.\r\n private dispatchArcArcInPlane(\r\n cpA: Arc3d,\r\n extendA: boolean,\r\n cpB: Arc3d,\r\n extendB: boolean,\r\n reversed: boolean,\r\n ) {\r\n const otherVectors = cpA.otherArcAsLocalVectors(cpB);\r\n if (otherVectors !== undefined) {\r\n const ellipseRadians: number[] = [];\r\n const circleRadians: number[] = [];\r\n TrigPolynomial.solveUnitCircleHomogeneousEllipseIntersection(\r\n otherVectors.center.x, otherVectors.center.y, 1.0,\r\n otherVectors.vector0.x, otherVectors.vector0.y, 0.0,\r\n otherVectors.vector90.x, otherVectors.vector90.y, 0.0,\r\n ellipseRadians, circleRadians);\r\n for (let i = 0; i < ellipseRadians.length; i++) {\r\n const fractionA = cpA.sweep.radiansToSignedPeriodicFraction(circleRadians[i]);\r\n const fractionB = cpA.sweep.radiansToSignedPeriodicFraction(ellipseRadians[i]);\r\n // hm .. do we really need to check the fractions? We know they are internal to the beziers\r\n if (this.acceptFraction(extendA, fractionA, extendA) && this.acceptFraction(extendB, fractionB, extendB)) {\r\n this.recordPointWithLocalFractions(fractionA, cpA, 0, 1,\r\n fractionB, cpB, 0, 1, reversed);\r\n }\r\n }\r\n }\r\n }\r\n // Caller accesses data from two arcs.\r\n // Selects the best conditioned arc (in xy parts) as \"circle after inversion\"\r\n // Solves the arc-arc equations\r\n private dispatchArcArc(\r\n cpA: Arc3d,\r\n extendA: boolean,\r\n cpB: Arc3d,\r\n extendB: boolean,\r\n reversed: boolean,\r\n ) {\r\n // If arcs are in different planes:\r\n // 1) Intersect each plane with the other arc (quadratic)\r\n // 2) accept points that appear in both intersection sets.\r\n // If arcs are in parallel planes -- no intersections\r\n // If arcs are in the same plane -- xy intersection in that plane.\r\n const planeA = Plane3dByOriginAndUnitNormal.create(cpA.center, cpA.perpendicularVector);\r\n const planeB = Plane3dByOriginAndUnitNormal.create(cpB.center, cpB.perpendicularVector);\r\n if (planeA === undefined || planeB === undefined)\r\n return;\r\n\r\n if (planeA.getNormalRef().isParallelTo(planeB.getNormalRef())) {\r\n if (planeA.isPointInPlane(planeB.getOriginRef()) && planeB.isPointInPlane(planeA.getOriginRef())) {\r\n // coplanar !!!\r\n this.dispatchArcArcInPlane(cpA, extendA, cpB, extendB, reversed);\r\n }\r\n } else {\r\n const arcBPoints: CurveLocationDetail[] = [];\r\n cpB.appendPlaneIntersectionPoints(planeA, arcBPoints);\r\n const arcAPoints: CurveLocationDetail[] = [];\r\n cpA.appendPlaneIntersectionPoints(planeB, arcAPoints);\r\n for (const detailB of arcBPoints) {\r\n for (const detailA of arcAPoints) {\r\n if (detailA.point.isAlmostEqual(detailB.point)) {\r\n if (this.acceptFraction(extendA, detailA.fraction, extendA)\r\n && this.acceptFraction(extendB, detailB.fraction, extendB)) {\r\n this.recordPointWithLocalFractions(detailA.fraction, cpA, 0, 1,\r\n detailB.fraction, cpB, 0, 1, reversed);\r\n }\r\n }\r\n }\r\n }\r\n }\r\n }\r\n // Caller accesses data from two arcs.\r\n // Selects the best conditioned arc (in xy parts) as \"circle after inversion\"\r\n // Solves the arc-arc equations\r\n private dispatchArcBsplineCurve3d(\r\n _: Arc3d,\r\n _extendA: boolean,\r\n _cpB: BSplineCurve3d,\r\n _extendB: boolean,\r\n _reversed: boolean,\r\n ) {\r\n /*\r\n // Arc: X = C + cU + sV\r\n // implicitize the arc as viewed. This \"3d\" matrix is homogeneous \"XYW\" not \"xyz\"\r\n let matrixA: Matrix3d;\r\n if (this._worldToLocalPerspective) {\r\n const dataA = cpA.toTransformedPoint4d(this._worldToLocalPerspective);\r\n matrixA = Matrix3d.createColumnsXYW(dataA.vector0, dataA.vector0.w, dataA.vector90, dataA.vector90.w, dataA.center, dataA.center.w);\r\n } else {\r\n const dataA = cpA.toTransformedVectors(this._worldToLocalAffine);\r\n matrixA = Matrix3d.createColumnsXYW(dataA.vector0, 0, dataA.vector90, 0, dataA.center, 1);\r\n }\r\n // The worldToLocal has moved the arc vectors into local space.\r\n // matrixA captures the xyw parts (ignoring z)\r\n // for any point in world space,\r\n // THIS CODE ONLY WORKS FOR\r\n const matrixAInverse = matrixA.inverse();\r\n if (matrixAInverse) {\r\n const orderF = cpB.order; // order of the beziers for simple coordinates\r\n const orderG = 2 * orderF - 1; // order of the (single) bezier for squared coordinates.\r\n const coffF = new Float64Array(orderF);\r\n const univariateBezierG = new UnivariateBezier(orderG);\r\n const axx = matrixAInverse.at(0, 0); const axy = matrixAInverse.at(0, 1); const axz = 0.0; const axw = matrixAInverse.at(0, 2);\r\n const ayx = matrixAInverse.at(1, 0); const ayy = matrixAInverse.at(1, 1); const ayz = 0.0; const ayw = matrixAInverse.at(1, 2);\r\n const awx = matrixAInverse.at(2, 0); const awy = matrixAInverse.at(2, 1); const awz = 0.0; const aww = matrixAInverse.at(2, 2);\r\n\r\n if (matrixAInverse) {\r\n let bezier: BezierCurve3dH | undefined;\r\n for (let spanIndex = 0; ; spanIndex++) {\r\n bezier = cpB.getSaturatedBezierSpan3dH(spanIndex, bezier);\r\n if (!bezier) break;\r\n if (this._worldToLocalPerspective)\r\n bezier.tryMultiplyMatrix4dInPlace(this._worldToLocalPerspective);\r\n else if (this._worldToLocalAffine)\r\n bezier.tryTransformInPlace(this._worldToLocalAffine);\r\n univariateBezierG.zero();\r\n bezier.poleProductsXYZW(coffF, axx, axy, axz, axw);\r\n univariateBezierG.addSquaredSquaredBezier(coffF, 1.0);\r\n bezier.poleProductsXYZW(coffF, ayx, ayy, ayz, ayw);\r\n univariateBezierG.addSquaredSquaredBezier(coffF, 1.0);\r\n bezier.poleProductsXYZW(coffF, awx, awy, awz, aww);\r\n univariateBezierG.addSquaredSquaredBezier(coffF, -1.0);\r\n const roots = univariateBezierG.roots(0.0, true);\r\n if (roots) {\r\n for (const root of roots) {\r\n const fractionB = bezier.fractionToParentFraction(root);\r\n // The univariate bezier (which has been transformed by the view transform) evaluates into xyw space\r\n const bcurvePoint4d = bezier.fractionToPoint4d(root);\r\n const c = bcurvePoint4d.dotProductXYZW(axx, axy, axz, axw);\r\n const s = bcurvePoint4d.dotProductXYZW(ayx, ayy, ayz, ayw);\r\n const arcFraction = cpA.sweep.radiansToSignedPeriodicFraction(Math.atan2(s, c));\r\n if (this.acceptFraction(extendA, arcFraction, extendA) && this.acceptFraction(extendB, fractionB, extendB)) {\r\n this.recordPointWithLocalFractions(arcFraction, cpA, 0, 1,\r\n fractionB, cpB, 0, 1, reversed);\r\n }\r\n }\r\n }\r\n }\r\n }\r\n }\r\n */\r\n }\r\n /*\r\n // apply the transformation to bezier curves. optionally construct ranges.\r\n private transformBeziers(beziers: BezierCurve3dH[]) {\r\n if (this._worldToLocalAffine) {\r\n for (const bezier of beziers) bezier.tryTransformInPlace(this._worldToLocalAffine);\r\n } else if (this._worldToLocalPerspective) {\r\n for (const bezier of beziers) bezier.tryMultiplyMatrix4dInPlace(this._worldToLocalPerspective);\r\n }\r\n }\r\n */\r\n /*\r\n private getRanges(beziers: BezierCurveBase[]): Range3d[] {\r\n const ranges: Range3d[] = [];\r\n ranges.length = 0;\r\n for (const b of beziers) {\r\n ranges.push(b.range());\r\n }\r\n return ranges;\r\n }\r\n private _xyzwA0?: Point4d;\r\n private _xyzwA1?: Point4d;\r\n private _xyzwPlane?: Point4d;\r\n private _xyzwB?: Point4d;\r\n\r\n private dispatchBezierBezierStrokeFirst(\r\n bezierA: BezierCurve3dH,\r\n bcurveA: BSplineCurve3dBase,\r\n strokeCountA: number,\r\n bezierB: BezierCurve3dH,\r\n bcurveB: BSplineCurve3dBase,\r\n _strokeCountB: number,\r\n univariateBezierB: UnivariateBezier, // caller-allocated for univariate coefficients.\r\n reversed: boolean) {\r\n if (!this._xyzwA0) this._xyzwA0 = Point4d.create();\r\n if (!this._xyzwA1) this._xyzwA1 = Point4d.create();\r\n if (!this._xyzwPlane) this._xyzwPlane = Point4d.create();\r\n if (!this._xyzwB) this._xyzwB = Point4d.create();\r\n /-*\r\n\r\n const roots = univariateBezierG.roots(0.0, true);\r\n if (roots) {\r\n for (const root of roots) {\r\n const fractionB = bezier.fractionToParentFraction(root);\r\n // The univariate bezier (which has been transformed by the view transform) evaluates into xyw space\r\n const bcurvePoint4d = bezier.fractionToPoint4d(root);\r\n const c = bcurvePoint4d.dotProductXYZW(axx, axy, axz, axw);\r\n const s = bcurvePoint4d.dotProductXYZW(ayx, ayy, ayz, ayw);\r\n const arcFraction = cpA.sweep.radiansToSignedPeriodicFraction(Math.atan2(s, c));\r\n if (this.acceptFraction(extendA, arcFraction, extendA) && this.acceptFraction(extendB, fractionB, extendB)) {\r\n this.recordPointWithLocalFractions(arcFraction, cpA, 0, 1,\r\n fractionB, cpB, 0, 1, reversed);\r\n }\r\n }\r\n *-/\r\n bezierA.fractionToPoint4d(0.0, this._xyzwA0);\r\n let f0 = 0.0;\r\n let f1 = 1.0;\r\n const intervalTolerance = 1.0e-5;\r\n const df = 1.0 / strokeCountA;\r\n for (let i = 1; i <= strokeCountA; i++ , f0 = f1, this._xyzwA0.setFrom(this._xyzwA1)) {\r\n f1 = i * df;\r\n bezierA.fractionToPoint4d(f1, this._xyzwA1);\r\n Point4d.createPlanePointPointZ(this._xyzwA0, this._xyzwA1, this._xyzwPlane);\r\n bezierB.poleProductsXYZW(univariateBezierB.coffs, this._xyzwPlane.x, this._xyzwPlane.y, this._xyzwPlane.z, this._xyzwPlane.w);\r\n let errors = 0;\r\n const roots = univariateBezierB.roots(0.0, true);\r\n if (roots)\r\n for (const r of roots) {\r\n const bezierBFraction = r;\r\n bezierB.fractionToPoint4d(bezierBFraction, this._xyzwB);\r\n const segmentAFraction = SmallSystem.lineSegment3dHXYClosestPointUnbounded(this._xyzwA0, this._xyzwA1, this._xyzwB);\r\n if (segmentAFraction && Geometry.isIn01WithTolerance(segmentAFraction, intervalTolerance)) {\r\n const bezierAFraction = Geometry.interpolate(f0, segmentAFraction, f1);\r\n /*- TODO implement newton search\r\n const xyMatchingFunction = new BezierBezierIntersectionXYRRToRRD(bezierA, bezierB);\r\n const newtonSearcher = new Newton2dUnboundedWithDerivative(xyMatchingFunction);\r\n newtonSearcher.setUV(bezierAFraction, bezierBFraction);\r\n if (newtonSearcher.runIterations()) {\r\n bezierAFraction = newtonSearcher.getU();\r\n bezierBFraction = newtonSearcher.getV();\r\n }\r\n *-/\r\n // We have a near intersection at fractions on the two beziers !!!\r\n // Iterate on the curves for a true intersection ....\r\n // NEEDS WORK -- just accept . . .\r\n const bcurveAFraction = bezierA.fractionToParentFraction(bezierAFraction);\r\n const bcurveBFraction = bezierB.fractionToParentFraction(bezierBFraction);\r\n const xyzA0 = bezierA.fractionToPoint(bezierAFraction);\r\n const xyzA1 = bcurveA.fractionToPoint(bcurveAFraction);\r\n const xyzB0 = bezierB.fractionToPoint(bezierBFraction);\r\n const xyzB1 = bcurveB.fractionToPoint(bcurveBFraction);\r\n if (!xyzA0.isAlmostEqualXY(xyzA1))\r\n errors++;\r\n if (!xyzB0.isAlmostEqualXY(xyzB1))\r\n errors++;\r\n if (errors > 0 && !xyzA0.isAlmostEqual(xyzB0))\r\n errors++;\r\n if (errors > 0 && !xyzA1.isAlmostEqual(xyzB1))\r\n errors++;\r\n if (this.acceptFraction(false, bcurveAFraction, false) && this.acceptFraction(false, bcurveBFraction, false)) {\r\n this.recordPointWithLocalFractions(bcurveAFraction, bcurveA, 0, 1,\r\n bcurveBFraction, bcurveB, 0, 1, reversed);\r\n }\r\n }\r\n }\r\n }\r\n }\r\n */\r\n\r\n // Caller accesses data from two arcs.\r\n // Selects the best conditioned arc (in xy parts) as \"circle after inversion\"\r\n // Solves the arc-arc equations\r\n private dispatchBSplineCurve3dBSplineCurve3d(\r\n _bcurveA: BSplineCurve3dBase,\r\n _bcurveB: BSplineCurve3dBase,\r\n _reversed: boolean) {\r\n /*\r\n const bezierSpanA = bcurveA.collectBezierSpans(true) as BezierCurve3dH[];\r\n const bezierSpanB = bcurveB.collectBezierSpans(true) as BezierCurve3dH[];\r\n const numA = bezierSpanA.length;\r\n const numB = bezierSpanB.length;\r\n this.transformBeziers(bezierSpanA);\r\n this.transformBeziers(bezierSpanB);\r\n const rangeA = this.getRanges(bezierSpanA);\r\n const rangeB = this.getRanges(bezierSpanB);\r\n const orderA = bcurveA.order;\r\n const orderB = bcurveB.order;\r\n const univariateCoffsA = new UnivariateBezier(orderA);\r\n const univariateCoffsB = new UnivariateBezier(orderB);\r\n for (let a = 0; a < numA; a++) {\r\n for (let b = 0; b < numB; b++) {\r\n if (rangeA[a].intersectsRangeXY(rangeB[b])) {\r\n const strokeCountA = bezierSpanA[a].computeStrokeCountForOptions();\r\n const strokeCountB = bezierSpanB[b].computeStrokeCountForOptions();\r\n if (strokeCountA < strokeCountB)\r\n this.dispatchBezierBezierStrokeFirst(bezierSpanA[a], bcurveA, strokeCountA, bezierSpanB[b], bcurveB, strokeCountB, univariateCoffsB, !_reversed);\r\n else\r\n this.dispatchBezierBezierStrokeFirst(bezierSpanB[b], bcurveB, strokeCountB, bezierSpanA[a], bcurveA, strokeCountA, univariateCoffsA, _reversed);\r\n }\r\n }\r\n }\r\n */\r\n }\r\n\r\n /**\r\n * Apply the projection transform (if any) to (xyz, w)\r\n * @param xyz xyz parts of input point.\r\n * @param w weight to use for homogeneous effects\r\n */\r\n /*\r\n private projectPoint(xyz: XYAndZ, w: number = 1.0): Point4d {\r\n if (this._worldToLocalPerspective)\r\n return this._worldToLocalPerspective.multiplyPoint3d(xyz, w);\r\n if (this._worldToLocalAffine)\r\n return this._worldToLocalAffine.multiplyXYZW(xyz.x, xyz.y, xyz.z, w);\r\n return Point4d.createFromPointAndWeight(xyz, w);\r\n }\r\n private mapNPCPlaneToWorld(npcPlane: Point4d, worldPlane: Point4d) {\r\n // for NPC pointY, Y^ * H = 0 is \"on\" plane H. (Hat is transpose)\r\n // NPC Y is A*X for our transform A and worldPointX.\r\n // hence (A X)^ * H = 0\r\n // hence X^ * A^ * H = 0\r\n // hence K = A^ * H\r\n if (this._worldToLocalAffine) {\r\n this._worldToLocalAffine.multiplyTransposeXYZW(npcPlane.x, npcPlane.y, npcPlane.z, npcPlane.w, worldPlane);\r\n } else if (this._worldToLocalPerspective) {\r\n this._worldToLocalPerspective.multiplyTransposePoint4d(npcPlane, worldPlane);\r\n } else {\r\n npcPlane.clone(worldPlane);\r\n }\r\n }\r\n */\r\n // Caller accesses data from segment and bsplineCurve\r\n // Selects the best conditioned arc (in xy parts) as \"circle after inversion\"\r\n // Solves the arc-arc equations\r\n private dispatchSegmentBsplineCurve(\r\n _cpA: CurvePrimitive,\r\n _extendA0: boolean,\r\n _pointA0: Point3d,\r\n _fractionA0: number,\r\n _pointA1: Point3d,\r\n _fractionA1: number,\r\n _extendA1: boolean,\r\n _bcurve: BSplineCurve3d,\r\n _extendB: boolean,\r\n _reversed: boolean,\r\n ) {\r\n /*\r\n const pointA0H = this.projectPoint(pointA0);\r\n const pointA1H = this.projectPoint(pointA1);\r\n const planeCoffs = Point4d.createPlanePointPointZ(pointA0H, pointA1H);\r\n this.mapNPCPlaneToWorld(planeCoffs, planeCoffs);\r\n // NOW .. we have a plane in world space. Intersect it with the bspline:\r\n const intersections: CurveLocationDetail[] = [];\r\n bcurve.appendPlaneIntersectionPoints(planeCoffs, intersections);\r\n // intersections has WORLD points with bspline fractions. (The bspline fractions are all good 0..1 fractions within the spline.)\r\n // accept those that are within the segment range.\r\n for (const detail of intersections) {\r\n const fractionB = detail.fraction;\r\n const curvePoint = detail.point;\r\n const curvePointH = this.projectPoint(curvePoint);\r\n const lineFraction = SmallSystem.lineSegment3dHXYClosestPointUnbounded(pointA0H, pointA1H, curvePointH);\r\n if (lineFraction !== undefined && this.acceptFraction(extendA0, lineFraction, extendA1) && this.acceptFraction(extendB, fractionB, extendB)) {\r\n this.recordPointWithLocalFractions(lineFraction, cpA, fractionA0, fractionA1,\r\n fractionB, bcurve, 0, 1, reversed);\r\n }\r\n }\r\n */\r\n }\r\n\r\n private static _workPointAA0 = Point3d.create();\r\n private static _workPointAA1 = Point3d.create();\r\n private static _workPointBB0 = Point3d.create();\r\n private static _workPointBB1 = Point3d.create();\r\n /** low lever bspline curve -- STUB .. */\r\n public dispatchLineStringBSplineCurve(_lsA: LineString3d, _extendA: boolean, _curveB: BSplineCurve3d, _extendB: boolean, _reversed: boolean): any {\r\n /*\r\n const numA = lsA.numPoints();\r\n if (numA > 1) {\r\n const dfA = 1.0 / (numA - 1);\r\n let fA0;\r\n let fA1;\r\n fA0 = 0.0;\r\n const pointA0 = CurveCurveIntersectXYZ._workPointA0;\r\n const pointA1 = CurveCurveIntersectXYZ._workPointA1;\r\n lsA.pointAt(0, pointA0);\r\n for (let iA = 1; iA < numA; iA++ , pointA0.setFrom(pointA1), fA0 = fA1) {\r\n lsA.pointAt(iA, pointA1);\r\n fA1 = iA * dfA;\r\n this.dispatchSegmentBsplineCurve(\r\n lsA, iA === 1 && extendA, pointA0, fA0, pointA1, fA1, (iA + 1) === numA && extendA,\r\n curveB, extendB, reversed);\r\n }\r\n }\r\n return undefined;\r\n */\r\n }\r\n\r\n /** low lever segment intersect linestring .. */\r\n public computeSegmentLineString(lsA: LineSegment3d, extendA: boolean, lsB: LineString3d, extendB: boolean, reversed: boolean): any {\r\n const pointA0 = lsA.point0Ref;\r\n const pointA1 = lsA.point1Ref;\r\n const pointB0 = CurveCurveIntersectXYZ._workPointBB0;\r\n const pointB1 = CurveCurveIntersectXYZ._workPointBB1;\r\n const numB = lsB.numPoints();\r\n if (numB > 1) {\r\n const dfB = 1.0 / (numB - 1);\r\n let fB0;\r\n let fB1;\r\n fB0 = 0.0;\r\n lsB.pointAt(0, pointB0);\r\n for (let ib = 1; ib < numB; ib++, pointB0.setFrom(pointB1), fB0 = fB1) {\r\n lsB.pointAt(ib, pointB1);\r\n fB1 = ib * dfB;\r\n this.dispatchSegmentSegment(\r\n lsA, extendA, pointA0, 0.0, pointA1, 1.0, extendA,\r\n lsB, ib === 1 && extendB, pointB0, fB0, pointB1, fB1, (ib + 1) === numB && extendB,\r\n reversed);\r\n }\r\n }\r\n return undefined;\r\n }\r\n\r\n /** low lever arc intersect linestring .. */\r\n public computeArcLineString(arcA: Arc3d, extendA: boolean, lsB: LineString3d, extendB: boolean, reversed: boolean): any {\r\n const pointB0 = CurveCurveIntersectXYZ._workPointBB0;\r\n const pointB1 = CurveCurveIntersectXYZ._workPointBB1;\r\n const numB = lsB.numPoints();\r\n if (numB > 1) {\r\n const dfB = 1.0 / (numB - 1);\r\n let fB0;\r\n let fB1;\r\n fB0 = 0.0;\r\n lsB.pointAt(0, pointB0);\r\n for (let ib = 1; ib < numB; ib++, pointB0.setFrom(pointB1), fB0 = fB1) {\r\n lsB.pointAt(ib, pointB1);\r\n fB1 = ib * dfB;\r\n this.dispatchSegmentArc(\r\n lsB, ib === 1 && extendB, pointB0, fB0, pointB1, fB1, (ib + 1) === numB && extendB,\r\n arcA, extendA, extendA,\r\n !reversed);\r\n }\r\n }\r\n return undefined;\r\n }\r\n\r\n /** double dispatch handler for strongly typed segment.. */\r\n public override handleLineSegment3d(segmentA: LineSegment3d): any {\r\n if (this._geometryB instanceof LineSegment3d) {\r\n const segmentB = this._geometryB;\r\n this.dispatchSegmentSegment(\r\n segmentA, this._extendA, segmentA.point0Ref, 0.0, segmentA.point1Ref, 1.0, this._extendA,\r\n segmentB, this._extendB, segmentB.point0Ref, 0.0, segmentB.point1Ref, 1.0, this._extendB,\r\n false);\r\n } else if (this._geometryB instanceof LineString3d) {\r\n this.computeSegmentLineString(segmentA, this._extendA, this._geometryB, this._extendB, false);\r\n } else if (this._geometryB instanceof Arc3d) {\r\n this.dispatchSegmentArc(\r\n segmentA, this._extendA, segmentA.point0Ref, 0.0, segmentA.point1Ref, 1.0, this._extendA,\r\n this._geometryB, this._extendB, this._extendB, false);\r\n } else if (this._geometryB instanceof BSplineCurve3d) {\r\n this.dispatchSegmentBsplineCurve(\r\n segmentA, this._extendA, segmentA.point0Ref, 0.0, segmentA.point1Ref, 1.0, this._extendA,\r\n this._geometryB, this._extendB, false);\r\n }\r\n }\r\n /** double dispatch handler for strongly typed linestring .. */\r\n public override handleLineString3d(lsA: LineString3d): any {\r\n if (this._geometryB instanceof LineString3d) {\r\n const lsB = this._geometryB;\r\n const pointA0 = CurveCurveIntersectXYZ._workPointAA0;\r\n const pointA1 = CurveCurveIntersectXYZ._workPointAA1;\r\n const pointB0 = CurveCurveIntersectXYZ._workPointBB0;\r\n const pointB1 = CurveCurveIntersectXYZ._workPointBB1;\r\n const numA = lsA.numPoints();\r\n const numB = lsB.numPoints();\r\n if (numA > 1 && numB > 1) {\r\n lsA.pointAt(0, pointA0);\r\n const dfA = 1.0 / (numA - 1);\r\n const dfB = 1.0 / (numB - 1);\r\n let fA0 = 0.0;\r\n let fB0;\r\n let fA1;\r\n let fB1;\r\n const extendA = this._extendA;\r\n const extendB = this._extendB;\r\n lsA.pointAt(0, pointA0);\r\n for (let ia = 1; ia < numA; ia++, pointA0.setFrom(pointA1), fA0 = fA1) {\r\n fA1 = ia * dfA;\r\n fB0 = 0.0;\r\n lsA.pointAt(ia, pointA1);\r\n lsB.pointAt(0, pointB0);\r\n for (let ib = 1; ib < numB; ib++, pointB0.setFrom(pointB1), fB0 = fB1) {\r\n lsB.pointAt(ib, pointB1);\r\n fB1 = ib * dfB;\r\n this.dispatchSegmentSegment(\r\n lsA, ia === 1 && extendA, pointA0, fA0, pointA1, fA1, (ia + 1) === numA && extendA,\r\n lsB, ib === 1 && extendB, pointB0, fB0, pointB1, fB1, (ib + 1) === numB && extendB,\r\n false);\r\n }\r\n }\r\n }\r\n } else if (this._geometryB instanceof LineSegment3d) {\r\n this.computeSegmentLineString(this._geometryB, this._extendB, lsA, this._extendA, true);\r\n } else if (this._geometryB instanceof Arc3d) {\r\n this.computeArcLineString(this._geometryB, this._extendB, lsA, this._extendA, true);\r\n } else if (this._geometryB instanceof BSplineCurve3d) {\r\n this.dispatchLineStringBSplineCurve(lsA, this._extendA, this._geometryB, this._extendB, false);\r\n }\r\n return undefined;\r\n }\r\n /** double dispatch handler for strongly typed arc .. */\r\n public override handleArc3d(arc0: Arc3d): any {\r\n if (this._geometryB instanceof LineSegment3d) {\r\n this.dispatchSegmentArc(\r\n this._geometryB, this._extendB, this._geometryB.point0Ref, 0.0, this._geometryB.point1Ref, 1.0, this._extendB,\r\n arc0, this._extendA, this._extendA, true);\r\n } else if (this._geometryB instanceof LineString3d) {\r\n this.computeArcLineString(arc0, this._extendA, this._geometryB, this._extendB, false);\r\n } else if (this._geometryB instanceof Arc3d) {\r\n this.dispatchArcArc(arc0, this._extendA, this._geometryB, this._extendB, false);\r\n } else if (this._geometryB instanceof BSplineCurve3d) {\r\n this.dispatchArcBsplineCurve3d(arc0, this._extendA, this._geometryB, this._extendB, false);\r\n }\r\n return undefined;\r\n }\r\n /** double dispatch handler for strongly typed bspline curve.. */\r\n public override handleBSplineCurve3d(curve: BSplineCurve3d): any {\r\n if (this._geometryB instanceof LineSegment3d) {\r\n this.dispatchSegmentBsplineCurve(\r\n this._geometryB, this._extendB, this._geometryB.point0Ref, 0.0, this._geometryB.point1Ref, 1.0, this._extendB,\r\n curve, this._extendA, true);\r\n } else if (this._geometryB instanceof LineString3d) {\r\n this.dispatchLineStringBSplineCurve(this._geometryB, this._extendB, curve, this._extendA, true);\r\n } else if (this._geometryB instanceof Arc3d) {\r\n this.dispatchArcBsplineCurve3d(this._geometryB, this._extendB, curve, this._extendA, true);\r\n } else if (this._geometryB instanceof BSplineCurve3dBase) {\r\n this.dispatchBSplineCurve3dBSplineCurve3d(curve, this._geometryB, false);\r\n }\r\n return undefined;\r\n }\r\n /** double dispatch handler for strongly typed homogeneous bspline curve. */\r\n public override handleBSplineCurve3dH(_curve: BSplineCurve3dH): any {\r\n /* NEEDS WORK -- make \"dispatch\" methods tolerant of both 3d and 3dH ...\"easy\" if both present BezierCurve3dH span loaders\r\n if (this._geometryB instanceof LineSegment3d) {\r\n this.dispatchSegmentBsplineCurve(\r\n this._geometryB, this._extendB, this._geometryB.point0Ref, 0.0, this._geometryB.point1Ref, 1.0, this._extendB,\r\n curve, this._extendA, true);\r\n } else if (this._geometryB instanceof LineString3d) {\r\n this.dispatchLineStringBSplineCurve(this._geometryB, this._extendB, curve, this._extendA, true);\r\n } else if (this._geometryB instanceof Arc3d) {\r\n this.dispatchArcBsplineCurve3d(this._geometryB, this._extendB, curve, this._extendA, true);\r\n }\r\n */\r\n return undefined;\r\n }\r\n}\r\n"]}
|
|
1
|
+
{"version":3,"file":"CurveCurveIntersectXYZ.js","sourceRoot":"","s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AC;AAVrC,wDAAsB","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n\n/** @packageDocumentation\n * @module Curve\n */\n\nimport { BSplineCurve3d, BSplineCurve3dBase } from \"../bspline/BSplineCurve\";\nimport { BSplineCurve3dH } from \"../bspline/BSplineCurve3dH\";\nimport { Geometry } from \"../Geometry\";\nimport { NullGeometryHandler } from \"../geometry3d/GeometryHandler\";\nimport { Plane3dByOriginAndUnitNormal } from \"../geometry3d/Plane3dByOriginAndUnitNormal\";\nimport { Vector2d } from \"../geometry3d/Point2dVector2d\";\nimport { Point3d, Vector3d } from \"../geometry3d/Point3dVector3d\";\nimport { SmallSystem, TrigPolynomial } from \"../numerics/Polynomials\";\nimport { Arc3d } from \"./Arc3d\";\nimport { CurveLocationDetailArrayPair } from \"./CurveCurveIntersectXY\";\nimport { CurveIntervalRole, CurveLocationDetail } from \"./CurveLocationDetail\";\nimport { CurvePrimitive } from \"./CurvePrimitive\";\nimport { GeometryQuery } from \"./GeometryQuery\";\nimport { LineSegment3d } from \"./LineSegment3d\";\nimport { LineString3d } from \"./LineString3d\";\n\n// cspell:word XYRR\n\n/**\n * Handler class for XYZ intersections between _geometryB and another geometry.\n * * **NOTE:** GeometryQuery input (_geometryB) should really be AnyCurve.\n * * Instances are initialized and called from CurveCurve.\n * * geometryB is saved for later reference.\n * @internal\n */\nexport class CurveCurveIntersectXYZ extends NullGeometryHandler {\n private _extendA: boolean;\n private _geometryB: GeometryQuery;\n private _extendB: boolean;\n private _results!: CurveLocationDetailArrayPair;\n\n private static _workVector2dA = Vector2d.create();\n private static _workPointAA0 = Point3d.create();\n private static _workPointAA1 = Point3d.create();\n private static _workPointBB0 = Point3d.create();\n private static _workPointBB1 = Point3d.create();\n\n private reinitialize() {\n this._results = new CurveLocationDetailArrayPair();\n }\n /**\n * @param extendA flag to enable using extension of the other geometry.\n * @param geometryB second curve for intersection. Saved for reference by specific handler methods.\n * @param extendB flag for extension of geometryB.\n */\n public constructor(extendA: boolean, geometryB: GeometryQuery, extendB: boolean) {\n super();\n this._extendA = extendA;\n this._geometryB = geometryB;\n this._extendB = extendB;\n this.reinitialize();\n }\n /**\n * * Return the results structure for the intersection calculation.\n * @param reinitialize if true, a new results structure is created for use by later calls.\n */\n public grabResults(reinitialize: boolean = false): CurveLocationDetailArrayPair {\n const result = this._results;\n if (reinitialize)\n this.reinitialize();\n return result;\n }\n private acceptFraction(extend0: boolean, fraction: number, extend1: boolean) {\n if (!extend0 && fraction < 0.0)\n return false;\n if (!extend1 && fraction > 1.0)\n return false;\n return true;\n }\n /**\n * Compute intersection of two line segments.\n * Filter by extension rules.\n * Reject if evaluated points do not match coordinates (e.g. close approach point).\n * Record with fraction mapping.\n */\n private recordPointWithLocalFractions(\n localFractionA: number,\n cpA: CurvePrimitive,\n fractionA0: number,\n fractionA1: number,\n localFractionB: number, // Computed intersection fraction\n cpB: CurvePrimitive,\n fractionB0: number,\n fractionB1: number,\n reversed: boolean,\n ): void {\n const globalFractionA = Geometry.interpolate(fractionA0, localFractionA, fractionA1);\n const globalFractionB = Geometry.interpolate(fractionB0, localFractionB, fractionB1);\n // ignore duplicate of most recent point . ..\n const numPrevious = this._results.dataA.length;\n if (numPrevious > 0) {\n const topFractionA = this._results.dataA[numPrevious - 1].fraction;\n const topFractionB = this._results.dataB[numPrevious - 1].fraction;\n if (reversed) {\n if (Geometry.isAlmostEqualNumber(topFractionA, globalFractionB) &&\n Geometry.isAlmostEqualNumber(topFractionB, globalFractionA))\n return;\n } else {\n if (Geometry.isAlmostEqualNumber(topFractionA, globalFractionA) &&\n Geometry.isAlmostEqualNumber(topFractionB, globalFractionB))\n return;\n }\n }\n const pointA = cpA.fractionToPoint(globalFractionA);\n const pointB = cpB.fractionToPoint(globalFractionB);\n if (!pointA.isAlmostEqualMetric(pointB))\n return;\n\n const detailA = CurveLocationDetail.createCurveFractionPoint(cpA, globalFractionA, pointA);\n detailA.setIntervalRole(CurveIntervalRole.isolated);\n const detailB = CurveLocationDetail.createCurveFractionPoint(cpB, globalFractionB, pointB);\n detailB.setIntervalRole(CurveIntervalRole.isolated);\n if (reversed) {\n this._results.dataA.push(detailB);\n this._results.dataB.push(detailA);\n } else {\n this._results.dataA.push(detailA);\n this._results.dataB.push(detailB);\n }\n }\n /**\n * Compute intersection of two line segments.\n * Filter by extension rules.\n * Record with fraction mapping.\n */\n private computeSegmentSegment3D(\n cpA: CurvePrimitive,\n extendA0: boolean,\n pointA0: Point3d,\n fractionA0: number,\n pointA1: Point3d,\n fractionA1: number,\n extendA1: boolean,\n cpB: CurvePrimitive,\n extendB0: boolean,\n pointB0: Point3d,\n fractionB0: number,\n pointB1: Point3d,\n fractionB1: number,\n extendB1: boolean,\n reversed: boolean,\n ): void {\n const uv = CurveCurveIntersectXYZ._workVector2dA;\n if (SmallSystem.lineSegment3dClosestApproachUnbounded(pointA0, pointA1, pointB0, pointB1, uv) &&\n this.acceptFraction(extendA0, uv.x, extendA1) && this.acceptFraction(extendB0, uv.y, extendB1)) {\n this.recordPointWithLocalFractions(uv.x, cpA, fractionA0, fractionA1, uv.y, cpB, fractionB0, fractionB1, reversed);\n }\n }\n // Caller accesses data from a line segment and passes to here.\n // (The line segment in question might be (a) a full line segment or (b) a fragment within a linestring. The fraction and extend parameters\n // allow all combinations to be passed in)\n // This method applies transform.\n private dispatchSegmentSegment(\n cpA: CurvePrimitive,\n extendA0: boolean,\n pointA0: Point3d,\n fractionA0: number,\n pointA1: Point3d,\n fractionA1: number,\n extendA1: boolean,\n cpB: CurvePrimitive,\n extendB0: boolean,\n pointB0: Point3d,\n fractionB0: number,\n pointB1: Point3d,\n fractionB1: number,\n extendB1: boolean,\n reversed: boolean,\n ): void {\n this.computeSegmentSegment3D(\n cpA, extendA0, pointA0, fractionA0, pointA1, fractionA1, extendA1,\n cpB, extendB0, pointB0, fractionB0, pointB1, fractionB1, extendB1,\n reversed,\n );\n }\n /**\n * Create a plane whose normal is the \"better\" cross product: `vectorA.crossProduct(vectorB)` or\n * `vectorA.crossProduct(vectorC)`\n * * The heuristic for \"better\" is:\n * * first choice is cross product with `vectorB`, if `vectorA` and `vectorB` are sufficiently far from parallel\n * (or anti-parallel).\n * * otherwise use vectorC\n * @param origin plane origin\n * @param vectorA vector which must be in the plane.\n * @param cosineValue largest cosine of the angle theta between vectorA and vectorB to prefer their cross product, e.g.\n * passing 0.94 ~ cos(20deg) will switch to using vectorC in the cross product if theta < ~20deg or theta > ~160deg.\n * @param vectorB first candidate for additional in-plane vector\n * @param vectorC second candidate for additional in-plane vector\n */\n public createPlaneWithPreferredPerpendicular(\n origin: Point3d, vectorA: Vector3d, cosineValue: number, vectorB: Vector3d, vectorC: Vector3d,\n ): Plane3dByOriginAndUnitNormal | undefined {\n cosineValue = Geometry.restrictToInterval(Math.abs(cosineValue), 0.0, 1.0 - Geometry.smallFraction);\n const dotAA = vectorA.magnitudeSquared();\n const dotBB = vectorB.magnitudeSquared();\n const dotAB = Math.abs(vectorA.dotProduct(vectorB));\n const cross = vectorA.unitCrossProduct(dotAB * dotAB <= cosineValue * cosineValue * dotAA * dotBB ? vectorB : vectorC);\n if (cross)\n return Plane3dByOriginAndUnitNormal.create(origin, cross);\n return undefined;\n }\n // Caller accesses data from a linestring or segment and passes it here.\n // (The line segment in question might be (a) a full line segment or (b) a fragment within a linestring. The fraction and extend parameters\n // allow all combinations to be passed in)\n private dispatchSegmentArc(\n cpA: CurvePrimitive,\n extendA0: boolean,\n pointA0: Point3d,\n fractionA0: number,\n pointA1: Point3d,\n fractionA1: number,\n extendA1: boolean,\n arc: Arc3d,\n extendB0: boolean,\n extendB1: boolean,\n reversed: boolean,\n ): void {\n const lineVector = Vector3d.createStartEnd(pointA0, pointA1);\n const plane = this.createPlaneWithPreferredPerpendicular(\n pointA0, lineVector, 0.94, arc.perpendicularVector, arc.vector0);\n if (plane !== undefined) {\n const candidates: CurveLocationDetail[] = [];\n arc.appendPlaneIntersectionPoints(plane, candidates);\n let lineFraction;\n let linePoint: Point3d | undefined;\n for (const c of candidates) {\n if (this.acceptFraction(extendB0, c.fraction, extendB1)) {\n lineFraction = SmallSystem.lineSegment3dClosestPointUnbounded(pointA0, pointA1, c.point);\n if (lineFraction !== undefined) {\n linePoint = pointA0.interpolate(lineFraction, pointA1, linePoint);\n if (linePoint.isAlmostEqualMetric(c.point)\n && this.acceptFraction(extendA0, lineFraction, extendA1)) {\n this.recordPointWithLocalFractions(lineFraction, cpA, fractionA0, fractionA1,\n c.fraction, arc, 0, 1, reversed);\n\n }\n }\n }\n }\n }\n }\n // Caller promises arcs are coplanar.\n // Passes \"other\" as {center, vector0, vector90} in local xy space of cpA\n // Solves the arc-arc equations for that local ellipse with unit circle.\n // Solution fractions map directly to original arcs.\n private dispatchArcArcInPlane(\n cpA: Arc3d, extendA: boolean, cpB: Arc3d, extendB: boolean, reversed: boolean,\n ): void {\n const otherVectors = cpA.otherArcAsLocalVectors(cpB);\n if (otherVectors !== undefined) {\n const ellipseRadians: number[] = [];\n const circleRadians: number[] = [];\n TrigPolynomial.solveUnitCircleHomogeneousEllipseIntersection(\n otherVectors.center.x, otherVectors.center.y, 1.0,\n otherVectors.vector0.x, otherVectors.vector0.y, 0.0,\n otherVectors.vector90.x, otherVectors.vector90.y, 0.0,\n ellipseRadians, circleRadians,\n );\n for (let i = 0; i < ellipseRadians.length; i++) {\n const fractionA = cpA.sweep.radiansToSignedPeriodicFraction(circleRadians[i]);\n const fractionB = cpA.sweep.radiansToSignedPeriodicFraction(ellipseRadians[i]);\n // hm .. do we really need to check the fractions? We know they are internal to the beziers\n if (this.acceptFraction(extendA, fractionA, extendA) && this.acceptFraction(extendB, fractionB, extendB)) {\n this.recordPointWithLocalFractions(fractionA, cpA, 0, 1, fractionB, cpB, 0, 1, reversed);\n }\n }\n }\n }\n // Caller accesses data from two arcs.\n // Selects the best conditioned arc (in xy parts) as \"circle after inversion\"\n // Solves the arc-arc equations\n private dispatchArcArc(\n cpA: Arc3d, extendA: boolean, cpB: Arc3d, extendB: boolean, reversed: boolean,\n ): void {\n // If arcs are in different planes:\n // 1) Intersect each plane with the other arc (quadratic)\n // 2) accept points that appear in both intersection sets.\n // If arcs are in parallel planes -- no intersections\n // If arcs are in the same plane -- xy intersection in that plane.\n const planeA = Plane3dByOriginAndUnitNormal.create(cpA.center, cpA.perpendicularVector);\n const planeB = Plane3dByOriginAndUnitNormal.create(cpB.center, cpB.perpendicularVector);\n if (planeA === undefined || planeB === undefined)\n return;\n if (planeA.getNormalRef().isParallelTo(planeB.getNormalRef())) {\n if (planeA.isPointInPlane(planeB.getOriginRef()) && planeB.isPointInPlane(planeA.getOriginRef())) {\n // coplanar !!!\n this.dispatchArcArcInPlane(cpA, extendA, cpB, extendB, reversed);\n }\n } else {\n const arcBPoints: CurveLocationDetail[] = [];\n cpB.appendPlaneIntersectionPoints(planeA, arcBPoints);\n const arcAPoints: CurveLocationDetail[] = [];\n cpA.appendPlaneIntersectionPoints(planeB, arcAPoints);\n for (const detailB of arcBPoints) {\n for (const detailA of arcAPoints) {\n if (detailA.point.isAlmostEqual(detailB.point)) {\n if (this.acceptFraction(extendA, detailA.fraction, extendA)\n && this.acceptFraction(extendB, detailB.fraction, extendB)) {\n this.recordPointWithLocalFractions(detailA.fraction, cpA, 0, 1, detailB.fraction, cpB, 0, 1, reversed);\n }\n }\n }\n }\n }\n }\n // Caller accesses data from two arcs.\n // Selects the best conditioned arc (in xy parts) as \"circle after inversion\"\n // Solves the arc-arc equations\n private dispatchArcBsplineCurve3d(\n _arc: Arc3d, _extendA: boolean, _cpB: BSplineCurve3d, _extendB: boolean, _reversed: boolean,\n ): void {\n /*\n // Arc: X = C + cU + sV\n // implicitize the arc as viewed. This \"3d\" matrix is homogeneous \"XYW\" not \"xyz\"\n let matrixA: Matrix3d;\n if (this._worldToLocalPerspective) {\n const dataA = cpA.toTransformedPoint4d(this._worldToLocalPerspective);\n matrixA = Matrix3d.createColumnsXYW(dataA.vector0, dataA.vector0.w, dataA.vector90, dataA.vector90.w, dataA.center, dataA.center.w);\n } else {\n const dataA = cpA.toTransformedVectors(this._worldToLocalAffine);\n matrixA = Matrix3d.createColumnsXYW(dataA.vector0, 0, dataA.vector90, 0, dataA.center, 1);\n }\n // The worldToLocal has moved the arc vectors into local space.\n // matrixA captures the xyw parts (ignoring z)\n // for any point in world space,\n // THIS CODE ONLY WORKS FOR\n const matrixAInverse = matrixA.inverse();\n if (matrixAInverse) {\n const orderF = cpB.order; // order of the beziers for simple coordinates\n const orderG = 2 * orderF - 1; // order of the (single) bezier for squared coordinates.\n const coffF = new Float64Array(orderF);\n const univariateBezierG = new UnivariateBezier(orderG);\n const axx = matrixAInverse.at(0, 0); const axy = matrixAInverse.at(0, 1); const axz = 0.0; const axw = matrixAInverse.at(0, 2);\n const ayx = matrixAInverse.at(1, 0); const ayy = matrixAInverse.at(1, 1); const ayz = 0.0; const ayw = matrixAInverse.at(1, 2);\n const awx = matrixAInverse.at(2, 0); const awy = matrixAInverse.at(2, 1); const awz = 0.0; const aww = matrixAInverse.at(2, 2);\n\n if (matrixAInverse) {\n let bezier: BezierCurve3dH | undefined;\n for (let spanIndex = 0; ; spanIndex++) {\n bezier = cpB.getSaturatedBezierSpan3dH(spanIndex, bezier);\n if (!bezier) break;\n if (this._worldToLocalPerspective)\n bezier.tryMultiplyMatrix4dInPlace(this._worldToLocalPerspective);\n else if (this._worldToLocalAffine)\n bezier.tryTransformInPlace(this._worldToLocalAffine);\n univariateBezierG.zero();\n bezier.poleProductsXYZW(coffF, axx, axy, axz, axw);\n univariateBezierG.addSquaredSquaredBezier(coffF, 1.0);\n bezier.poleProductsXYZW(coffF, ayx, ayy, ayz, ayw);\n univariateBezierG.addSquaredSquaredBezier(coffF, 1.0);\n bezier.poleProductsXYZW(coffF, awx, awy, awz, aww);\n univariateBezierG.addSquaredSquaredBezier(coffF, -1.0);\n const roots = univariateBezierG.roots(0.0, true);\n if (roots) {\n for (const root of roots) {\n const fractionB = bezier.fractionToParentFraction(root);\n // The univariate bezier (which has been transformed by the view transform) evaluates into xyw space\n const bcurvePoint4d = bezier.fractionToPoint4d(root);\n const c = bcurvePoint4d.dotProductXYZW(axx, axy, axz, axw);\n const s = bcurvePoint4d.dotProductXYZW(ayx, ayy, ayz, ayw);\n const arcFraction = cpA.sweep.radiansToSignedPeriodicFraction(Math.atan2(s, c));\n if (this.acceptFraction(extendA, arcFraction, extendA) && this.acceptFraction(extendB, fractionB, extendB)) {\n this.recordPointWithLocalFractions(arcFraction, cpA, 0, 1,\n fractionB, cpB, 0, 1, reversed);\n }\n }\n }\n }\n }\n }\n */\n }\n /*\n // apply the transformation to bezier curves. optionally construct ranges.\n private transformBeziers(beziers: BezierCurve3dH[]) {\n if (this._worldToLocalAffine) {\n for (const bezier of beziers) bezier.tryTransformInPlace(this._worldToLocalAffine);\n } else if (this._worldToLocalPerspective) {\n for (const bezier of beziers) bezier.tryMultiplyMatrix4dInPlace(this._worldToLocalPerspective);\n }\n }\n */\n /*\n private getRanges(beziers: BezierCurveBase[]): Range3d[] {\n const ranges: Range3d[] = [];\n ranges.length = 0;\n for (const b of beziers) {\n ranges.push(b.range());\n }\n return ranges;\n }\n private _xyzwA0?: Point4d;\n private _xyzwA1?: Point4d;\n private _xyzwPlane?: Point4d;\n private _xyzwB?: Point4d;\n\n private dispatchBezierBezierStrokeFirst(\n bezierA: BezierCurve3dH,\n bcurveA: BSplineCurve3dBase,\n strokeCountA: number,\n bezierB: BezierCurve3dH,\n bcurveB: BSplineCurve3dBase,\n _strokeCountB: number,\n univariateBezierB: UnivariateBezier, // caller-allocated for univariate coefficients.\n reversed: boolean) {\n if (!this._xyzwA0) this._xyzwA0 = Point4d.create();\n if (!this._xyzwA1) this._xyzwA1 = Point4d.create();\n if (!this._xyzwPlane) this._xyzwPlane = Point4d.create();\n if (!this._xyzwB) this._xyzwB = Point4d.create();\n const roots = univariateBezierG.roots(0.0, true);\n if (roots) {\n for (const root of roots) {\n const fractionB = bezier.fractionToParentFraction(root);\n // The univariate bezier (which has been transformed by the view transform) evaluates into xyw space\n const bcurvePoint4d = bezier.fractionToPoint4d(root);\n const c = bcurvePoint4d.dotProductXYZW(axx, axy, axz, axw);\n const s = bcurvePoint4d.dotProductXYZW(ayx, ayy, ayz, ayw);\n const arcFraction = cpA.sweep.radiansToSignedPeriodicFraction(Math.atan2(s, c));\n if (this.acceptFraction(extendA, arcFraction, extendA) && this.acceptFraction(extendB, fractionB, extendB)) {\n this.recordPointWithLocalFractions(arcFraction, cpA, 0, 1,\n fractionB, cpB, 0, 1, reversed);\n }\n }\n bezierA.fractionToPoint4d(0.0, this._xyzwA0);\n let f0 = 0.0;\n let f1 = 1.0;\n const intervalTolerance = 1.0e-5;\n const df = 1.0 / strokeCountA;\n for (let i = 1; i <= strokeCountA; i++ , f0 = f1, this._xyzwA0.setFrom(this._xyzwA1)) {\n f1 = i * df;\n bezierA.fractionToPoint4d(f1, this._xyzwA1);\n Point4d.createPlanePointPointZ(this._xyzwA0, this._xyzwA1, this._xyzwPlane);\n bezierB.poleProductsXYZW(univariateBezierB.coffs, this._xyzwPlane.x, this._xyzwPlane.y, this._xyzwPlane.z, this._xyzwPlane.w);\n let errors = 0;\n const roots = univariateBezierB.roots(0.0, true);\n if (roots)\n for (const r of roots) {\n const bezierBFraction = r;\n bezierB.fractionToPoint4d(bezierBFraction, this._xyzwB);\n const segmentAFraction = SmallSystem.lineSegment3dHXYClosestPointUnbounded(this._xyzwA0, this._xyzwA1, this._xyzwB);\n if (segmentAFraction && Geometry.isIn01WithTolerance(segmentAFraction, intervalTolerance)) {\n const bezierAFraction = Geometry.interpolate(f0, segmentAFraction, f1);\n /*- TODO implement newton search\n const xyMatchingFunction = new BezierBezierIntersectionXYRRToRRD(bezierA, bezierB);\n const newtonSearcher = new Newton2dUnboundedWithDerivative(xyMatchingFunction);\n newtonSearcher.setUV(bezierAFraction, bezierBFraction);\n if (newtonSearcher.runIterations()) {\n bezierAFraction = newtonSearcher.getU();\n bezierBFraction = newtonSearcher.getV();\n }\n // We have a near intersection at fractions on the two beziers !!!\n // Iterate on the curves for a true intersection ....\n // NEEDS WORK -- just accept . . .\n const bcurveAFraction = bezierA.fractionToParentFraction(bezierAFraction);\n const bcurveBFraction = bezierB.fractionToParentFraction(bezierBFraction);\n const xyzA0 = bezierA.fractionToPoint(bezierAFraction);\n const xyzA1 = bcurveA.fractionToPoint(bcurveAFraction);\n const xyzB0 = bezierB.fractionToPoint(bezierBFraction);\n const xyzB1 = bcurveB.fractionToPoint(bcurveBFraction);\n if (!xyzA0.isAlmostEqualXY(xyzA1))\n errors++;\n if (!xyzB0.isAlmostEqualXY(xyzB1))\n errors++;\n if (errors > 0 && !xyzA0.isAlmostEqual(xyzB0))\n errors++;\n if (errors > 0 && !xyzA1.isAlmostEqual(xyzB1))\n errors++;\n if (this.acceptFraction(false, bcurveAFraction, false) && this.acceptFraction(false, bcurveBFraction, false)) {\n this.recordPointWithLocalFractions(bcurveAFraction, bcurveA, 0, 1,\n bcurveBFraction, bcurveB, 0, 1, reversed);\n }\n }\n }\n }\n }\n */\n // Caller accesses data from two arcs.\n // Selects the best conditioned arc (in xy parts) as \"circle after inversion\"\n // Solves the arc-arc equations\n private dispatchBSplineCurve3dBSplineCurve3d(\n _bcurveA: BSplineCurve3dBase, _bcurveB: BSplineCurve3dBase, _reversed: boolean,\n ): void {\n /*\n const bezierSpanA = bcurveA.collectBezierSpans(true) as BezierCurve3dH[];\n const bezierSpanB = bcurveB.collectBezierSpans(true) as BezierCurve3dH[];\n const numA = bezierSpanA.length;\n const numB = bezierSpanB.length;\n this.transformBeziers(bezierSpanA);\n this.transformBeziers(bezierSpanB);\n const rangeA = this.getRanges(bezierSpanA);\n const rangeB = this.getRanges(bezierSpanB);\n const orderA = bcurveA.order;\n const orderB = bcurveB.order;\n const univariateCoffsA = new UnivariateBezier(orderA);\n const univariateCoffsB = new UnivariateBezier(orderB);\n for (let a = 0; a < numA; a++) {\n for (let b = 0; b < numB; b++) {\n if (rangeA[a].intersectsRangeXY(rangeB[b])) {\n const strokeCountA = bezierSpanA[a].computeStrokeCountForOptions();\n const strokeCountB = bezierSpanB[b].computeStrokeCountForOptions();\n if (strokeCountA < strokeCountB)\n this.dispatchBezierBezierStrokeFirst(bezierSpanA[a], bcurveA, strokeCountA, bezierSpanB[b], bcurveB, strokeCountB, univariateCoffsB, !_reversed);\n else\n this.dispatchBezierBezierStrokeFirst(bezierSpanB[b], bcurveB, strokeCountB, bezierSpanA[a], bcurveA, strokeCountA, univariateCoffsA, _reversed);\n }\n }\n }\n */\n }\n /*\n /**\n * Apply the projection transform (if any) to (xyz, w)\n * @param xyz xyz parts of input point.\n * @param w weight to use for homogeneous effects\n */\n /*\n private projectPoint(xyz: XYAndZ, w: number = 1.0): Point4d {\n if (this._worldToLocalPerspective)\n return this._worldToLocalPerspective.multiplyPoint3d(xyz, w);\n if (this._worldToLocalAffine)\n return this._worldToLocalAffine.multiplyXYZW(xyz.x, xyz.y, xyz.z, w);\n return Point4d.createFromPointAndWeight(xyz, w);\n }\n private mapNPCPlaneToWorld(npcPlane: Point4d, worldPlane: Point4d) {\n // for NPC pointY, Y^ * H = 0 is \"on\" plane H. (Hat is transpose)\n // NPC Y is A*X for our transform A and worldPointX.\n // hence (A X)^ * H = 0\n // hence X^ * A^ * H = 0\n // hence K = A^ * H\n if (this._worldToLocalAffine) {\n this._worldToLocalAffine.multiplyTransposeXYZW(npcPlane.x, npcPlane.y, npcPlane.z, npcPlane.w, worldPlane);\n } else if (this._worldToLocalPerspective) {\n this._worldToLocalPerspective.multiplyTransposePoint4d(npcPlane, worldPlane);\n } else {\n npcPlane.clone(worldPlane);\n }\n }\n */\n // Caller accesses data from segment and bsplineCurve\n // Selects the best conditioned arc (in xy parts) as \"circle after inversion\"\n // Solves the arc-arc equations\n private dispatchSegmentBsplineCurve(\n _cpA: CurvePrimitive,\n _extendA0: boolean,\n _pointA0: Point3d,\n _fractionA0: number,\n _pointA1: Point3d,\n _fractionA1: number,\n _extendA1: boolean,\n _bcurve: BSplineCurve3d,\n _extendB: boolean,\n _reversed: boolean,\n ): void {\n /*\n const pointA0H = this.projectPoint(pointA0);\n const pointA1H = this.projectPoint(pointA1);\n const planeCoffs = Point4d.createPlanePointPointZ(pointA0H, pointA1H);\n this.mapNPCPlaneToWorld(planeCoffs, planeCoffs);\n // NOW .. we have a plane in world space. Intersect it with the bspline:\n const intersections: CurveLocationDetail[] = [];\n bcurve.appendPlaneIntersectionPoints(planeCoffs, intersections);\n // intersections has WORLD points with bspline fractions. (The bspline fractions are all good 0..1 fractions within the spline.)\n // accept those that are within the segment range.\n for (const detail of intersections) {\n const fractionB = detail.fraction;\n const curvePoint = detail.point;\n const curvePointH = this.projectPoint(curvePoint);\n const lineFraction = SmallSystem.lineSegment3dHXYClosestPointUnbounded(pointA0H, pointA1H, curvePointH);\n if (lineFraction !== undefined && this.acceptFraction(extendA0, lineFraction, extendA1) && this.acceptFraction(extendB, fractionB, extendB)) {\n this.recordPointWithLocalFractions(lineFraction, cpA, fractionA0, fractionA1,\n fractionB, bcurve, 0, 1, reversed);\n }\n }\n */\n }\n /** Low level dispatch of linestring with (beziers of) a bspline curve */\n public dispatchLineStringBSplineCurve(\n _lsA: LineString3d, _extendA: boolean, _curveB: BSplineCurve3d, _extendB: boolean, _reversed: boolean,\n ): any {\n /*\n const numA = lsA.numPoints();\n if (numA > 1) {\n const dfA = 1.0 / (numA - 1);\n let fA0;\n let fA1;\n fA0 = 0.0;\n const pointA0 = CurveCurveIntersectXYZ._workPointA0;\n const pointA1 = CurveCurveIntersectXYZ._workPointA1;\n lsA.pointAt(0, pointA0);\n for (let iA = 1; iA < numA; iA++ , pointA0.setFrom(pointA1), fA0 = fA1) {\n lsA.pointAt(iA, pointA1);\n fA1 = iA * dfA;\n this.dispatchSegmentBsplineCurve(\n lsA, iA === 1 && extendA, pointA0, fA0, pointA1, fA1, (iA + 1) === numA && extendA,\n curveB, extendB, reversed);\n }\n }\n return undefined;\n */\n }\n /** Detail computation for segment intersecting linestring. */\n public computeSegmentLineString(\n lsA: LineSegment3d, extendA: boolean, lsB: LineString3d, extendB: boolean, reversed: boolean,\n ): any {\n const pointA0 = lsA.point0Ref;\n const pointA1 = lsA.point1Ref;\n const pointB0 = CurveCurveIntersectXYZ._workPointBB0;\n const pointB1 = CurveCurveIntersectXYZ._workPointBB1;\n const numB = lsB.numPoints();\n if (numB > 1) {\n const dfB = 1.0 / (numB - 1);\n let fB0;\n let fB1;\n fB0 = 0.0;\n lsB.pointAt(0, pointB0);\n for (let ib = 1; ib < numB; ib++, pointB0.setFrom(pointB1), fB0 = fB1) {\n lsB.pointAt(ib, pointB1);\n fB1 = ib * dfB;\n this.dispatchSegmentSegment(\n lsA, extendA, pointA0, 0.0, pointA1, 1.0, extendA, lsB, ib === 1 && extendB,\n pointB0, fB0, pointB1, fB1, (ib + 1) === numB && extendB, reversed,\n );\n }\n }\n return undefined;\n }\n /** Detail computation for arc intersecting linestring. */\n public computeArcLineString(\n arcA: Arc3d, extendA: boolean, lsB: LineString3d, extendB: boolean, reversed: boolean,\n ): any {\n const pointB0 = CurveCurveIntersectXYZ._workPointBB0;\n const pointB1 = CurveCurveIntersectXYZ._workPointBB1;\n const numB = lsB.numPoints();\n if (numB > 1) {\n const dfB = 1.0 / (numB - 1);\n let fB0;\n let fB1;\n fB0 = 0.0;\n lsB.pointAt(0, pointB0);\n for (let ib = 1; ib < numB; ib++, pointB0.setFrom(pointB1), fB0 = fB1) {\n lsB.pointAt(ib, pointB1);\n fB1 = ib * dfB;\n this.dispatchSegmentArc(\n lsB, ib === 1 && extendB, pointB0, fB0, pointB1, fB1,\n (ib + 1) === numB && extendB, arcA, extendA, extendA, !reversed);\n }\n }\n return undefined;\n }\n /** Double dispatch handler for strongly typed segment. */\n public override handleLineSegment3d(segmentA: LineSegment3d): any {\n if (this._geometryB instanceof LineSegment3d) {\n const segmentB = this._geometryB;\n this.dispatchSegmentSegment(\n segmentA, this._extendA, segmentA.point0Ref, 0.0, segmentA.point1Ref, 1.0, this._extendA,\n segmentB, this._extendB, segmentB.point0Ref, 0.0, segmentB.point1Ref, 1.0, this._extendB,\n false,\n );\n } else if (this._geometryB instanceof LineString3d) {\n this.computeSegmentLineString(segmentA, this._extendA, this._geometryB, this._extendB, false);\n } else if (this._geometryB instanceof Arc3d) {\n this.dispatchSegmentArc(\n segmentA, this._extendA, segmentA.point0Ref, 0.0, segmentA.point1Ref,\n 1.0, this._extendA, this._geometryB, this._extendB, this._extendB, false,\n );\n } else if (this._geometryB instanceof BSplineCurve3d) {\n this.dispatchSegmentBsplineCurve(\n segmentA, this._extendA, segmentA.point0Ref, 0.0, segmentA.point1Ref,\n 1.0, this._extendA, this._geometryB, this._extendB, false,\n );\n }\n }\n /** double dispatch handler for strongly typed linestring .. */\n public override handleLineString3d(lsA: LineString3d): any {\n if (this._geometryB instanceof LineString3d) {\n const lsB = this._geometryB;\n const pointA0 = CurveCurveIntersectXYZ._workPointAA0;\n const pointA1 = CurveCurveIntersectXYZ._workPointAA1;\n const pointB0 = CurveCurveIntersectXYZ._workPointBB0;\n const pointB1 = CurveCurveIntersectXYZ._workPointBB1;\n const numA = lsA.numPoints();\n const numB = lsB.numPoints();\n if (numA > 1 && numB > 1) {\n lsA.pointAt(0, pointA0);\n const dfA = 1.0 / (numA - 1);\n const dfB = 1.0 / (numB - 1);\n let fA0 = 0.0;\n let fA1, fB0, fB1;\n const extendA = this._extendA;\n const extendB = this._extendB;\n lsA.pointAt(0, pointA0);\n for (let ia = 1; ia < numA; ia++, pointA0.setFrom(pointA1), fA0 = fA1) {\n fA1 = ia * dfA;\n fB0 = 0.0;\n lsA.pointAt(ia, pointA1);\n lsB.pointAt(0, pointB0);\n for (let ib = 1; ib < numB; ib++, pointB0.setFrom(pointB1), fB0 = fB1) {\n lsB.pointAt(ib, pointB1);\n fB1 = ib * dfB;\n this.dispatchSegmentSegment(\n lsA, ia === 1 && extendA, pointA0, fA0, pointA1, fA1, (ia + 1) === numA && extendA,\n lsB, ib === 1 && extendB, pointB0, fB0, pointB1, fB1, (ib + 1) === numB && extendB,\n false,\n );\n }\n }\n }\n } else if (this._geometryB instanceof LineSegment3d) {\n this.computeSegmentLineString(this._geometryB, this._extendB, lsA, this._extendA, true);\n } else if (this._geometryB instanceof Arc3d) {\n this.computeArcLineString(this._geometryB, this._extendB, lsA, this._extendA, true);\n } else if (this._geometryB instanceof BSplineCurve3d) {\n this.dispatchLineStringBSplineCurve(lsA, this._extendA, this._geometryB, this._extendB, false);\n }\n return undefined;\n }\n /** Double dispatch handler for strongly typed arc. */\n public override handleArc3d(arc0: Arc3d): any {\n if (this._geometryB instanceof LineSegment3d) {\n this.dispatchSegmentArc(\n this._geometryB, this._extendB, this._geometryB.point0Ref, 0.0, this._geometryB.point1Ref,\n 1.0, this._extendB, arc0, this._extendA, this._extendA, true,\n );\n } else if (this._geometryB instanceof LineString3d) {\n this.computeArcLineString(arc0, this._extendA, this._geometryB, this._extendB, false);\n } else if (this._geometryB instanceof Arc3d) {\n this.dispatchArcArc(arc0, this._extendA, this._geometryB, this._extendB, false);\n } else if (this._geometryB instanceof BSplineCurve3d) {\n this.dispatchArcBsplineCurve3d(arc0, this._extendA, this._geometryB, this._extendB, false);\n }\n return undefined;\n }\n /** Double dispatch handler for strongly typed bspline curve.. */\n public override handleBSplineCurve3d(curve: BSplineCurve3d): any {\n if (this._geometryB instanceof LineSegment3d) {\n this.dispatchSegmentBsplineCurve(\n this._geometryB, this._extendB, this._geometryB.point0Ref, 0.0, this._geometryB.point1Ref,\n 1.0, this._extendB, curve, this._extendA, true,\n );\n } else if (this._geometryB instanceof LineString3d) {\n this.dispatchLineStringBSplineCurve(this._geometryB, this._extendB, curve, this._extendA, true);\n } else if (this._geometryB instanceof Arc3d) {\n this.dispatchArcBsplineCurve3d(this._geometryB, this._extendB, curve, this._extendA, true);\n } else if (this._geometryB instanceof BSplineCurve3dBase) {\n this.dispatchBSplineCurve3dBSplineCurve3d(curve, this._geometryB, false);\n }\n return undefined;\n }\n /** Double dispatch handler for strongly typed homogeneous bspline curve. */\n public override handleBSplineCurve3dH(_curve: BSplineCurve3dH): any {\n /*\n // NEEDS WORK -- make \"dispatch\" methods tolerant of both 3d and 3dH\n // \"easy\" if both present BezierCurve3dH span loaders\n if (this._geometryB instanceof LineSegment3d) {\n this.dispatchSegmentBsplineCurve(\n this._geometryB, this._extendB, this._geometryB.point0Ref, 0.0, this._geometryB.point1Ref, 1.0, this._extendB,\n curve, this._extendA, true);\n } else if (this._geometryB instanceof LineString3d) {\n this.dispatchLineStringBSplineCurve(this._geometryB, this._extendB, curve, this._extendA, true);\n } else if (this._geometryB instanceof Arc3d) {\n this.dispatchArcBsplineCurve3d(this._geometryB, this._extendB, curve, this._extendA, true);\n }\n */\n return undefined;\n }\n}\n"]}
|