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
cloneCurvesWithXYSplitFlags(curvesToCut: CurvePrimitive | CurveCollection | undefined, cutterCurves: CurveCollection): CurveCollection | CurvePrimitive | undefined Static * Find all intersections among curves in curvesToCut and cutterCurves  
collectChains(fragments: GeometryQuery[], gapTolerance: number): 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): object Static * Restructure curve fragments as chains and offsets  
computeXYArea(root: AnyRegion): number | undefined Static Return an xy area for a loop, parity region, or union region.  
computeXYAreaMoments(root: AnyRegion): MomentData | undefined Static Return moment sums for a loop, parity region, or union region.  
computeXYZWireMomentSums(root: AnyCurve): MomentData | undefined 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): CurveCollection | undefined Static Construct curves that are offset from a Path or Loop  
constructPolygonWireXYOffset(points: Point3d[], wrap: boolean, offsetDistance: number): CurveCollection | undefined Static Construct a wire (not area!!) that is offset from given polyline or polygon.  
createLoopPathOrBagOfCurves(curves: CurvePrimitive[], wrap: boolean = true, consolidateAdjacentPrimitives: boolean = false): CurveCollection | undefined Static Create curve collection of subtype determined by gaps between the input curves.  
curveArrayRange(data: any): 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[]): AnyRegion | undefined 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): Polyface | undefined Static return a polyface whose facets area a boolean operation between the input regions.  
polygonXYAreaDifferenceLoopsToPolyface(loopsA: MultiLineStringDataVariant, loopsB: MultiLineStringDataVariant, triangulate: boolean = false): Polyface | undefined Static return a polyface containing the area difference of two XY regions.  
polygonXYAreaIntersectLoopsToPolyface(loopsA: MultiLineStringDataVariant, loopsB: MultiLineStringDataVariant, triangulate: boolean = false): Polyface | undefined Static return a polyface containing the area union of two XY regions.  
polygonXYAreaUnionLoopsToPolyface(loopsA: MultiLineStringDataVariant, loopsB: MultiLineStringDataVariant, triangulate: boolean = false): Polyface | undefined Static return a polyface containing the area union of two XY regions.  
rectangleEdgeTransform(data: AnyCurve | Point3d[] | IndexedXYZCollection, requireClosurePoint: boolean = true): Transform | undefined Static Test if data is one of several forms of a rectangle.  
sortOuterAndHoleLoopsXY(loops: Array<Loop | IndexedXYZCollection>): AnyRegion Static If reverse loops as necessary to make them all have CCW orientation for given outward normal.  
splitPathsByRegionInOnOutXY(curvesToCut: CurveCollection | CurvePrimitive | undefined, region: AnyRegion): object Static * Find intersections of curvesToCut with boundaries of region.  
splitToPathsBetweenFlagBreaks(source: CurveCollection | CurvePrimitive | undefined, makeClones: boolean): BagOfCurves | Path | CurvePrimitive | Loop | undefined 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: 26 August, 2020