import { BagOfCurves, CurveCollection } from "../curve/CurveCollection";
import { LinearCurvePrimitive } from "../curve/CurvePrimitive";
import { AnyChain } from "../curve/CurveTypes";
import { LineSegment3d } from "../curve/LineSegment3d";
import { LineString3d } from "../curve/LineString3d";
import { Loop } from "../curve/Loop";
import { Angle } from "../geometry3d/Angle";
import { GrowableXYZArray } from "../geometry3d/GrowableXYZArray";
import { IndexedXYZCollection } from "../geometry3d/IndexedXYZCollection";
import { Plane3d } from "../geometry3d/Plane3d";
import { Point3d, Vector3d } from "../geometry3d/Point3dVector3d";
import { Ray3d } from "../geometry3d/Ray3d";
import { Matrix4d } from "../geometry4d/Matrix4d";
import { MomentData } from "../geometry4d/MomentData";
import { HalfEdgeGraph } from "../topology/Graph";
import { FacetIntersectOptions, FacetLocationDetail } from "./FacetLocationDetail";
import { IndexedEdgeMatcher, SortableEdgeCluster } from "./IndexedEdgeMatcher";
import { Range2dSearchInterface } from "./multiclip/Range2dSearchInterface";
import { IndexedPolyface, Polyface, PolyfaceVisitor } from "./Polyface";
import { RangeLengthData } from "./RangeLengthData";
/**
 * Options carrier for sweeping linework onto meshes.
 * * The create method initializes all options.
 * @public
 */
export declare class SweepLineStringToFacetsOptions {
    /**
     * Vector towards the eye.
     * * In the common case of sweeping to an XY (e.g., ground or DTM) mesh, use the positive Z vector as an up vector.
     * * In general case, this is a vector from the mesh towards an eye at infinity.
     */
    vectorToEye: Vector3d;
    /** True to collect edges from facets that face towards the eye. */
    collectOnForwardFacets: boolean;
    /** True to collect facets that are "on the side", i.e., their outward vector is perpendicular to vectorToEye. */
    collectOnSideFacets: boolean;
    /** True to collect facets that face away from the eye. */
    collectOnRearFacets: boolean;
    /**
     * (Small) angle to use as tolerance for deciding if a facet is "on the side".
     * * Default (if given in degrees) is `Geometry.smallAngleDegrees`.
     */
    sideAngle: Angle;
    /** Option to assemble lines into chains. */
    assembleChains: boolean;
    /**
     * Optional searcher object for vertical sweep speedup. If provided, `vectorToEye` must be the positive Z vector.
     * @example To construct a 5x5 indexed search grid:
     * ````
     * const xyRange = Range2d.createFrom(myPolyface.range());
     * const searcher = GriddedRaggedRange2dSetWithOverflow.create<number>(xyRange, 5, 5)!;
     * for (const visitor = myPolyface.createVisitor(0); visitor.moveToNextFacet();) {
     *   searcher.addRange(visitor.point.getRange(), visitor.currentReadIndex());
     * }
     * ````
     */
    searcher?: Range2dSearchInterface<number>;
    /** Constructor. Captures fully-checked parameters from static create method. */
    private constructor();
    /**
     * Create an options structure.
     * * Default `vectorToEye` is (0,0,1).
     * * Default `sideAngle` is `Geometry.smallAngleRadians`.
     * * Default `assembleChains` is `true`.
     * * Default `collectOnForwardFacets`, `collectOnSideFacets`, `collectOnRearFacets` are all `true`.
     */
    static create(vectorToEye?: Vector3d, sideAngle?: Angle, assembleChains?: boolean, collectOnForwardFacets?: boolean, collectOnSideFacets?: boolean, collectOnRearFacets?: boolean, searcher?: Range2dSearchInterface<number>): SweepLineStringToFacetsOptions;
    /** Return `true` if all outputs are requested. */
    get collectAll(): boolean;
    /**
     * Decide if the instance collector flags accept a facet with the given normal.
     * * A facet whose facet normal has a positive, zero, or negative dot product with `vectorToEye` is classified
     * as forward, side, or rear, respectively.
     * * `undefined` facet normal returns `false`.
    */
    collectFromThisFacetNormal(facetNormal: Vector3d | undefined): boolean;
}
/**
 * Options carrier for [[PolyfaceQuery.fillSimpleHoles]].
 * @public
 */
export interface HoleFillOptions {
    /** Reject hole candidates if its boundary chain is longer than this limit. */
    maxPerimeter?: number;
    /** Reject hole candidates if they have more than this number of edges. */
    maxEdgesAroundHole?: number;
    /**
     * Reject hole candidates if their orientation is not COUNTERCLOCKWISE around this vector.
     * * For instance, use an upward Z vector for a DTM whose facets face upward. This suppresses incorrectly
     * treating the outer boundary as a hole.
     */
    upVector?: Vector3d;
    /** Requests that all content from the original mesh be copied to the mesh with filled holes. */
    includeOriginalMesh?: boolean;
}
/**
 * Selective output options for [[PolyfaceQuery.cloneOffset]]:
 * * `undefined` means the usual facets in the expected offset mesh.
 * * If present as a json object, the various booleans select respective outputs.
 * * @public
 */
