import { Arc3d } from "../curve/Arc3d"; import { CurvePrimitive } from "../curve/CurvePrimitive"; import { AnyCurve, AnyRegion } from "../curve/CurveTypes"; import { GeometryQuery } from "../curve/GeometryQuery"; import { LineString3d } from "../curve/LineString3d"; import { Loop } from "../curve/Loop"; import { ParityRegion } from "../curve/ParityRegion"; import { StrokeOptions } from "../curve/StrokeOptions"; import { UnionRegion } from "../curve/UnionRegion"; import { NullGeometryHandler, UVSurface } from "../geometry3d/GeometryHandler"; import { GrowableXYArray } from "../geometry3d/GrowableXYArray"; import { GrowableXYZArray } from "../geometry3d/GrowableXYZArray"; import { IndexedXYZCollection } from "../geometry3d/IndexedXYZCollection"; import { Point2d } from "../geometry3d/Point2dVector2d"; import { Point3d, Vector3d } from "../geometry3d/Point3dVector3d"; import { Range3d } from "../geometry3d/Range"; import { Segment1d } from "../geometry3d/Segment1d"; import { Transform } from "../geometry3d/Transform"; import { XAndY } from "../geometry3d/XYZProps"; import { Box } from "../solid/Box"; import { Cone } from "../solid/Cone"; import { LinearSweep } from "../solid/LinearSweep"; import { RotationalSweep } from "../solid/RotationalSweep"; import { RuledSweep } from "../solid/RuledSweep"; import { Sphere } from "../solid/Sphere"; import { TorusPipe } from "../solid/TorusPipe"; import { HalfEdge, HalfEdgeGraph, HalfEdgeToBooleanFunction } from "../topology/Graph"; import { IndexedPolyface, PolyfaceVisitor } from "./Polyface"; /** * * Simple construction for strongly typed GeometryQuery objects: * * * Create a builder with `builder = PolyfaceBuilder.create()` * * Add GeometryQuery objects: * * `builder.addGeometryQuery(g: GeometryQuery)` * * `builder.addCone(cone: Cone)` * * `builder.addTorusPipe(surface: TorusPipe)` * * `builder.addLinearSweepLineStringsXYZOnly(surface: LinearSweep)` * * `builder.addRotationalSweep(surface: RotationalSweep)` * * `builder.addLinearSweep(surface: LinearSweep)` * * `builder.addRuledSweep(surface: RuledSweep)` * * `builder.addSphere(sphere: Sphere)` * * `builder.addBox(box: Box)` * * `builder.addIndexedPolyface(polyface)` * * Extract with `builder.claimPolyface(true)` * * * Simple construction for ephemeral constructive data: * * * Create a builder with `builder = PolyfaceBuilder.create()` * * Add from fragmentary data: * * `builder.addBetweenLineStringsWithStoredIndices(linestringA linestringB)` * * `builder.addBetweenLineStringsWithRuleEdgeNormals(linestringA, vA, linestringB, vB, addClosure)` * * `builder.addBetweenTransformedLineStrings(curves, transformA, transformB, addClosure)` * * `builder.addLinearSweepLineStringsXYZOnly(contour, vector)` * * `builder.addPolygon(points, numPointsToUse)` * * `builder.addTransformedUnitBox(transform)` * * `builder.addTriangleFan(conePoint, linestring, reverse)` * * `builder.addTrianglesInUncheckedConvexPolygon(linestring, reverse)` * * `builder.addUVGridBody(surface,numU, numV, createFanInCaps)` * * `builder.addGraph(Graph, acceptFaceFunction)` * * Extract with `builder.claimPolyface(true)` * * * Low-level detail construction -- direct use of indices: * * * Create a builder with `builder = PolyfaceBuilder.create()` * * Add GeometryQuery objects * * `builder.addPoint(point)` * * `builder.findOrAddPointInLineString(linestring, index)` * * `builder.addPointXYZ(x,y,z)` * * `builder.addTriangleFacet(points)` * * `builder.addQuadFacet(points)` * @public */ export declare class PolyfaceBuilder extends NullGeometryHandler { private _polyface; private _options; /** Return (pointer to) the `StrokeOptions` in use by the builder. */ get options(): StrokeOptions; /** State data that affects the current construction. **/ private _reversed; /** Ask if this builder is reversing vertex order as loops are received. */ get reversedFlag(): boolean; /** * Extract the polyface. * @param compress whether to cluster vertices (default `true`). * @param tolerance compression tolerance (default `Geometry.smallMetricDistance`). */ claimPolyface(compress?: boolean, tolerance?: number): IndexedPolyface; /** Toggle (reverse) the flag controlling orientation flips for newly added facets. */ toggleReversedFacetFlag(): void; private constructor(); /** * Create a builder with given StrokeOptions. * @param options StrokeOptions (captured). */ static create(options?: StrokeOptions): PolyfaceBuilder; /** Add facets for a transformed unit box. */ addTransformedUnitBox(transform: Transform): void; /** * Add facets for a transformed range box. * * For best results, the transformed range corners should define a nonzero volume or area. * @param transform applied to the range points before adding to the polyface. * @param range sides become 6 quad polyface facets. * @param faceSelector for each face in the order of `BoxTopology.cornerIndexCCW`, `faceSelector[i] === false` skips * that facet. */ addTransformedRangeMesh(transform: Transform, range: Range3d, faceSelector?: boolean[]): void; /** * Add triangles from `conePoint` to each far edge. * @param conePoint the common vertex of all triangles. * @param ls linestring with point coordinates. * @param reverse if `true`, wrap the triangle creation in toggleReversedFacetFlag. */ addTriangleFan(conePoint: Point3d, ls: LineString3d, reverse: boolean): void; /** * Add triangles from the first point of the linestring to the subsequent edges of the linestring. * * No checks are made for polygon convexity or edge colinearity, conditions which would ensure positive area triangles. * @param ls linestring with point coordinates. * @param reverse if `true`, wrap the triangle creation in toggleReversedFacetFlag. */ addTrianglesInUncheckedConvexPolygon(ls: LineString3d, reverse: boolean): void; /** Add a point to the polyface. */ addPoint(xyz: Point3d): number; /** Add a uv parameter to the polyface. */ addParamXY(x: number, y: number): number; private static _workPointFindOrAddA; private static _workVectorFindOrAdd; private static _workUVFindOrAdd; /** * Add a point to the polyface. * * The implementation is free to either create a new point or return the index of a prior point with the same coordinates. * * The index is unchecked. Use [[findOrAddPointInLineString]] to check index validity. * @param ls the linestring. * @param index index of the point in the linestring. * @param transform (optional) transform to be applied. * @param priorIndex (optional) index of a prior point to check for possible duplicate value. * @returns the point index in the polyface. */ private findOrAddPointInLineStringUnchecked; /** * Add a point to the polyface. * * The implementation is free to either create a new point or return the index of a prior point with the same coordinates. * @param ls the linestring. * @param index index of the point in the linestring. * @param transform (optional) transform to be applied. * @param priorIndex (optional) index of a prior point to check for possible duplicate value. * @returns the point index in the polyface. */ findOrAddPointInLineString(ls: LineString3d, index: number, transform?: Transform, priorIndex?: number): number | undefined; /** * Add a point to the polyface. * * The implementation is free to either create a new point or return the index of a prior point with the same coordinates. * * The index is unchecked. Use [[findOrAddPointInGrowableXYZArray]] to check index validity. * @param xyz the array of points. * @param index index of the point in the array. * @param transform (optional) transform to be applied. * @param priorIndex (optional) index of a prior point to check for possible duplicate value. * @returns the point index in the polyface. */ private findOrAddPointInGrowableXYZArrayUnchecked; /** * Add a point to the polyface. * * The implementation is free to either create a new point or return the index of a prior point with the same coordinates. * @param xyz the array of points. * @param index index of the point in the array. * @param transform (optional) transform to be applied. * @param priorIndex (optional) index of a prior point to check for possible duplicate value. * @returns the point index in the polyface, or undefined if the index is invalid. */ findOrAddPointInGrowableXYZArray(xyz: GrowableXYZArray, index: number, transform?: Transform, priorIndex?: number): number | undefined; /** * Add a normal to the polyface. * * The implementation is free to either create a new normal or return the index of a prior normal with the same coordinates. * * The index is unchecked. Use [[findOrAddNormalInGrowableXYZArray]] to check index validity. * @param xyz the array of normals. * @param index index of the normal in the array. * @param transform (optional) transform to be applied. * @param priorIndex (optional) index of a prior point to check for possible duplicate value. * @returns the normal index in the polyface. */ findOrAddNormalInGrowableXYZArrayUnchecked(xyz: GrowableXYZArray, index: number, transform?: Transform, priorIndex?: number): number; /** * Add a normal to the polyface. * * The implementation is free to either create a new normal or return the index of a prior normal with the same coordinates. * @param xyz the array of normals. * @param index index of the normal in the array. * @param transform (optional) transform to be applied. * @param priorIndex (optional) index of a prior point to check for possible duplicate value. * @returns the normal index in the polyface. */ findOrAddNormalInGrowableXYZArray(xyz: GrowableXYZArray, index: number, transform?: Transform, priorIndex?: number): number | undefined; /** * Add a uv parameter to the polyface. * * The index is unchecked. Use [[addParamInGrowableXYArray]] to check index validity. * @param data the array of uv data. * @param index index of the param in the array. * @returns the uv parameter index in the polyface. */ private addParamInGrowableXYArrayUnchecked; /** * Add a uv parameter to the polyface. * @param data the array of uv data. * @param index index of the param in the array. * @returns the uv parameter index in the polyface. */ addParamInGrowableXYArray(data: GrowableXYArray, index: number): number | undefined; /** * Add a uv parameter to the polyface, taking `u` from `ls.fractions` and `v` from input. * * If `index` is an invalid index for `ls.fractions`, `u` is computed as `index / ls.points.length`. * * The implementation is free to either create a new param or return the index of a * prior param with the same coordinates. * @param ls the linestring. * @param index index of the point in the linestring. * @param v the v parameter. * @param priorIndexA (optional) an index of a prior param to check for possible duplicate value. * @param priorIndexB (optional) another index of a prior param to check for possible duplicate value. * @returns the uv parameter index in the polyface. */ findOrAddParamInLineString(ls: LineString3d, index: number, v: number, priorIndexA?: number, priorIndexB?: number): number; /** * Add a normal to the polyface. * @param ls the linestring. * @param index Index of the normal in the linestring's surface normal array. * @param transform (optional) transform to be applied. * @param priorIndexA (optional) an index of a prior normal to check for possible duplicate value. * @param priorIndexB (optional) another index of a prior normal to check for possible duplicate value. * @returns the normal index in the polyface. */ findOrAddNormalInLineString(ls: LineString3d, index: number, transform?: Transform, priorIndexA?: number, priorIndexB?: number): number | undefined; /** Add a point to the polyface. */ addPointXYZ(x: number, y: number, z: number): number; private static _workVector0; private static _workVector1; /** Returns a uv-to-world transform whose inverse can be applied to points on a triangular facet in order to obtain UV parameters. */ private getUVTransformForTriangleFacet; /** Returns the normal to a triangular facet. */ private getNormalForTriangularFacet; private static _workUV0; private static _workUV1; private static _workUV2; private static _workUV3; private static _workNormal0; private static _workNormal1; private static _workNormal2; private static _workNormal3; private static _workTransform; /** * Add a quad to the polyface given its points in order around the edges. * @param points array of at least four vertices. * @param params (optional) array of at least four uv parameters. If `undefined` or insufficiently sized * or quad is degenerate, and params are needed, uv are calculated from `points`. * @param normals (optional) array of at least four vectors. If `undefined` or insufficiently sized, * and normals are needed, the quad is assumed to be planar and its normal is calculated from `points`. * @param colors (optional) array of at least four colors. If `undefined` or insufficiently sized, and * colors are needed, color 0 is used. */ addQuadFacet(points: Point3d[] | GrowableXYZArray, params?: Point2d[], normals?: Vector3d[], colors?: number[]): void; /** * Add a single quad facet from existing points to the polyface. * * The actual quad may be reversed or triangulated based on builder setup. * * `indexA0` and `indexA1` are in the forward order at the "A" end of the quad * * `indexB0` and `indexB1` are in the forward order at the "B" end of the quad. * * This means ccw/cw ordered vertices v[i] should be passed into this function as i=[0,1,3,2]. */ private addIndexedQuadPointIndexes; /** For a single quad facet, add the indexes of the corresponding param points. */ private addIndexedQuadParamIndexes; /** For a single quad facet, add the indexes of the corresponding normal vectors. */ private addIndexedQuadNormalIndexes; /** For a single quad facet, add the indexes of the corresponding colors. */ private addIndexedQuadColorIndexes; /** * Add a triangle to the polyface given its points in order around the edges. * @param points array of at least three vertices. * @param params (optional) array of at least three uv parameters. If `undefined` or insufficiently sized * or quad is degenerate, and params are needed, uv are calculated from `points`. * @param normals (optional) array of at least three vectors. If `undefined` or insufficiently sized, * and normals are needed, the normal is calculated from `points`. * @param colors (optional) array of at least three colors. If `undefined` or insufficiently sized, and * colors are needed, color 0 is used. */ addTriangleFacet(points: Point3d[] | GrowableXYZArray, params?: Point2d[], normals?: Vector3d[], colors?: number[]): void; /** * Add a single triangular facet from existing points to the polyface. * * The added triangle may be reversed based on builder setup. */ private addIndexedTrianglePointIndexes; /** For a single triangle facet, add the indexes of the corresponding params. */ private addIndexedTriangleParamIndexes; /** For a single triangle facet, add the indexes of the corresponding params. */ private addIndexedTriangleNormalIndexes; /** For a single triangle facet, add the indexes of the corresponding colors. */ private addIndexedTriangleColorIndexes; /** Find or add xyzIndex and normalIndex for coordinates in the sector. */ private setSectorIndices; private addSectorTriangle; private addSectorQuadA01B01; /** * Add facets between lineStrings with matched point counts. * * Surface normals are computed from (a) curve tangents in the linestrings and (b) rule line between linestrings. */ addBetweenLineStringsWithRuleEdgeNormals(lineStringA: LineString3d, vA: number, lineStringB: LineString3d, vB: number, addClosure?: boolean): void; /** * Add facets between lineStrings with matched point counts. * * Indices of points, normals, and uv parameters are pre-stored in the linestrings. * * `pointIndices`, `normalIndices`, and `paramIndices` (if used) for both linestrings must be defined and * have the same length. */ addBetweenLineStringsWithStoredIndices(lineStringA: LineString3d, lineStringB: LineString3d): void; /** * Add facets between transformed lineStrings. * * Facets are announced to addIndexedQuad. * * addIndexedQuad is free to apply reversal or triangulation options. */ addBetweenTransformedLineStrings(curves: AnyCurve, transformA: Transform, transformB: Transform, addClosure?: boolean): void; private addBetweenStrokeSetPair; /** Add facets from a Cone. */ addCone(cone: Cone): void; /** Add facets for a TorusPipe. */ addTorusPipe(surface: TorusPipe, phiStrokeCount?: number, thetaStrokeCount?: number): void; /** * Add point data (no params, normals) for linestrings. * * This recurses through curve chains (loops and paths). * * LineStrings are swept. * * All other curve types are ignored. * @param contour contour which contains only linestrings. * @param vector sweep vector. */ addLinearSweepLineStringsXYZOnly(contour: AnyCurve, vector: Vector3d): void; /** Construct facets for a rotational sweep. */ addRotationalSweep(surface: RotationalSweep): void; /** Construct facets for any planar region. */ addTriangulatedRegion(region: AnyRegion): void; /** * Apply stroke counts to curve primitives. * * Recursively visit all children of data. * * At each primitive, invoke `computeStrokeCountForOptions` method with options from the builder. * @deprecated in 4.8.0 - might be removed in next major version. This method does nothing and is unneeded. */ applyStrokeCountsToCurvePrimitives(data: AnyCurve | GeometryQuery): void; private addBetweenStrokeSetsWithRuledNormals; private createIndicesInLineString; private addBetweenRotatedStrokeSets; /** Add facets from the linear sweep. */ addLinearSweep(surface: LinearSweep): void; /** Add facets from a ruled sweep. */ addRuledSweep(surface: RuledSweep): boolean; /** Add facets from a sphere. */ addSphere(sphere: Sphere, strokeCount?: number): void; /** Add facets from a box. */ addBox(box: Box): void; /** * Add a polygon to the evolving facets. * * Add points to the polyface. * * Indices are added (in reverse order if indicated by the builder state). * @param points array of points. This may contain extra points not to be used in the polygon. * @param numPointsToUse number of points to use. */ addPolygon(points: Point3d[], numPointsToUse?: number): void; /** * Add a polygon to the evolving facets. * * Add points to the polyface * * Indices are added (in reverse order if indicated by the builder state). * * Arrays with 2 or fewer points are ignored. * @param points array of points. Trailing closure points are ignored. */ addPolygonGrowableXYZArray(points: GrowableXYZArray): void; /** * Add a polygon to the evolving facets. * * Add points to the polyface. * * Compute each point index as the point is added. * * All data arrays are parallel to the point array. * * Point indices are added in reverse order if indicated by the builder state. * @param points array of vertices in order around the facet. * @param normals (optional) array of normals, one per vertex. * @param params (optional) array of uv-parameters, one per vertex. * @param colors (optional) array of colors, one per vertex. * @param edgeVisible (optional) array of flags, one per vertex, true iff edge starting at corresponding vertex is visible. */ addFacetFromGrowableArrays(points: GrowableXYZArray, normals: GrowableXYZArray | undefined, params: GrowableXYArray | undefined, colors: number[] | undefined, edgeVisible?: boolean[]): void; /** * Add the current visitor facet to the evolving polyface. * * Indices are added (in reverse order if indicated by the builder state). */ addFacetFromVisitor(visitor: PolyfaceVisitor): void; /** Add all visitor facets to the evolving polyface (in reverse order if indicated by the builder state). */ addFacetsFromVisitor(visitor: PolyfaceVisitor): void; /** * Add the subset of visitor data indexed by the indices. * * Ideally, the subset represents a sub-facet of the visited facet. * @param visitor data for the currently visited facet. * @param indices local indices into the visitor data arrays. * @returns whether the data was added successfully. Encountering an invalid index returns false. */ addFacetFromIndexedVisitor(visitor: PolyfaceVisitor, indices: number[]): boolean; /** Add a polyface with optional reverse and transform. */ addIndexedPolyface(source: IndexedPolyface, reversed?: boolean, transform?: Transform): void; /** * Produce a new FacetFaceData for all terminated facets since construction of the previous face. * * Each facet number/index is mapped to the FacetFaceData through the faceToFaceData array. * @returns true if successful, and false otherwise. */ endFace(): boolean; /** Double dispatch handler for Cone. */ handleCone(g: Cone): any; /** Double dispatch handler for TorusPipe. */ handleTorusPipe(g: TorusPipe): any; /** Double dispatch handler for Sphere. */ handleSphere(g: Sphere): any; /** Double dispatch handler for Box. */ handleBox(g: Box): any; /** Double dispatch handler for LinearSweep. */ handleLinearSweep(g: LinearSweep): any; /** Double dispatch handler for RotationalSweep. */ handleRotationalSweep(g: RotationalSweep): any; /** Double dispatch handler for RuledSweep. */ handleRuledSweep(g: RuledSweep): any; /** Double dispatch handler for Loop. */ handleLoop(g: Loop): any; /** Double dispatch handler for ParityRegion. */ handleParityRegion(g: ParityRegion): any; /** Double dispatch handler for UnionRegion. */ handleUnionRegion(g: UnionRegion): any; /** Add facets for a GeometryQuery object. This is double dispatch through `dispatchToGeometryHandler(this)` */ addGeometryQuery(g: GeometryQuery): void; /** * Add a graph to the builder. * * Visit one node per face. * * If `acceptFaceFunction(node)` returns true, pass face coordinates to the builder. * * Accepted face edge visibility is determined by `isEdgeVisibleFunction`. * * Rely on the builder's compress step to find common vertex coordinates. * @param graph faces to add as facets. * @param acceptFaceFunction (optional) callback invoked once per graph face to test for whether to add a given face to the mesh. Default: accept only interior faces. * @param isEdgeVisibleFunction (optional) callback invoked once per edge of each accepted face to test for whether to hide an edge. Default: only boundary edges are visible. * @internal */ addGraph(graph: HalfEdgeGraph, acceptFaceFunction?: HalfEdgeToBooleanFunction, isEdgeVisibleFunction?: HalfEdgeToBooleanFunction): void; /** * Add a graph's faces to the builder. * * For each node in `faces`: * * Add all of its vertices to the polyface. * * Add point indices to form a new facet. * * (note: no normal or param indices are added) * * Terminate the facet. * @internal */ addGraphFaces(faces: HalfEdge[]): void; /** * Create a polyface containing the faces of a HalfEdgeGraph, with test functions to filter faces and hide edges. * * This is a static wrapper of [[addGraph]]. * * Default callbacks assume graph is appropriately masked with HalfEdgeMask.EXTERIOR. * @param graph faces to add as facets. * @param options (optional) options for the polyface. * @param acceptFaceFunction (optional) callback invoked once per graph face to test for whether to add a given face to the mesh. Default: accept only interior faces. * @param isEdgeVisibleFunction (optional) callback invoked once per edge of each accepted face to test for whether to hide an edge. Default: only boundary edges are visible. * @param clusterTol optional distance tolerance for mesh compression. Default is [[Geometry.smallMetricDistance]]. * @internal */ static graphToPolyface(graph: HalfEdgeGraph, options?: StrokeOptions, acceptFaceFunction?: HalfEdgeToBooleanFunction, isEdgeVisibleFunction?: HalfEdgeToBooleanFunction, clusterTol?: number): IndexedPolyface; /** * Create a polyface containing the faces of a HalfEdgeGraph that are specified by the HalfEdge array. * @internal */ static graphFacesToPolyface(faces: HalfEdge[]): IndexedPolyface; /** * Create a polyface containing triangles in a (space) polygon. * * The polyface contains only coordinate data (no params or normals). */ static polygonToTriangulatedPolyface(points: Point3d[], localToWorld?: Transform): IndexedPolyface | undefined; /** * Add facets to the builder given arrays of coordinates for multiple facets. * * pointArray[i] is an array of 3 or 4 points. * * paramArray[i] is an array of matching number of params. * * normalArray[i] is an array of matching number of normals. * @param pointArray array of arrays of point coordinates. * @param paramArray (optional) array of arrays of uv parameters. * @param normalArray (optional) array of arrays of normals. * @param endFace if true, call this.endFace after adding all the facets. */ addCoordinateFacets(pointArray: Point3d[][], paramArray?: Point2d[][], normalArray?: Vector3d[][], endFace?: boolean): void; /** * Add facets from the parametric surface. * * Evaluate `(numU + 1) * (numV + 1)` grid points (in 0..1 in both u and v) on a surface. * * Add the facets for `numU * numV` quads. * * uv params are the 0..1 fractions. * * Normals are cross products of u and v direction partial derivatives. * @param surface UV surface to evaluate. * @param numU number of intervals (edges) in the u direction (number of points is `numU + 1`). * @param numV number of intervals (edges) in the v direction (number of points is `numV + 1`). * @param uMap optional mapping from u fraction to parameter space (such as texture). * @param vMap optional mapping from v fraction to parameter space (such as texture). */ addUVGridBody(surface: UVSurface, numU: number, numV: number, uMap?: Segment1d, vMap?: Segment1d): void; /** * Create a polyface from a triangulation of the points. * * The triangulation is computed as seen in the top view: z-coordinates are ignored. * * The highest z-coordinate is preserved for points that are separated by a vertical distance. * @param points an array of points. * @param options (optional) stroke options: * * `options.chordTol`: xy-distance for equating points. For DTM points, 1-2mm may suffice. Default value is * `Geometry.smallMetricDistance`. * * `options.needNormals`: whether to assign 001 to all facets (rarely useful). * * `options.needParams`: whether to assign all vertices uv-parameters equal to their xy-coordinates (rarely useful). * @returns triangulated polyface or `undefined` if triangulation was not possible. */ static pointsToTriangulatedPolyface(points: Point3d[], options?: StrokeOptions): IndexedPolyface | undefined; /** * Add triangular facets between two linestrings. * * Each triangle will have 1 vertex on one of the linestrings and 2 on the other. * * Choice of triangles is heuristic, hence does not have a unique solution. * * Logic for choosing among the various possible triangles prefers: * * Make near-coplanar facets. * * Make facets with good aspect ratio. * * This is exercised with a limited number of lookahead points, i.e. greedy to make first-available decision. * @param pointsA points of first linestring. * @param pointsB points of second linestring. */ addGreedyTriangulationBetweenLineStrings(pointsA: Point3d[] | LineString3d | IndexedXYZCollection, pointsB: Point3d[] | LineString3d | IndexedXYZCollection): void; /** * Add quad facets along a mitered pipe that follows a centerline curve. * * At the end of each pipe segment, the pipe is mitered by the plane that bisects the angle between successive * centerline segments. * * 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 [[CurveFactory.createMiteredSweepSections]], passing in the `startTangent` * option to preserve the rotation of Arc3d-type `sectionData`. * @param centerline centerline of pipe. If curved, it will be stroked using the builder's StrokeOptions, otherwise * for best results, ensure no successive duplicate points with e.g., [[GrowableXYZArray.createCompressed]]. * @param sectionData circle radius, ellipse semi-axis lengths, or Arc3d. * @param numFacetAround how many equal parameter-space chords around each section. * @param capped if `true`, add a cap at each end of the pipe; defaults to `false`. */ addMiteredPipes(centerline: IndexedXYZCollection | Point3d[] | CurvePrimitive, sectionData: number | XAndY | Arc3d, numFacetAround?: number, capped?: boolean): void; /** Return the polyface index array indices corresponding to the given edge, or `undefined` if error. */ private getEdgeIndices; /** * Create a side face between base and swept facets along a base boundary edge. * * Assumes numBaseFacets base facets were added to this builder, immediately followed by the same number of swept * facets with opposite orientation (first index not preserved). */ private addSweptFace; /** * Add facets from the source polyface, from its translation along the vector, and from its swept boundary edges, * to form a polyface that encloses a volume. * @param source the surface mesh to sweep. * @param sweepVector the direction and length to sweep the surface mesh. * @param triangulateSides whether to triangulate side facets, or leave as quads. * @returns whether the added facets comprise a simple sweep. If false, the resulting mesh may have self-intersections, * be non-manifold, have inconsistently oriented facets, etc. */ addSweptIndexedPolyface(source: IndexedPolyface, sweepVector: Vector3d, triangulateSides?: boolean): boolean; } /** * In this file to avoid topology -> polyface dependency. * @internal */ export declare namespace HalfEdgeGraphSearch { /** * Search the graph for an interior face containing the test point(s). * * For best results: * * the graph exterior face(s) should be masked with HalfEdgeMask.EXTERIOR * * the graph should contain no vertical faces * @param graph input topology, z-coordinates ignored * @param testPoint xy point(s) to search * @returns edge in the face loop of the containing face, or `undefined` if `testPoint` is in an exterior face, * or an array of the same in 1-1 correspondence with the input points. */ function findContainingFaceXY(graph: HalfEdgeGraph, testPoint: XAndY | XAndY[]): (HalfEdge | undefined)[] | HalfEdge | undefined; } //# sourceMappingURL=PolyfaceBuilder.d.ts.map