import { PlaneAltitudeEvaluator } from "../Geometry";
import { Angle } from "../geometry3d/Angle";
import { AngleSweep } from "../geometry3d/AngleSweep";
import { Ellipsoid, GeodesicPathPoint } from "../geometry3d/Ellipsoid";
import { IndexedXYZCollection } from "../geometry3d/IndexedXYZCollection";
import { Plane3dByOriginAndUnitNormal } from "../geometry3d/Plane3dByOriginAndUnitNormal";
import { Point3d, Vector3d } from "../geometry3d/Point3dVector3d";
import { Ray3d } from "../geometry3d/Ray3d";
import { XAndY } from "../geometry3d/XYZProps";
import { IndexedPolyface } from "../polyface/Polyface";
import { RuledSweep } from "../solid/RuledSweep";
import { Arc3d } from "./Arc3d";
import { CurveChain } from "./CurveCollection";
import { CurvePrimitive } from "./CurvePrimitive";
import { AnyCurve } from "./CurveTypes";
import { GeometryQuery } from "./GeometryQuery";
import { LineString3d } from "./LineString3d";
import { Loop } from "./Loop";
import { Path } from "./Path";
import { IntegratedSpiralTypeName } from "./spiral/TransitionSpiral3d";
import { StrokeOptions } from "./StrokeOptions";
/**
 * Interface to carry parallel arrays of planes and sections, and optional geometry assembled from them,
 * as returned by [CurveFactory.createMiteredSweepSections].
 * @public
 */
export interface SectionSequenceWithPlanes {
    /** The plane of each section. */
    planes: Plane3dByOriginAndUnitNormal[];
    /** Section curve projected onto the corresponding plane. */
    sections: AnyCurve[];
    /**
     * Optional `RuledSweep` generated from the sections.
     * * The `RuledSweep` and sections array refer to the same section objects.
     */
    ruledSweep?: RuledSweep;
    /** Optional mesh generated from the `RuledSweep` generated from the sections. */
    mesh?: IndexedPolyface;
}
/**
 * Enumeration of geometric output for [CurveFactory.createMiteredSweepSections].
 * @public
 */
export declare enum MiteredSweepOutputSelect {
    /** Output only the parallel arrays of planes and sections. */
    Sections = 0,
    /** Output planes and sections, as well as the assembled ruled sweep. */
    AlsoRuledSweep = 1,
    /** Output planes and sections, as well as the assembled ruled sweep and its stroked mesh. */
    AlsoMesh = 2
}
/**
 * Interface bundling options for [CurveFactory.createMiteredSweepSections].
 * @public
 */
export interface MiteredSweepOptions {
    /** Whether first and last planes are averaged and equated when the centerline is physically closed. Default value is `false`. */
    wrapIfPhysicallyClosed?: boolean;
    /** Whether to output sections only, or sections plus optional geometry constructed from them. Default value is `MiteredSweepOutputSelect.Sections`. */
    outputSelect?: MiteredSweepOutputSelect;
    /** How to stroke smooth input curves. If undefined, default stroke options are used. */
    strokeOptions?: StrokeOptions;
    /** Whether to cap the ruled sweep if outputting a ruled sweep or mesh. Default value is `false`. */
    capped?: boolean;
    /** The first section's normal is aligned to this vector, typically the start tangent of the smooth curve stroked for the centerline. */
    startTangent?: Vector3d;
    /** The last section's normal is aligned to this vector, typically the end tangent of the smooth curve stroked for the centerline. */
    endTangent?: Vector3d;
}
/**
 * Interface bundling options for [[CurveFactory.createFilletsInLineString]].
 * @public
 */
export interface CreateFilletsInLineStringOptions {
    /**
     * Allow creation of retrograde edges to join large-radius fillets.
     * * If `true` (default), cusps are present in the output `Path` when the radius is too large.
     * * If `false`, a fillet with overly large radius is disallowed, resulting in a simple corner.
    */
    allowCusp?: boolean;
    /**
     * Whether to fillet the closure.
     * * If `true`, the input line string is treated as a polygon (closure point optional), and the output `Path` is
     * closed and has a fillet at its start point. If both first and last input points are identical, the last point's
     * entry in the radius array is ignored.
     * * If `false` (default), the first and last points receive no fillet and their respective entries in the radius
     * array are ignored.
     */
    filletClosure?: boolean;
}
/**
 * The `CurveFactory` class contains methods for specialized curve constructions.
 * @public
 */