export interface OffsetMeshSelectiveOutputOptions {
    outputOffsetsFromFacesBeforeChamfers?: boolean;
    outputOffsetsFromFaces?: boolean;
    outputOffsetsFromEdges?: boolean;
    outputOffsetsFromVertices?: boolean;
}
/**
 * Options carrier for [[PolyfaceQuery.cloneOffset]].
 * * Default options are strongly recommended.
 * * The option most likely to be changed is `chamferAngleBetweenNormals`.
 * @public
 */
export declare class OffsetMeshOptions {
    /** Max angle between normals to be considered smooth. */
    smoothSingleAngleBetweenNormals: Angle;
    /** Max accumulation of angle between normals to be considered smooth. */
    smoothAccumulatedAngleBetweenNormals: Angle;
    /**
     * When facets meet and the turn angle (i.e., angle between facet normals) is larger than
     * `chamferTurnAngleBetweenNormals`, a chamfer edge may be added to prevent offset mesh from having
     *  facets that extend out too far away from the source mesh.
     */
    chamferAngleBetweenNormals: Angle;
    /**
     * Optional control structure for selective output.
     * * If `undefined`, output all expected offset facets.
     */
    outputSelector?: OffsetMeshSelectiveOutputOptions;
    /** Constructor -- CAPTURE parameters. */
    private constructor();
    /**
     * Construct and return an `OffsetMeshOptions` with given parameters.
     * * Angles are forced to minimum values.
     * * Clones of the angles are given to the constructor.
     * @param smoothSingleRadiansBetweenNormals an angle larger than this (between facets) is considered a sharp edge.
     * Default value is `25` degrees.
     * @param smoothAccumulatedAngleBetweenNormals angles that sum to this much may be consolidated for average normal.
     * Default value is `60` degrees.
     * @param chamferTurnAngleBetweenNormals when facets meet and the turn angle (i.e., angle between facet normals)
     * is larger than `chamferTurnAngleBetweenNormals`, a chamfer edge may be added to prevent offset mesh from having
     * facets that extend out too far away from the source mesh. Default value is `120` degrees.
     */
    static create(smoothSingleAngleBetweenNormals?: Angle, smoothAccumulatedAngleBetweenNormals?: Angle, chamferTurnAngleBetweenNormals?: Angle): OffsetMeshOptions;
}
/**
 * Structure to return multiple results from volume between facets and plane.
 * @public
 */
export interface FacetProjectedVolumeSums {
    /** Summed (signed) volume. */
    volume: number;
    /** Summed area moments for positive contributions. */
    positiveProjectedFacetAreaMoments?: MomentData;
    /** Summed area moments for negative contributions. */
    negativeProjectedFacetAreaMoments?: MomentData;
}
/**
 * Enumeration of cases for retaining facets among duplicates.
 * @public
 */
export declare enum DuplicateFacetClusterSelector {
    /** Retain none of the duplicates. */
    SelectNone = 0,
    /** Retain any one member among duplicates. */
    SelectAny = 1,
    /** Retain all members among duplicates. */
    SelectAll = 2,
    /** Retain one from any cluster with an odd number of faces. */
    SelectOneByParity = 3
}
/**
 * Announce the points on a drape panel.
 * * The first two points in the array are always along the draped line segment.
 * * The last two are always on the facet.
 * * If there are 4 points, those two pairs are distinct, i.e. both segment points are to the same side of the facet.
 * * If there are 3 points, those two pairs share an on-facet point.
 * * The panel is ordered so the outward normal is to the right of the draped segment.
 * @param indexAOnFacet index (in points) of the point that is the first facet point for moving forward along the linestring.
 * @param indexBOnFacet index (in points) of the point that is the second facet point for moving forward along the linestring.
 * @public
 */
export type AnnounceDrapePanel = (linestring: IndexedXYZCollection, segmentIndex: number, polyface: Polyface, facetIndex: number, points: Point3d[], indexAOnFacet: number, indexBOnFacet: number) => any;
/**
 * PolyfaceQuery is a static class whose methods implement queries on a `Polyface` or `PolyfaceVisitor` provided as a
 * parameter to each method.
 * @public
 */
