import { AnyCurve } from "../../curve/CurveChain"; import { BagOfCurves } from "../../curve/CurveCollection"; import { CurvePrimitive } from "../../curve/CurvePrimitive"; import { GeometryQuery } from "../../curve/GeometryQuery"; import { Loop } from "../../curve/Loop"; import { Path } from "../../curve/Path"; import { ChainTypes } from "../../curve/RegionOps"; import { Range3d } from "../../geometry3d/Range"; import { XYAndZ } from "../../geometry3d/XYZProps"; /** * Manage a growing array of arrays of curve primitives that are to be joined "head to tail" in paths. * * The caller makes a sequence of calls to announce individual primitives. * * This collector (unlike the simpler "ChainCollector") expects to have inputs arriving in random order, leaving multiple open chains in play at any time. * * chainCollector.announceCurvePrimitive (curve, searchAllPaths). * * When all curves have been announced, the call to grab the paths option restructures the various active chains into Path and Loop objects. * * Usage pattern is * * initialization: `context = new ChainCollectorContext (makeClones: boolean)` * * many times * * ` context.captureCurve (anyCurve, searchAllPaths)` * * ` context.captureCurvePrimitive (primitive, searchAllPaths)` * * end: ` result = context.grabResults (formLoopsIfClosed)` * @internal */ export declare class MultiChainCollector { private _chains; private static _staticPointA; private static _staticPointB; /** LOOSE tolerance for snap to end */ private _endPointShiftTolerance; /** TIGHT tolerance for snap to end */ private _endPointHitTolerance; /** tolerance for choosing Path or Loop. If undefined, ALWAYS PATH */ private _planarityTolerance; /** Initialize with an empty array of chains. * @param endPointShiftTolerance tolerance for calling endpoints identical * @param planeTolerance tolerance for considering a loop to be planar. If undefined, only create Path. If defined, create Loop curves are if within tolerance of a plane. */ constructor(endPointShiftTolerance?: number, planeTolerance?: number | undefined); private _xyzWork0?; /** * Find a chain (with index _other than_ exceptChainIndex) that starts or ends at xyz * @param xyz * @param tolerance * @param exceptChainIndex index of chain to ignore. Send -1 to consider all chains. */ private findAnyChainToConnect; private _xyzWork1?; /** * Insert a single curve primitive into the active chains. * * The primitive is captured (not cloned) * * The primitive may be reversed in place * @param candidate */ captureCurvePrimitive(candidate: CurvePrimitive): void; /** * Insert any curve into the collection. * * This recurses into Path, Loop, BagOfCurves etc * * The all primitives are captured, and may be reversed in place. * @param candidate */ captureCurve(candidate: GeometryQuery): void; /** Announce a curve primitive * * If a "nearby" connection is possible, insert the candidate in the chain and force endpoint match. * * Otherwise start a new chain. */ private attachPrimitiveToAnyChain; /** * * Move each primitive from chainB to the end of chainA. * * clear chainB. * * move the final chain to chainB index. * * reduce the _chain.length by 1. */ private mergeChainsForwardForward; private reverseChain; private searchAndMergeChainIndex; /** turn an array of curve primitives into the simplest possible strongly typed curve structure. * * The input array is assumed to be connected appropriately to act as the curves of a Path. * * When a path is created the curves array is CAPTURED. */ private promoteArrayToCurves; /** Return the collected results, structured as the simplest possible type. */ grabResult(makeLoopIfClosed?: boolean): CurvePrimitive | Path | BagOfCurves | Loop | undefined; } export declare class OffsetHelpers { static sumLengths(data: any): number; static extendRange(range: Range3d, data: any): Range3d; static appendOffsets(data: AnyCurve | AnyCurve[] | undefined, offset: number, result: GeometryQuery[], skipOffsetOfLoop: boolean): number; /** * * Restructure curve fragments as chains and offsets * * Return object with named chains, insideOffsets, outsideOffsets * * BEWARE that if the input is not a loop the classification of outputs is suspect. * @param fragments fragments to be chained * @param offsetDistance offset distance. */ static collectInsideAndOutsideOffsets(fragments: GeometryQuery[], offsetDistance: number, gapTolerance: number): { insideOffsets: GeometryQuery[]; outsideOffsets: GeometryQuery[]; chains: ChainTypes; }; /** * * Restructure curve fragments as chains and offsets * * Return object with named chains, insideOffsets, outsideOffsets * * BEWARE that if the input is not a loop the classification of outputs is suspect. * @param fragments fragments to be chained * @param offsetDistance offset distance. */ static collectChains(fragments: GeometryQuery[], gapTolerance: number, planarTolerance?: number): ChainTypes; /** If allowed by the geometry type, move an endpoint. * */ static simpleEndPointMove(g: CurvePrimitive, atEnd: boolean, to: XYAndZ): boolean; static moveHeadOrTail(g0: CurvePrimitive, g1: CurvePrimitive, maxShift: number): boolean; } //# sourceMappingURL=MultiChainCollector.d.ts.map