import { BSplineCurve3d } from "../../bspline/BSplineCurve"; import { BSplineCurve3dH } from "../../bspline/BSplineCurve3dH"; import { RecurseToCurvesGeometryHandler } from "../../geometry3d/GeometryHandler"; import { Matrix4d } from "../../geometry4d/Matrix4d"; import { Arc3d } from "../Arc3d"; import { CurveChainWithDistanceIndex } from "../CurveChainWithDistanceIndex"; import { CurveLocationDetailPair } from "../CurveLocationDetail"; import { CurvePrimitive } from "../CurvePrimitive"; import { AnyCurve } from "../CurveTypes"; import { GeometryQuery } from "../GeometryQuery"; import { LineSegment3d } from "../LineSegment3d"; import { LineString3d } from "../LineString3d"; import { TransitionSpiral3d } from "../spiral/TransitionSpiral3d"; /** * Handler class for XY intersections between _geometryB and another geometry. * * Instances are initialized and called from CurveCurve. * * geometryB is saved for later reference. * @internal */ export declare class CurveCurveIntersectXY extends RecurseToCurvesGeometryHandler { private _extendA0; private _extendA1; private _geometryB; private _extendB0; private _extendB1; private _results; private _worldToLocalPerspective; private _worldToLocalAffine; private _coincidentGeometryContext; private static _workPointA0H; private static _workPointA1H; private static _workPointB0H; private static _workPointB1H; private static _workPointAA0; private static _workPointAA1; private static _workPointBB0; private static _workPointBB1; private static _workPointA0; private static _workPointA1; private static _workPointB0; private static _workPointB1; private _xyzwA0?; private _xyzwA1?; private _xyzwPlane?; private _xyzwB?; /** * The constructor. * @param worldToLocal optional transform (possibly perspective) to project to xy plane for intersection. * @param extendA flag for extension of the other geometry. * @param geometryB second curve for intersection. Saved for reference by specific handler methods. * @param extendB flag for extension of geometryB. * @param tolerance optional distance tolerance for coincidence. */ constructor(worldToLocal: Matrix4d | undefined, extendA: boolean, geometryB: AnyCurve | undefined, extendB: boolean, tolerance?: number); /** * Reset geometryA extension flags. * * Undefined inputs are ignored. * * All other instance data is unchanged, including accumulated intersections. */ resetGeometryA(extendA0?: boolean, extendA1?: boolean): void; /** * Reset geometryB and its extension flags. * * Undefined inputs are ignored. * * All other instance data is unchanged, including accumulated intersections. */ resetGeometryB(geometryB?: AnyCurve, extendB0?: boolean, extendB1?: boolean): void; /** Accept the fraction if it falls inside (possibly extended) fraction range. */ private acceptFraction; /** Test the fraction by strict parameter, but allow toleranced distance test at ends. */ private acceptFractionOnLine; /** * Return the results structure for the intersection calculation, structured as an array of CurveLocationDetailPair * @param reinitialize if true, a new results structure is created for use by later calls. */ grabPairedResults(reinitialize?: boolean): CurveLocationDetailPair[]; /** * Record the pre-computed intersection between two curves. Record with fraction mapping. * @param localFractionA intersection fraction local to the subcurve of cpA between fractionA0 and fractionA1 * @param cpA the first curve * @param fractionA0 start of the subcurve of cpA * @param fractionA1 end of the subcurve of cpA * @param localFractionB intersection fraction local to the subcurve of cpB between fractionB0 and fractionB1 * @param cpB the second curve * @param fractionB0 start of the subcurve of cpB * @param fractionB1 end of the subcurve of cpB * @param reversed whether to reverse the details in the recorded intersection pair * @param intervalDetails optional data for a coincident segment intersection * @param fractionTol relative tolerance for comparing fractions to avoid duplicating the last intersection. Defaults * to [[Geometry.smallAngleRadians]]. */ private recordPointWithLocalFractions; /** * Emit recordPoint for multiple pairs (on full curve). * @param cpA first curve primitive (possibly different from curve in detailA, but fraction compatible). * @param cpB second curve primitive (possibly different from curve in detailA, but fraction compatible). * @param pairs array of pairs. * @param reversed true to have order reversed in final structures. */ recordPairs(cpA: CurvePrimitive, cpB: CurvePrimitive, pairs: CurveLocationDetailPair[] | undefined, reversed: boolean): void; /** Compute intersection of two line segments. Filter by extension rules. Record with fraction mapping. */ private computeSegmentSegment3D; /** * Compute intersection of projected homogeneous line segments. Filter by extension rules. Record with * fraction mapping. Assumes caller knows the _worldToLocal is present. */ private computeSegmentSegment3DH; private dispatchSegmentSegment; /** Implementation of dispatchSegmentArc under affine transform. KEEP IN SYNC WITH computeSegmentArcHomogeneous. */ private computeSegmentArc; /** Implementation of dispatchSegmentArc under perspective transform. KEEP IN SYNC WITH computeSegmentArc. */ private computeSegmentArcHomogeneous; private dispatchSegmentArc; /** * Compute the intersection of two xy-arcs. * * Each matrix has [U V C] in (x,y,w) form from homogeneous projection (local to world). * * Arcs are ordered so that matrixA is better conditioned. */ private dispatchArcArcThisOrder; /** * We have 2 xy-arcs. * 1- We pick the arc that is closest to circular (larger condition number is closer to circular). * 2- Transform it to local coords, where it becomes the unit xy-circle. * 3- Use the same map to transform the other arc. * 4- Find the intersection of arc and unit circle. * 5- Convert intersection angles to fractions and record intersections. */ private dispatchArcArc; /** Compute the intersection of an arc and a B-spline curve. */ private dispatchArcBsplineCurve3d; /** Apply the transformation to bezier curves. Optionally construct ranges. */ private transformBeziers; private getRanges; private dispatchBezierBezierStrokeFirst; private dispatchBSplineCurve3dBSplineCurve3d; /** * Apply the projection transform (if any) to (xyz, w). * @param xyz xyz parts of input point. * @param w weight to use for homogeneous effects. */ private projectPoint; private mapNPCPlaneToWorld; private dispatchSegmentBsplineCurve; /** Low level dispatch of linestring with (beziers of) a bspline curve. */ dispatchLineStringBSplineCurve(lsA: LineString3d, extendA0: boolean, extendA1: boolean, curveB: BSplineCurve3d, extendB0: boolean, extendB1: boolean, reversed: boolean): any; /** Detail computation for segment intersecting linestring. */ computeSegmentLineString(lsA: LineSegment3d, extendA0: boolean, extendA1: boolean, lsB: LineString3d, extendB0: boolean, extendB1: boolean, reversed: boolean): any; /** Detail computation for arc intersecting linestring. */ computeArcLineString(arcA: Arc3d, extendA0: boolean, extendA1: boolean, lsB: LineString3d, extendB0: boolean, extendB1: boolean, reversed: boolean): any; /** Detail computation for linestring intersecting linestring. */ private computeLineStringLineString; private static setTransformedWorkPoints; /** * Low level dispatch of curve collection. * We take care of extend variables of geometry's children here if geometry is Path or Loop. */ private dispatchCurveCollection; /** * Low level dispatch of CurveChainWithDistanceIndex. * We take care of extend variables of geometry's children here if geometry.path is Path or Loop. */ private dispatchCurveChainWithDistanceIndex; /** * Process tail of `this._results` for xy-intersections between the curve and spiral. * * Refine each result via Newton iteration. If it doesn't converge, remove it. * @param curveA The other curve primitive. May also be a transition spiral. * @param spiralB The transition spiral. * @param index0 index of first entry in tail of `this._results` to refine. * @param reversed whether `spiralB` data is in `detailA` of each recorded pair, and `curveA` data in `detailB`. */ private refineSpiralResultsByNewton; /** * Append stroke points and return the line string. * * This is a convenient wrapper for [[CurvePrimitive.emitStrokes]] but the analogous instance method cannot be added * to that class due to the ensuing recursion with subclass [[LineString3d]]. * @param options options for stroking the instance curve. * @param result object to receive appended stroke points; if omitted, a new object is created, populated, and returned. */ private strokeCurve; /** Compute an approximation to the max chord height error of the stroked spiral, and another curve if a spiral. */ private computeMaxSpiralStrokeError; /** * Solve the intersection problem for stroked, unextended curveB. * * @return the number of results appended. */ private appendDiscreteIntersectionResults; /** * Solve the close approach problem for stroked, unextended curveB. * * Sort the results shortest projection distance first. * @return the number of results appended. */ private appendDiscreteCloseApproachResults; /** * Compute the xy-intersection of a curve and a spiral. * * When `curveA` is extended, duplicate solutions may be returned. * @param curveA curve to intersect with spiralB. May also be a transition spiral. * @param extendA0 whether to compute xy-intersections with curveA extended beyond its start. * @param extendA1 whether to compute xy-intersections with curveA extended beyond its end. * @param spiralB transition spiral to intersect with curveA. * @param reversed whether `spiralB` data will be recorded in `detailA` of each result, and `curveA` data in `detailB`. */ private dispatchCurveSpiral; /** * Invoke dispatch on each child of `g` as "geometryA". * * If `g` is a `Path` or `Loop`, adjust extension flags for geometryA accordingly. */ handleChildren(g: GeometryQuery): any; /** Double dispatch handler for strongly typed segment. */ handleLineSegment3d(segmentA: LineSegment3d): any; /** Double dispatch handler for strongly typed linestring. */ handleLineString3d(lsA: LineString3d): any; /** Double dispatch handler for strongly typed arc. */ handleArc3d(arcA: Arc3d): any; /** Double dispatch handler for strongly typed bspline curve. */ handleBSplineCurve3d(curveA: BSplineCurve3d): any; /** Double dispatch handler for strongly typed spiral curve. */ handleTransitionSpiral(spiral: TransitionSpiral3d): any; /** Double dispatch handler for strongly typed CurveChainWithDistanceIndex. */ handleCurveChainWithDistanceIndex(chain: CurveChainWithDistanceIndex): any; /** Double dispatch handler for strongly typed homogeneous bspline curve. */ handleBSplineCurve3dH(_curve: BSplineCurve3dH): any; } //# sourceMappingURL=CurveCurveIntersectXY.d.ts.map