export declare class PolyfaceQuery {
    /** Copy the points from a visitor into a linestring loop. */
    static visitorToLoop(visitor: PolyfaceVisitor): Loop;
    /** Create a linestring loop for each facet of the polyface. */
    static indexedPolyfaceToLoops(polyface: Polyface): BagOfCurves;
    /**
     * Sum all facet areas.
     * @param source polyface or visitor.
     * @param vectorToEye compute sum of (signed) facet areas projected to a view plane perpendicular to `vectorToEye`.
     * If `vectorToEye` is not provided, actual facet areas are calculated (without any projection).
     * @returns the sum of all facet areas.
     */
    static sumFacetAreas(source: Polyface | PolyfaceVisitor, vectorToEye?: Vector3d): number;
    /**
     * Sum volumes of tetrahedra from origin to all facets.
     * * If origin is `undefined`, the first point encountered (by the visitor) is used as origin.
     * * If the mesh is closed, this sum is the volume.
     * * If the mesh is not closed, this sum is the volume of a mesh with various additional facets from the origin
     * to facets.
     */
    static sumTetrahedralVolumes(source: Polyface | PolyfaceVisitor, origin?: Point3d): number;
    /**
     * Sum (signed) volumes between facets and a plane.
     * @param source facet set
     * @param plane infinite plane bounding volume between the input facets and (virtual) side facets perpendicular to the plane.
     * @param skipMoments whether to skip computation of the area moments. Set to `true` if only volume is needed. Default is `false`.
     * @returns a structure with multiple sums:
     * * volume: the sum of (signed) volumes between facets and the plane.
     * * positiveProjectedFacetAreaMoments, negativeProjectedFacetAreaMoments: area moment data (centroid, signed area,
     * and second moments with respect to the centroid), separately computed for the input facets that project with
     * positive/negative area onto the plane.
     */
    static sumVolumeBetweenFacetsAndPlane(source: Polyface | PolyfaceVisitor, plane: Plane3d, skipMoments?: boolean): FacetProjectedVolumeSums;
    /** Return the inertia products [xx,xy,xz,xw,yw, etc] integrated over all all facets as viewed from origin. */
    static sumFacetSecondAreaMomentProducts(source: Polyface | PolyfaceVisitor, origin: Point3d): Matrix4d;
    /** Return the inertia products [xx,xy,xz,xw,yw, etc] integrated over all tetrahedral volumes from origin. */
    static sumFacetSecondVolumeMomentProducts(source: Polyface | PolyfaceVisitor, origin: Point3d): Matrix4d;
    /**
     * Compute area moments for the mesh. In the returned `MomentData`:
     * * `origin` is the centroid.
     * * `localToWorldMap` has the origin and principal directions.
     * * `radiiOfGyration` radii for rotation around the x,y,z axes.
     */
    static computePrincipalAreaMoments(source: Polyface): MomentData | undefined;
    /**
     * Compute area moments for the mesh. In the returned MomentData:
     * * `origin` is the centroid.
     * * `localToWorldMap` has the origin and principal directions.
     * * `radiiOfGyration` radii for rotation around the x,y,z axes.
     * * The result is only valid if the mesh is closed.
     * * There is no test for closure. Use `PolyfaceQuery.isPolyfaceClosedByEdgePairing(polyface)` to test for closure.
     */
    static computePrincipalVolumeMoments(source: Polyface): MomentData | undefined;
    /**
     * Determine whether all facets are convex.
     * @param source polyface or visitor.
     * @returns `true` if all facets are convex; `false` otherwise.
     */
    static areFacetsConvex(source: Polyface | PolyfaceVisitor): boolean;
    /**
     * Compute a number summarizing the dihedral angles in the mesh.
     * * A dihedral angle is the signed angle between adjacent facets' normals. This angle is positive when the cross
     * product `normalA x normalB` has the same direction as facetA's traversal of the facets' shared edge.
     * @param source facets.
     * @param ignoreBoundaries if `true` ignore simple boundary edges, i.e., allow unclosed meshes. Default is `false`.
     * See [[isConvexByDihedralAngleCount]] for comments about passing true when there are multiple
     * connected components.
     * * Return `0` if all dihedral angles are zero (and `ignoreBoundaries === true`). The mesh is planar.
     * * Otherwise, return `1` if all dihedral angles are non-negative. The mesh probably encloses a convex volume and
     * has outward normals.
     * * Otherwise, return `-1` if all dihedral angles are non-positive. The mesh probably encloses a convex volume and
     * has inward normals.
     * * Otherwise, return `-2`. Also return `-2` if a non-manifold condition was detected, or a facet normal could not
     * be computed. A non-manifold condition is a positive-length edge adjacent to more than 2 facets or (if
     * `ignoreBoundaries` is false) adjacent to exactly one facet.
     */
    static dihedralAngleSummary(source: Polyface | PolyfaceVisitor, ignoreBoundaries?: boolean): number;
    /**
   * Test for convex volume by dihedral angle tests on all edges.
   * * This tests if all dihedral angles of the mesh are positive.
   * * In a closed solid, this is a strong test for overall mesh convexity with outward facing normals.
   * * See [[dihedralAngleSummary]] for the definition of "dihedral angle".
   * * With `ignoreBoundaries` true, this may be a useful test when all the facets are in a single edge-connected
   * component, such as a pyramid with no underside.
   * * It is not a correct test if there are multiple, disjoint components.
   * * Take the above-mentioned pyramid with no underside.
   * * Within the same mesh, have a second pyramid placed to the side, still facing upward.
   * * The angles will pass the dihedral convexity test, but the composite thing surely is not convex.
   * @param source mesh.
   * @param ignoreBoundaries if `true` ignore simple boundary edges, i.e., allow unclosed meshes. Default is `false`.
   * @returns true if all dihedral angles of the mesh are positive.
   */
    static isConvexByDihedralAngleCount(source: Polyface | PolyfaceVisitor, ignoreBoundaries?: boolean): boolean;
    /** Helper function to detect a subset visitor. */
    static isSubsetVisitor(visitor: Polyface | PolyfaceVisitor): boolean;
    /**
     * Faster version of isPolyfaceManifold for specific input.
     * @returns whether the mesh is manifold, or undefined if unsuccessful.
     */
    private static isPolyfaceManifoldFast;
    /**
     * Test edge pairing in `source` mesh.
     * * Any edge with 3 or more adjacent facets triggers `false` return.
     * * Any edge with 2 adjacent facets in the same direction triggers `false` return.
     * * Null edges are ignored.
     * @param source facet set to examine
     * @param allowSimpleBoundaries if `false` (default), a return value of `true` means the facets form a closed
     * 2-manifold surface; if `true`, a return value of `true` means the facets form a 2-manifold surface which may
     * have a boundary, but is still properly matched internally.
    */
    static isPolyfaceManifold(source: Polyface | PolyfaceVisitor, allowSimpleBoundaries?: boolean): boolean;
    /** Test if the facets in `source` occur in perfectly mated pairs, as is required for a closed manifold volume. */
    static isPolyfaceClosedByEdgePairing(source: Polyface | PolyfaceVisitor): boolean;
    /**
     * Faster version of announceBoundaryEdges for specific input.
     * @returns true if successfully announced boundary edges.
     */
    private static announceBoundaryEdgesFast;
    /**
     * Announce boundary edges of the facet set as line segments.
     * @param source polyface or visitor.
     * @param announceEdge function to be called with each boundary edge. The announcement is start and end points,
     * start and end vertex indices, and facet index.
     * @param includeTypical true to announce typical boundary edges with a single adjacent facet. Default is true.
     * @param includeMismatch true to announce non-manifold edges (more than 2 adjacent facets, or mismatched
     * orientations). Default is true.
     * @param includeNull true to announce edges with identical start and end vertex indices. Default is true.
     * @see [[announceBoundaryChainsAsLineString3d]] for boundary linestring announcement
     * @see [[collectBoundaryEdges]] for boundary chain collection
     * @see [[boundaryEdges]] for boundary edge collection
     */
    static announceBoundaryEdges(source: Polyface | PolyfaceVisitor, announceEdge: (pointA: Point3d, pointB: Point3d, indexA: number, indexB: number, facetIndex: number) => void, includeTypical?: boolean, includeMismatch?: boolean, includeNull?: boolean): void;
    /**
     * Collect boundary edges of the facet set as an unordered collection of line segments.
     * @param source polyface or visitor.
     * @param includeTypical true to include typical boundary edges with a single adjacent facet. Default is true.
     * @param includeMismatch true to include non-manifold edges (more than 2 adjacent facets, or mismatched
     * orientations). Default is true.
     * @param includeNull true to include edges with identical start and end vertex indices. Default is true.
     * @see [[announceBoundaryChainsAsLineString3d]] for boundary linestring announcement
     * @see [[collectBoundaryEdges]] for boundary chain collection
     * @see [[announceBoundaryEdges]] for boundary edge announcement
     */
    static boundaryEdges(source: Polyface | PolyfaceVisitor, includeTypical?: boolean, includeMismatch?: boolean, includeNull?: boolean): CurveCollection | undefined;
    /**
     * Collect boundary edges of the facet set as the simplest collection of chains of line segments.
     * @param source polyface or visitor.
     * @param includeTypical true to include typical boundary edges with a single adjacent facet. Default is true.
     * @param includeMismatch true to include non-manifold edges (more than 2 adjacent facets, or mismatched
     * orientations). Default is true.
     * @param includeNull true to include edges with identical start and end vertex indices. Default is true.
     * @see [[announceBoundaryChainsAsLineString3d]] for boundary linestring announcement
     * @see [[announceBoundaryEdges]] for boundary edge announcement
     * @see [[boundaryEdges]] for boundary edge collection
     */
    static collectBoundaryEdges(source: Polyface | PolyfaceVisitor, includeTypical?: boolean, includeMismatch?: boolean, includeNull?: boolean): AnyChain | undefined;
    /**
     * Load an IndexedEdgeMatcher from the edges of a mesh.
     * @param polyface a mesh or visitor
     */
    static createIndexedEdges(polyface: Polyface | PolyfaceVisitor): IndexedEdgeMatcher;
    /**
     * Invoke the callback on each manifold edge whose adjacent facet normals form vectorToEye dot products
     * with opposite sign.
     * * The callback is not called on boundary edges.
     * @param source polyface or visitor.
     * @param announce callback function invoked on manifold silhouette edges.
     * @param vectorToEye normal of plane in which to compute silhouette edges.
     * @param sideAngle angular tolerance for perpendicularity test.
     */
    static announceSilhouetteEdges(source: Polyface | PolyfaceVisitor, announce: (pointA: Point3d, pointB: Point3d, vertexIndexA: number, vertexIndexB: number, facetIndex: number) => void, vectorToEye: Vector3d, sideAngle?: Angle): void;
    /**
     * Collect manifold edges whose adjacent facet normals form vectorToEye dot products with opposite sign.
     * * Does not return boundary edges.
     * * Return the edges as chains of line segments.
     * @param source polyface or visitor.
     * @param vectorToEye normal of plane in which to compute silhouette edges.
     * @param sideAngle angular tolerance for perpendicularity test.
     */
    static collectSilhouetteEdges(source: Polyface | PolyfaceVisitor, vectorToEye: Vector3d, sideAngle?: Angle): AnyChain | undefined;
    /**
     * Find segments (within the linestring) which project to facets.
     * * Announce each pair of linestring segment and on-facet segment through a callback.
     * * Facets are ASSUMED to be convex and planar, and not overlap in the z direction.
     */
    static announceSweepLinestringToConvexPolyfaceXY(linestringPoints: IndexedXYZCollection, polyface: Polyface, announce: AnnounceDrapePanel): void;
    private static _asyncWorkLimit;
    /**
     * Set the limit on work during an async time blocks, and return the old value.
     * * This should be a large number -- default is 1.0e6
     * @internal
     */
    static setAsyncWorkLimit(value: number): number;
    /**
     * Query the current limit on work during an async time block.
     * @internal
     */
    static get asyncWorkLimit(): number;
    /**
     * Number of "await" steps executed in recent async calls.
     * @internal
     */
    static awaitBlockCount: number;
    /** Execute `context.projectToPolygon` until its work estimates accumulate to workLimit.  */
    private static continueAnnounceSweepLinestringToConvexPolyfaceXY;
    /**
     * Find segments (within the linestring) which project to facets.
     * * Announce each pair of linestring segment and on-facet segment through a callback.
     * * Facets are ASSUMED to be convex and planar, and not overlap in the z direction.
     * * REMARK: Although this is public, the usual use is via slightly higher level public methods, viz:
     *   * asyncSweepLinestringToFacetsXYReturnChains
     * @internal
     */
    static asyncAnnounceSweepLinestringToConvexPolyfaceXY(linestringPoints: IndexedXYZCollection, polyface: Polyface, announce: AnnounceDrapePanel): Promise<number>;
    /**
     * Search the facets for facet subsets that are connected with at least vertex contact.
     * * Return array of arrays of facet indices.
     */
    static partitionFacetIndicesByVertexConnectedComponent(polyface: Polyface | PolyfaceVisitor): number[][];
    /**
     * * Examine the normal orientation for each faces.
     * * Separate to 3 partitions:
     *    * Facets with normal in the positive direction of the vectorToEye (partition 0).
     *    * Facets with normal in the negative direction of the vectorToEye (partition 1).
     *    * Facets nearly perpendicular to the view vector  (partition 2).
     * * Return array of arrays of facet indices.
     */
    static partitionFacetIndicesByVisibilityVector(polyface: Polyface | PolyfaceVisitor, vectorToEye: Vector3d, sideAngleTolerance: Angle): number[][];
    /**
     * Return the boundary of facets that are facing the eye.
     * @param source polyface or visitor. Must be capable of constructing a subset visitor.
     * @param visibilitySubset selector among the visible facet sets extracted by partitionFacetIndicesByVisibilityVector
     *   * 0 ==> forward facing
     *   * 1 ==> rear facing
     *   * 2 ==> side facing
     * @param vectorToEye the vector to eye
     * @param sideAngleTolerance the tolerance of side angle
     */
    static boundaryOfVisibleSubset(source: Polyface | PolyfaceVisitor, visibilitySelect: 0 | 1 | 2, vectorToEye: Vector3d, sideAngleTolerance?: Angle): CurveCollection | undefined;
    /**
     * Announce boundary edges of the facet set as linestrings.
     * * Ignores non-manifold interior edges and null edges.
     * @param source polyface or visitor.
     * @param announceChain function to be called with each chain of boundary edges.
     * @see [[collectBoundaryEdges]] for boundary chain collection
     * @see [[announceBoundaryEdges]] for boundary edge announcement
     * @see [[boundaryEdges]] for boundary edge collection
     */
    static announceBoundaryChainsAsLineString3d(source: Polyface | PolyfaceVisitor, announceChain: (points: LineString3d) => void): void;
    /**
     * Return a mesh with
     *  * clusters of adjacent, coplanar facets merged into larger (possibly non-convex) facets.
     *  * other facets are unchanged.
     * @param mesh existing mesh or visitor.
     * @param maxSmoothEdgeAngle maximum dihedral angle across an edge between facets deemed coplanar. If undefined,
     * uses `Geometry.smallAngleRadians`.
     */
    static cloneWithMaximalPlanarFacets(mesh: Polyface | PolyfaceVisitor, maxSmoothEdgeAngle?: Angle): IndexedPolyface;
    /**
     * Return a mesh with "some" holes filled in with new facets.
     *  * Candidate chains are computed by [[announceBoundaryChainsAsLineString3d]].
     *  * Unclosed chains are rejected.
     *  * Closed chains are triangulated and returned as a mesh.
     *  * The options structure enforces restrictions on how complicated the hole filling can be:
     *     * maxEdgesAroundHole -- holes with more edges are skipped.
     *     * maxPerimeter -- holes with larger summed edge lengths are skipped.
     *     * upVector -- holes that do not have positive area along this view are skipped.
     *     * includeOriginalMesh -- includes the original mesh in the output mesh, so the composite mesh is a
     * clone with holes filled.
     * @param mesh existing mesh.
     * @param options options controlling the hole fill.
     * @param unfilledChains optional array to receive the points around holes that were not filled.
     */
    static fillSimpleHoles(mesh: Polyface | PolyfaceVisitor, options: HoleFillOptions, unfilledChains?: LineString3d[]): IndexedPolyface | undefined;
    /** Clone the facets in each partition to a separate polyface. */
    static clonePartitions(polyface: Polyface | PolyfaceVisitor, partitions: number[][]): IndexedPolyface[];
    /** Clone facets that pass a filter function. */
    static cloneFiltered(source: Polyface | PolyfaceVisitor, filter: (visitor: PolyfaceVisitor) => boolean): IndexedPolyface;
    /** Clone the facets with in-facet dangling edges removed. */
    static cloneWithDanglingEdgesRemoved(source: Polyface | PolyfaceVisitor): IndexedPolyface;
    /**
     * Return the point count of the `source`.
     * * If `source` is a visitor, this is an upper bound on the number of addressed mesh vertices.
     */
    static visitorClientPointCount(source: Polyface | PolyfaceVisitor): number;
    /**
     * Return the facet count of the `source`.
     * * If `source` is a visitor, this is the number of facets it can visit.
     */
    static visitorClientFacetCount(source: Polyface | PolyfaceVisitor): number;
    /**
     * Partition the facet set into connected components such that two adjacent facets are in the same component if and
     * only if they are adjacent across a clustered edge.
     * @param edgeClusters sorted and clustered edges (cf. `IndexedEdgeMatcher.sortAndCollectClusters`).
     * @param numFacets facet count in the parent mesh. In particular, `edge.facetIndex < numFacets` for every input edge.
     * @return collection of facet index arrays, one array per connected component.
     */
    private static partitionFacetIndicesBySortableEdgeClusters;
    /**
     * Partition the facet set into connected components. Each facet in a given component shares an edge only with
     * other facets in the component (or is a boundary edge).
     * @param polyface facets to partition.
     * @param stopAtVisibleEdges whether to further split connected components by visible edges of the polyface.
     * @return collection of facet index arrays, one per connected component.
     */
    static partitionFacetIndicesByEdgeConnectedComponent(polyface: Polyface | PolyfaceVisitor, stopAtVisibleEdges?: boolean): number[][];
    /**
     * Find segments (within the line string) which project to facets.
     * * Assemble each input segment paired with its projected segment/point as a quad/triangle facet in a new polyface.
     * * Input facets are ASSUMED to be convex and planar, and not overlap in the z direction.
     */
    static sweepLineStringToFacetsXYReturnSweptFacets(lineStringPoints: IndexedXYZCollection, polyface: Polyface): Polyface;
    /** @deprecated in 4.7.0 - will not be removed until after 2026-06-13. Use [[sweepLineStringToFacetsXYReturnSweptFacets]] instead. */
    static sweepLinestringToFacetsXYreturnSweptFacets(linestringPoints: GrowableXYZArray, polyface: Polyface): Polyface;
    /**
     * Sweep the line string to intersections with a mesh and return collected line segments.
     * * Facets are ASSUMED to be convex and planar, and not overlap in the sweep direction.
     * @param points the linestring to drape onto the mesh.
     * @param source target facet set. For best results, facets should be convex and planar.
     * @param options input, filtering, search, and output options.
     * * If `undefined`, the default sweep direction is the positive z-axis, and chains are assembled and returned.
     * * For faster _vertical_ sweep, a pre-computed range tree can be supplied in `options.searcher`.
     * * For faster _non-vertical_ sweep, first transform inputs with the inverse of the transform
     * `T = Transform.createRigidFromOriginAndVector(undefined, options.vectorToEye)`, construct the searcher on these
     * local facets, call `sweepLineStringToFacets/XY` with these local inputs (and default sweep direction), and lastly,
     * transform the returned draped linework back to world coordinates with `T`.
     */
    static sweepLineStringToFacets(points: IndexedXYZCollection, source: Polyface | PolyfaceVisitor, options?: SweepLineStringToFacetsOptions): LinearCurvePrimitive[];
    /**
     * Sweep the line string in the z-direction to intersections with a mesh, using a search object for speedup.
     * @param points the linestring to drape onto the mesh.
     * @param source target facet set. For best results, facets should be convex and planar.
     * @param searcher object for searching facet 2D ranges tagged by mesh read index.
     * @returns the collected line strings.
     * @see [[sweepLineStringToFacets]] for further options.
     */
    static sweepLineStringToFacetsXY(points: IndexedXYZCollection | Point3d[], source: Polyface | PolyfaceVisitor, searcher: Range2dSearchInterface<number>): LineString3d[];
    /**
     * Find segments (within the linestring) which project to facets.
      * * Return collected line segments.
      * * This calls [[sweepLineStringToFacets]] with options created by
      *   `const options = SweepLineStringToFacetsOptions.create(Vector3d.unitZ(), Angle.createSmallAngle(), false, true, true, true);`
      * @deprecated in 4.7.0 - will not be removed until after 2026-06-13. Use [[PolyfaceQuery.sweepLineStringToFacets]] to get further options.
      */
    static sweepLinestringToFacetsXYReturnLines(linestringPoints: GrowableXYZArray, polyface: Polyface): LineSegment3d[];
    /**
     * Find segments (within the linestring) which project to facets.
     * * Return chains.
     * * This calls [[sweepLineStringToFacets]] with default options.
     * @deprecated in 4.7.0 - will not be removed until after 2026-06-13. Use [[PolyfaceQuery.sweepLineStringToFacets]] to get further options.
     */
    static sweepLinestringToFacetsXYReturnChains(linestringPoints: GrowableXYZArray, polyface: Polyface): LineString3d[];
    /**
     * Find segments (within the linestring) which project to facets.
     * * This is done as a sequence of "await" steps.
     * * Each "await" step deals with approximately PolyfaceQuery.asyncWorkLimit pairings of "linestring edge"
     * with "facet edge".
     * * PolyfaceQuery.setAsyncWorkLimit() to change work blocks from default.
     * * Return chains.
     * * Facets are ASSUMED to be convex and planar, and not overlap in the z direction.
     */
    static asyncSweepLinestringToFacetsXYReturnChains(linestringPoints: IndexedXYZCollection, polyface: Polyface): Promise<LineString3d[]>;
    /**
     * Examine ranges of facets.
     * * Return statistical summary of x,y,z ranges.
     */
    static collectRangeLengthData(polyface: Polyface | PolyfaceVisitor): RangeLengthData;
    /**
     * Clone the facets, inserting vertices (within edges) where points not part of each facet's vertex indices
     * impinge within edges.
     */
    static cloneWithTVertexFixup(polyface: Polyface): IndexedPolyface;
    /**
     * Compare index arrays formatted as follows. Return 0 if arrays are the same.
     * * Each array input structure is: [facetIndex, vertexIndex0, vertexIndex1, ....]
     * * Vertex indices assumed reversed so:
     *   * vertexIndex0 is the lowest index on the facet.
     *   * vertexIndex1 is the lowest neighbor of vertex0.
     *   * first different entry among vertex indices determines lexical result.
     *   * hence facets with duplicate indices (whether forward or reversed) are considered equal.
     */
    private static compareFacetIndexAndVertexIndices;
    /**
     * Announce facet duplicates.
     * @returns an array of arrays describing facet duplication. Each array `entry` in the output contains read
     * indices of a cluster of facets with the same vertex indices.
     */
    static announceDuplicateFacetIndices(polyface: Polyface, announceCluster: (clusterFacetIndices: number[]) => void): void;
    /**
     * Collect facet duplicates.
     * @param polyface the polyface.
     * @param includeSingletons if true, non-duplicated facets are included in the output.
     * @returns an array of arrays describing facet duplication. Each array `entry` in the output contains read
     * indices of a cluster of facets with the same vertex indices.
     */
    static collectDuplicateFacetIndices(polyface: Polyface, includeSingletons?: boolean): number[][];
    /**
     * Return a new facet set from the source facets, specifying how to copy duplicate facets.
     * @param source the polyface.
     * @param includeSingletons true to copy facets that only appear once
     * @param clusterSelector indicates whether to copy 0, 1, or all facets in each cluster of duplicate facets.
     */
    static cloneByFacetDuplication(source: Polyface, includeSingletons: boolean, clusterSelector: DuplicateFacetClusterSelector): Polyface;
    /** Clone the facets, removing points that are simply within colinear edges. */
    static cloneWithColinearEdgeFixup(polyface: Polyface): Polyface;
    /**
     * Set the edge visibility for specified edges in the polyface.
     * @param polyface mesh to be edited.
     * @param clusters array of edge references.
     * @param value visibility value (true or false).
     */
    private static setEdgeVisibility;
    /**
     * Set the visibility of a particular edge of a particular facet.
     * @param polyface containing polyface.
     * @param facetIndex facet index.
     * @param vertexIndex vertex index (in vertex array) at which the edge starts.
     * @param value visibility value.
     */
    static setSingleEdgeVisibility(polyface: IndexedPolyface, facetIndex: number, vertexIndex: number, value: boolean): void;
    /**
     * Get the visibility of a particular edge of a particular facet.
     * @param polyface containing polyface.
     * @param facetIndex facet index.
     * @param vertexIndex vertex index (in vertex array) at which the edge starts.
     */
    static getSingleEdgeVisibility(polyface: IndexedPolyface, facetIndex: number, vertexIndex: number): boolean | undefined;
    /**
     * Return manifold edge pairs whose dihedral angle is bounded by the given angle.
     * * The dihedral angle of a manifold edge is measured between the normals of its two adjacent faces.
     * * Boundary edges are not returned as they are not manifold.
     * @param mesh existing polyface or visitor.
     * @param maxSmoothEdgeAngle maximum dihedral angle of a smooth edge. If `undefined`, uses `Geometry.smallAngleRadians`.
     * @param sharpEdges true to reverse the angle threshold test and return sharp edges; otherwise return smooth edges (default).
     */
    static collectEdgesByDihedralAngle(mesh: Polyface | PolyfaceVisitor, maxSmoothEdgeAngle?: Angle, sharpEdges?: boolean): SortableEdgeCluster[];
    /**
     * Make paired edges invisible.
    * * Find mated pairs among facet edges.
    * * Mated pairs have the same vertex indices appearing in opposite order.
    * * Mark all non-mated pairs visible.
    * * At mated pairs
    *    * if angle across the edge is larger than `sharpEdgeAngle`, mark visible
    *    * otherwise mark invisible.
    */
    static markPairedEdgesInvisible(mesh: IndexedPolyface, sharpEdgeAngle?: Angle): void;
    /**
     * Try to compute a unit normal for a facet accessible through a visitor.
     * * Unit normal is computed by `PolygonOps.unitNormal` with the points around the facet.
     */
    static computeFacetUnitNormal(visitor: PolyfaceVisitor, facetIndex: number, result?: Vector3d): Vector3d | undefined;
    /**
     * * Mark all edge visibilities in the IndexedPolyface.
     * @param mesh mesh to be marked.
     * @param value true for visible, false for hidden.
     */
    static markAllEdgeVisibility(mesh: IndexedPolyface, value: boolean): void;
    /**
     * Create a HalfEdgeGraph with a face for each facet of the IndexedPolyface.
     * @param mesh mesh to convert.
     * @internal
     */
    static convertToHalfEdgeGraph(mesh: IndexedPolyface): HalfEdgeGraph;
    /** Examine adjacent facet orientations throughout the mesh. If possible, reverse a subset to achieve proper pairing. */
    static reorientVertexOrderAroundFacetsForConsistentOrientation(mesh: IndexedPolyface): boolean;
    /** Set up indexed normals with one normal in the plane of each facet of the mesh. */
    static buildPerFaceNormals(polyface: IndexedPolyface): void;
    /**
    * * At each vertex of the mesh:
    *   * Find clusters of almost parallel normals.
    *   * Compute simple average of those normals.
    *   * Index to the averages.
    * * For typical meshes, this correctly clusters adjacent normals.
    * * One can imagine a vertex with multiple "smooth cone-like" sets of adjacent facets such that averaging occurs
    * among two nonadjacent cones. But this does not seem to be a problem in practice.
    * @param polyface polyface to update.
    * @param toleranceAngle averaging is done between normals up to this angle.
    */
    static buildAverageNormals(polyface: IndexedPolyface, toleranceAngle?: Angle): void;
    /**
     * Offset the faces of the mesh.
     * @param source original mesh.
     * @param signedOffsetDistance distance to offset
     * @param offsetOptions angle options. The default options are recommended.
     * @returns shifted mesh.
     */
    static cloneOffset(source: IndexedPolyface, signedOffsetDistance: number, offsetOptions?: OffsetMeshOptions): IndexedPolyface;
    private static _workTriangle?;
    private static _workTriDetail?;
    private static _workPolyDetail?;
    private static _workFacetDetail3?;
    private static _workFacetDetailC?;
    private static _workFacetDetailNC?;
    /**
     * Search facets for the first one that intersects the infinite line.
     * * To process _all_ intersections, callers can supply an `options.acceptIntersection` callback that always
     * returns `false`. In this case, `intersectRay3d` will return `undefined`, but the callback will be invoked for
     * each intersection.
     * * Example callback logic:
     *    * Accept the first found facet that intersects the half-line specified by the ray: `return detail.a >= 0.0;`
     *    * Collect all intersections: `myIntersections.push(detail.clone()); return false;` Then after `intersectRay3d`
     * returns, sort along `ray` with `myIntersections.sort((d0, d1) => d0.a - d1.a);`
     * @param visitor facet iterator.
     * @param ray infinite line parameterized as a ray. The returned `detail.a` is the intersection parameter on the
     * ray, e.g., zero at `ray.origin` and increasing in `ray.direction`.
     * @param options options for computing and populating an intersection detail, and an optional callback for
     * accepting one.
     * @return detail for the (accepted) intersection with `detail.IsInsideOrOn === true`, or `undefined` if no
     * (accepted) intersection.
     * @see PolygonOps.intersectRay3d
    */
    static intersectRay3d(visitor: Polyface | PolyfaceVisitor, ray: Ray3d, options?: FacetIntersectOptions): FacetLocationDetail | undefined;
}
//# sourceMappingURL=PolyfaceQuery.d.ts.map