import { HalfEdge, HalfEdgeGraph, HalfEdgeMask } from "../../topology/Graph"; import { CurveLocationDetailPair } from "../CurveLocationDetail"; import { CurvePrimitive } from "../CurvePrimitive"; import { Loop, SignedLoops } from "../Loop"; import { ParityRegion } from "../ParityRegion"; /** @packageDocumentation * @module Curve */ /** * Options bundle for [[PlanarSubdivision.createLoopInFace]] and [[PlanarSubdivision.createLoopOrParityRegionInFace]]. * @internal */ export interface CreateRegionInFaceOptions { /** * Optional callback invoked on each `edge` before its `curve` is added to `loop`. * * Note that if a [[ParityRegion]] is being constructed, `curve` and `loop` may subsequently be reversed. */ announceEdge?: (edge: HalfEdge, curve: CurvePrimitive, loop: Loop) => void; /** * Whether to consolidate adjacent curves in an output [[Loop]]. Default value is `false`. * * If `announce` is defined, no compression is performed, as edges and curves would no longer be in 1-1 correspondence. */ compress?: boolean; /** Absolute xy-distance for confirming a returned Loop is closed. Default value is [[Geometry.smallMetricDistance]]. */ closureTol?: number; /** * Mask preset on bridge edges. Default value is `HalfEdgeMask.BRIDGE_EDGE`. * * This mask is used to distinguish a split-washer type face, which can result in a [[ParityRegion]]. */ bridgeMask?: HalfEdgeMask; /** Mask to use for visiting edges when creating a [[ParityRegion]] from a split-washer type face. Default value is `HalfEdgeMask.VISITED`. */ visitMask?: HalfEdgeMask; /** * Optional z-coordinate for the result region. * * If undefined, graph z-coordinates are used, but this may result in a non-planar region if the graph is not planar! */ z?: number; } /** * @internal */ export declare class PlanarSubdivision { /** * Create a graph from curves and precomputed intersections. * * Z-coordinates are ignored. * @param primitives input curves * @param allPairs array of curve-curve xy-intersections * @param mergeTolerance optional distance tolerance for clustering vertices. Default value is [[Geometry.smallMetricDistance]]. */ static assembleHalfEdgeGraph(primitives: CurvePrimitive[], allPairs: CurveLocationDetailPair[], mergeTolerance?: number, radianTolerance?: number): HalfEdgeGraph; /** * Filter for trivial curve fragment: fast computation if line segment; otherwise clip, flatten, and measure. * * Different metrics are employed for expedience. */ private static isCurveTrivialXY; /** * Create a pair of mated half edges referencing a non-trivial interval of a primitive. * @param graph containing graph * @param p the curve * @param point0 start point * @param fraction0 starting fraction * @param point1 end point * @param fraction1 end fraction * @param mergeTolerance optional maximum xy-length of a trivial edge * @returns end point and fraction */ private static addHalfEdge; /** * Based on computed (and toleranced) area, push the loop (pointer) onto the appropriate array of positive, negative, * or sliver loops. * @param areaTol absolute area tolerance for sliver face detection * @param isSliverFace whether the loop is known a priori (e.g., via topology) to have zero area * @returns the area (forced to zero if within tolerance) */ static collectSignedLoop(loop: Loop, outLoops: SignedLoops, areaTol?: number, isSliverFace?: boolean): number; /** Extract geometric info from a topological edge. */ private static extractGeometryFromEdge; /** Create the geometry for a topological edge. */ private static createCurveInEdge; /** * Create a [[Loop]] for the given face or super face. * @param face a node in the face loop, or an array of HalfEdges that comprise a loop (e.g., a super face). * @param options bundle of options. * @returns the Loop, or `undefined` if it is not closed within xy-tolerance. */ static createLoopInFace(face: HalfEdge | HalfEdge[], options?: CreateRegionInFaceOptions): Loop | undefined; /** * Create a [[Loop]] or [[ParityRegion]] for the given face. * * A ParityRegion is created for a split-washer type face by removing bridge edges. * @param face a node in the face loop. * @param options bundle of options. * @returns the Loop or ParityRegion, or `undefined` if one could not be computed. */ static createLoopOrParityRegionInFace(face: HalfEdge, options?: CreateRegionInFaceOptions): Loop | ParityRegion | undefined; /** Return true if there are only two edges in the face loop, and their start curvatures are the same. */ private static isNullFace; /** Look across edge mates (possibly several) for a non-null mate face. */ private static getNonNullEdgeMate; static collectSignedLoopSetsInHalfEdgeGraph(graph: HalfEdgeGraph, closureTol?: number, areaTol?: number): SignedLoops[]; } //# sourceMappingURL=PlanarSubdivision.d.ts.map