import { GrowableXYZArray } from "./GrowableXYZArray"; import { IndexedReadWriteXYZCollection, IndexedXYZCollection } from "./IndexedXYZCollection"; import { Point3d } from "./Point3dVector3d"; /** context class for Puecker-Douglas polyline compression, viz https://en.wikipedia.org/wiki/Ramer–Douglas–Peucker_algorithm * @internal */ export declare class PolylineCompressionContext { /** Caller provides source and tolerance. * * pointer to source is retained, but contents of source are never modified. */ private constructor(); private _source; private _dest; /** Squared tolerance for equal point. */ private _toleranceSquared; /** push (clone of) the point at index i from the source to the growing result. * * index is adjusted cyclically to source index range by modulo. */ private acceptPointByIndex; /** work data used by find max deviation */ private static _vector01; private static _vectorQ; /** * Return index of max magnitude of cross product of vectors (index to index+1) and (index to index+2) * * Return undefined if unable to find a nonzero cross product. * @param i0 first cross product central index. * @param i1 last cross product central index. */ private indexOfMaxCrossProduct; /** * Return interior index where max deviation in excess of tolerance occurs. * @param i0 first index of interval * @param i1 INCLUSIVE final index */ private indexOfMaxDeviation; /** * * @param i0 first active point index * @param i1 last active point index (INCLUSIVE -- not "one beyond") * @param chordTolerance * @param result */ private recursiveCompressByChordErrorGo; /** * Return a point array with a subset of the input points. * * This is a global analysis (Douglas-Peucker) * @param source input points. * @param chordTolerance Points less than this distance from a retained edge may be ignored. * Default is [[Geometry.smallMetricDistance]]. * @param keepSeam whether to preserve the endpoints of physically closed input. * Default is false, meaning the input points are treated cyclically, allowing removal of the seam. */ static compressPoint3dArrayByChordError(source: Point3d[], chordTolerance?: number, keepSeam?: boolean): Point3d[]; /** * * Return a polyline with a subset of the input points. * * This is a global analysis (Douglas-Peucker) * * Global search for vertices that are close to edges between widely separated neighbors. * * Recurses to smaller subsets. * @param source input points * @param dest output points. Must be different from source. * @param chordTolerance Points less than this distance from a retained edge may be ignored. * Default is [[Geometry.smallMetricDistance]]. * @param keepSeam whether to preserve the endpoints of physically closed input. * Default is false, meaning the input points are treated cyclically, allowing removal of the seam. */ static compressCollectionByChordError(source: IndexedXYZCollection, dest: IndexedReadWriteXYZCollection, chordTolerance?: number, keepSeam?: boolean): void; /** * Return a simplified subset of given points, omitting a point if very close to its predecessor. * * This is a local search, with a single pass over the data. * * First and last points are always retained. * @param data input points * @param maxEdgeLength length of largest edge to be compressed out */ static compressInPlaceByShortEdgeLength(data: GrowableXYZArray, maxEdgeLength: number): void; /** * Return a simplified subset of given points, omitting the middle of three successive points if the triangle they form is small. * * This is a local search, with a single pass over the data. * @param data input points * @param maxTriangleArea area of largest triangle to compress */ static compressInPlaceBySmallTriangleArea(data: GrowableXYZArray, maxTriangleArea: number): void; /** Copy points from source to dest, omitting those too close to edge between neighbors. * * First and last points are always preserved. */ static compressInPlaceByPerpendicularDistance(data: GrowableXYZArray, perpendicularDistance: number, maxExtensionFraction?: number): void; /** * IF the first and last points are close AND first and last segments are colinear, remove first and last points. Prior second to last becomes replicated start and end. * * Expected to be called "last" after other compressions, so points "next to" shared first and last are good to keep. * @param points * @param perpendicularDistance */ static compressColinearWrapInPlace(points: Point3d[], duplicatePointTolerance: number, colinearPointTolerance: number): void; } //# sourceMappingURL=PolylineCompressionByEdgeOffset.d.ts.map