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
Return fragments of curvesToCut.
 
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:
* Contiguous LineSegment3d and LineString3d objects.
 
constructCurveXYOffset(curves: Path | Loop, offsetDistanceOrOptions: number | JointOptions): CurveCollection | undefined Static Construct curves that are offset from a Path or Loop
* The construction will remove "some" local effects of features smaller than the offset distance, but will not detect self intersection among widely separated edges.
 
constructPolygonWireXYOffset(points: Point3d[], wrap: boolean, offsetDistance: number): CurveCollection | undefined Static Construct a wire (not area!!) that is offset from given polyline or polygon. Beta
createLoopPathOrBagOfCurves(curves: CurvePrimitive[], wrap: boolean = true): CurveCollection | undefined Static Create curve collection of subtype determined by gaps between the input curves.  
polygonXYAreaDifferenceLoopsToPolyface(loopsA: MultiLineStringDataVariant, loopsB: MultiLineStringDataVariant): Polyface | undefined Static return a polyface containing the area difference of two XY regions.  
polygonXYAreaIntersectLoopsToPolyface(loopsA: MultiLineStringDataVariant, loopsB: MultiLineStringDataVariant): Polyface | undefined Static return a polyface containing the area union of two XY regions.  
polygonXYAreaUnionLoopsToPolyface(loopsA: MultiLineStringDataVariant, loopsB: MultiLineStringDataVariant): Polyface | undefined Static return a polyface containing the area intersection 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 | 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: 08 January, 2020