RegionOps Class

Beta  

class RegionOps has static members for calculations on regions (areas).

  • Regions are represented by these CurveCollection subclasses:
  • Loop -- a single loop
  • ParityRegion -- a collection of loops, interpreted by parity rules.
    • The common "One outer loop and many Inner loops" is a parity region.
  • UnionRegion -- a collection of Loop and ParityRegion objects understood as a (probably disjoint) union.

Methods

Name Description
constructor(): RegionOps    
cloneCurvesWithXYSplitFlags(curvesToCut: undefined | CurvePrimitive | CurveCollection, cutterCurves: CurveCollection): undefined | CurvePrimitive | CurveCollection Static * Find all intersections among curves in curvesToCut and cutterCurves  
collectChains(fragments: GeometryQuery[], gapTolerance: number = Geometry.smallMetricDistance): ChainTypes Static * Restructure curve fragments as chains  
collectCurvePrimitives(candidates: AnyCurve | AnyCurve[], collectorArray?: CurvePrimitive[], smallestPossiblePrimitives: boolean = false, explodeLinestrings: boolean = false): CurvePrimitive[] Static collect all CurvePrimitives in loosely typed input.  
collectInsideAndOutsideOffsets(fragments: GeometryQuery[], offsetDistance: number, gapTolerance: number): { chains: ChainTypes, insideOffsets: GeometryQuery[], outsideOffsets: GeometryQuery[] } Static * Restructure curve fragments as chains and offsets  
computeXYArea(root: AnyRegion): undefined | number Static Return an xy area for a loop, parity region, or union region.  
computeXYAreaMoments(root: AnyRegion): undefined | MomentData Static Return moment sums for a loop, parity region, or union region.  
computeXYZWireMomentSums(root: AnyCurve): undefined | MomentData Static Return MomentData with the sums of wire moments.  
consolidateAdjacentPrimitives(curves: CurveCollection, options?: ConsolidateAdjacentCurvePrimitivesOptions): void Static Look for and simplify:  
constructCurveXYOffset(curves: Path | Loop, offsetDistanceOrOptions: number | JointOptions): undefined | CurveCollection Static Construct curves that are offset from a Path or Loop  
constructPolygonWireXYOffset(points: Point3d[], wrap: boolean, offsetDistance: number): undefined | CurveCollection Static Construct a wire (not area!!) that is offset from given polyline or polygon.  
createLoopPathOrBagOfCurves(curves: CurvePrimitive[], wrap: boolean = true, consolidateAdjacentPrimitives: boolean = false): undefined | CurveCollection Static Create curve collection of subtype determined by gaps between the input curves.  
curveArrayRange(data: any, worldToLocal?: Transform): Range3d Static Return the overall range of given curves.  
expandLineStrings(candidates: CurvePrimitive[]): CurvePrimitive[] Static Copy primitive pointers from candidates to result array.  
polygonBooleanXYToLoops(inputA: MultiLineStringDataVariant[], operation: RegionBinaryOpType, inputB: MultiLineStringDataVariant[]): undefined | AnyRegion Static return loops of linestrings around areas of a boolean operation between the input regions.  
polygonBooleanXYToPolyface(inputA: MultiLineStringDataVariant[], operation: RegionBinaryOpType, inputB: MultiLineStringDataVariant[], triangulate: boolean = false): undefined | Polyface Static return a polyface whose facets area a boolean operation between the input regions.  
polygonXYAreaDifferenceLoopsToPolyface(loopsA: MultiLineStringDataVariant, loopsB: MultiLineStringDataVariant, triangulate: boolean = false): undefined | Polyface Static return a polyface containing the area difference of two XY regions.  
polygonXYAreaIntersectLoopsToPolyface(loopsA: MultiLineStringDataVariant, loopsB: MultiLineStringDataVariant, triangulate: boolean = false): undefined | Polyface Static return a polyface containing the area union of two XY regions.  
polygonXYAreaUnionLoopsToPolyface(loopsA: MultiLineStringDataVariant, loopsB: MultiLineStringDataVariant, triangulate: boolean = false): undefined | Polyface Static return a polyface containing the area union of two XY regions.  
rectangleEdgeTransform(data: Point3d[] | IndexedXYZCollection | AnyCurve, requireClosurePoint: boolean = true): undefined | Transform Static Test if data is one of several forms of a rectangle.  
sortOuterAndHoleLoopsXY(loops: IndexedXYZCollection | Loop[]): AnyRegion Static If reverse loops as necessary to make them all have CCW orientation for given outward normal.  
splitPathsByRegionInOnOutXY(curvesToCut: undefined | CurvePrimitive | CurveCollection, region: AnyRegion): { coincidentParts: AnyCurve[], insideParts: AnyCurve[], outsideParts: AnyCurve[] } Static * Find intersections of curvesToCut with boundaries of region.  
splitToPathsBetweenFlagBreaks(source: undefined | CurvePrimitive | CurveCollection, makeClones: boolean): undefined | CurvePrimitive | Path | Loop | BagOfCurves Static Create paths assembled from many curves.  
testPointInOnOutRegionXY(curves: AnyRegion, x: number, y: number): number Static Test if point (x,y) is IN, OUT or ON a polygon.  

Defined in

Last Updated: 11 June, 2024