export declare class CurveFactory {
    /** (Cautiously) construct and save a line segment between fractional positions. */
    private static addPartialSegment;
    /**
     * Create a circular arc defined by start point, tangent at start point, and end point.
     * * The circular arc is swept from start to end toward direction of the `tangentAtStart`.
     * * If tangent is parallel to line segment from start to end, return `undefined`.
     */
    static createArcPointTangentPoint(start: Point3d, tangentAtStart: Vector3d, end: Point3d): Arc3d | undefined;
    /**
     * Construct a sequence of alternating lines and arcs with the arcs creating tangent transition between consecutive edges.
     *  * If the radius parameter is a number, that radius is used throughout.
     *  * If the radius parameter is an array of numbers, `radius[i]` is applied at `point[i]`.
     *  * A zero radius for any point indicates to leave the as a simple corner.
     * @param points point source.
     * @param radius fillet radius or array of radii indexed to correspond to the points.
     * @param allowCuspOrOptions flag to allow cusps in output (default `true`), or a list of extended options.
     */
    static createFilletsInLineString(points: LineString3d | IndexedXYZCollection | Point3d[], radius: number | number[], allowCuspOrOptions?: boolean | CreateFilletsInLineStringOptions): Path | undefined;
    /**
     * Create a `Loop` with given xy corners and fixed z.
     * * The corners always proceed counter clockwise from lower left.
     * * If the radius is too large for the outer rectangle size, it is reduced to half of the the smaller x or y size.
     */
    static createRectangleXY(x0: number, y0: number, x1: number, y1: number, z?: number, filletRadius?: number): Loop;
    /**
     * If `arcB` is a continuation of `arcA`, extend `arcA` (in place) to include the range of `arcB`
     * * This only succeeds if the two arcs are part of identical complete arcs and end of `arcA` matches the beginning of `arcB`.
     * @param arcA first arc, modified in place.
     * @param arcB second arc, unmodified.
     * @param allowReversed whether to consolidate even when second arc is reversed (default is `false`).
     * @param tolerance optional coordinate tolerance for point equality (default is `Geometry.smallMetricDistance`).
     * @returns whether `arcA` was modified.
     */
    static appendToArcInPlace(arcA: Arc3d, arcB: Arc3d, allowReverse?: boolean, tolerance?: number): boolean;
    /**
     * Return a `Path` containing arcs are on the surface of an ellipsoid and pass through a sequence of points.
     * * Each arc passes through the two given endpoints and in the plane containing the true surface normal at
     * given `fractionForIntermediateNormal`
     * @param ellipsoid
     * @param pathPoints
     * @param fractionForIntermediateNormal fractional position for surface normal used to create the section plane.
     */
    static assembleArcChainOnEllipsoid(ellipsoid: Ellipsoid, pathPoints: GeodesicPathPoint[], fractionForIntermediateNormal?: number): Path;
    private static appendGeometryQueryArray;
    /**
     * Create solid primitives for pipe segments (e.g. Cone or TorusPipe) around line and arc primitives.
     * @param centerline centerline geometry.
     * @param pipeRadius radius of pipe.
     */
    static createPipeSegments(centerline: CurvePrimitive | CurveChain, pipeRadius: number): GeometryQuery | GeometryQuery[] | undefined;
    /** Get start point and tangent for variant curve data. */
    private static startPointAndTangent;
    /** Create an [[Arc3d]] from `sectionData` that has its center at the start point of the centerline. */
    static createArcFromSectionData(centerline: IndexedXYZCollection | Point3d[] | CurvePrimitive, sectionData: number | XAndY | Arc3d): Arc3d | undefined;
    /**
     * Create section arcs for mitered pipe.
     * * At the end of each pipe segment, the pipe is mitered by the plane that bisects the angle between successive
     * centerline segments.
     * * The section arcs are constructed so that lines between corresponding fractional positions on the arcs are
     *   axial lines on the pipes.
     * * This means that the initial arc's vector0 and vector90 lengths and angular separation are _not_ preserved in
     * the section arcs.
     * * Circular or elliptical pipe cross sections can be specified by supplying either a radius, a pair of semi-axis
     * lengths, or an Arc3d:
     *    * For semi-axis length input, x and y correspond to ellipse local axes perpendicular to each other and to the
     * start tangent.
     *    * For Arc3d input, the center is translated to the centerline start point. For best results, ensure this arc
     * is perpendicular to the centerline start tangent.
     * * This function internally calls [[createMiteredSweepSections]] with default options.
     * @param centerline centerline of pipe. For best results, ensure no successive duplicate points with e.g.,
     * [[GrowableXYZArray.createCompressed]].
     * @param sectionData circle radius, ellipse semi-axis lengths, or full Arc3d (if not full, function makes it full).
     * @returns array of sections or empty array if section creation failed.
     */
    static createMiteredPipeSections(centerline: IndexedXYZCollection, sectionData: number | XAndY | Arc3d): Arc3d[];
    /** For a smooth curve, stroke and return unnormalized start/end tangents. */
    private static strokeSmoothCurve;
    /**
     * Align two bisector plane normals to given smooth rail tangents or optional overrides.
     * * Optionally average the normals for physically closed rail.
     */
    private static alignFirstAndLastBisectorPlanes;
    /** Reverse a closed curve or region if necessary so that its orientation is CCW with respect to the plane normal. */
    private static alignClosedCurveToPlane;
    /**
     * Projection to target plane, constructing sweep direction from two given planes.
     * * If successful, push the target plane and swept section to the output arrays and return the swept section.
     * * If unsuccessful, leave the output arrays alone and return the input section.
     */
    private static doSweepToPlane;
    /**
     * Sweep the `initialSection` along each segment of the (stroked) `centerline` until it hits the bisector plane at
     * the next vertex.
     * * For best results, the caller should place `initialSection` in a plane perpendicular to the `centerline`
     * start tangent.
     *   * This plane is commonly (but not necessarily) through the centerline start point itself.
     *   * To compute the sections, `initialSection` is projected in the direction of the centerline start tangent onto
     * the first bisector plane at the centerline start. The result of this projection will be likewise projected onto
     * the second plane, and so on in sequence.
     * * By default, the first/last bisector plane normals are set to the centerline start/end tangents. The caller can
     * override these with tangents supplied in `options`. If the centerline is physically closed and
     * `options.wrapIfPhysicallyClosed` is true, the first and last plane normals are averaged and equated.
     * * The centerline path does NOT have to be planar, however non-planarity will result in twisting of the sections
     * in the bisector planes.
     * @param centerline sweep path. Will be stroked if smooth.
     * @param initialSection profile curve to be swept. As noted above, this should be on a plane perpendicular to the
     * centerline start tangent.
     * @param options options for computation and output.
     * @return array of sections, formed from projecting `initialSection` successively onto the bisector planes.
     */
    static createMiteredSweepSections(centerline: IndexedXYZCollection | Point3d[] | CurvePrimitive | CurveChain, initialSection: AnyCurve, options?: MiteredSweepOptions): SectionSequenceWithPlanes | undefined;
    /**
     * Create a circular arc from start point, tangent at start, radius, optional plane normal, arc sweep.
     * * The vector from start point to center is in the direction of upVector crossed with tangentA.
     * @param start start point.
     * @param tangentAtStart vector in tangent direction at the start.
     * @param radius signed radius.
     * @param upVector optional out-of-plane vector. Defaults to positive Z.
     * @param sweep angular range. If single `Angle` is given, start angle is at 0 degrees (the start point).
     */
    static createArcPointTangentRadius(start: Point3d, tangentAtStart: Vector3d, radius: number, upVector?: Vector3d, sweep?: Angle | AngleSweep): Arc3d | undefined;
    /**
     * Compute 2 spirals (all in XY) for a symmetric line-to-line transition.
     * * First spiral begins at given start point.
     * * first tangent aims at shoulder.
     * * outbound spiral joins line from shoulder to target.
     * @param spiralType name of spiral type. THIS MUST BE AN "Integrated" SPIRAL TYPE.
     * @param startPoint inbound start point.
     * @param shoulder point target point for (both) spiral-to-line tangencies.
     * @return array with the computed spirals, or undefined if failure.
     */
    static createLineSpiralSpiralLine(spiralType: IntegratedSpiralTypeName, startPoint: Point3d, shoulderPoint: Point3d, targetPoint: Point3d): GeometryQuery[] | undefined;
    /**
     * Compute 2 spirals (all in XY) for a symmetric line-to-line transition.
     * * Spiral length is given.
     * * tangency points float on both lines.
     * @param spiralType name of spiral type.  THIS MUST BE AN "Integrated" SPIRAL TYPE.
     * @param pointA inbound start point.
     * @param shoulder point target point for (both) spiral-to-line tangencies.
     * @param spiralLength for each part of the spiral pair.
     * @return array with the computed spirals, or undefined if failure.
     */
    static createLineSpiralSpiralLineWithSpiralLength(spiralType: IntegratedSpiralTypeName, pointA: Point3d, pointB: Point3d, pointC: Point3d, spiralLength: number): GeometryQuery[] | undefined;
    /**
     * Compute 2 spirals and an arc (all in XY) for a symmetric line-to-line transition.
     * Spiral lengths and arc radius are given (e.g., from design speed standards).
     * @param spiralType name of spiral type. THIS MUST BE AN "Integrated" SPIRAL TYPE.
     * @param pointA inbound start point.
     * @param pointB shoulder (target)  point for (both) spiral-to-line tangencies.
     * @param lengthA inbound spiral length.
     * @param lengthB outbound spiral length.
     * @return array with the computed spirals, or undefined if failure.
     */
    static createLineSpiralArcSpiralLine(spiralType: IntegratedSpiralTypeName, pointA: Point3d, pointB: Point3d, pointC: Point3d, lengthA: number, lengthB: number, arcRadius: number): GeometryQuery[] | undefined;
    /** Return the intersection point of 3 planes. */
    static planePlaneIntersectionRay(planeA: PlaneAltitudeEvaluator, planeB: PlaneAltitudeEvaluator): Ray3d | undefined;
}
//# sourceMappingURL=CurveFactory.d.ts.map