ParityRegion Class
- A
ParityRegionis a collection ofLoopobjects. - The loops collectively define a planar region.
- A point is "in" the composite region if it is "in" an odd number of the loops.
@see Curve Collections learning article.
Extends
Methods
| Name | Description | |
|---|---|---|
| constructor(): ParityRegion | Construct parity region with empty loop array | |
| addLoops(data?: Loop | Loop[] | Loop[][]): void | Add loops (recursively) to this region's children | |
| announceToCurveProcessor(processor: RecursiveCurveProcessor, indexInParent: number = -1): void | Invoke processor.announceParityRegion(this, indexInParent) |
|
| clone(): ParityRegion | Return a deep copy. | |
| cloneEmptyPeer(): ParityRegion | Create a new empty parity region. | |
| cloneStroked(options?: StrokeOptions): ParityRegion | Stroke these curves into a new ParityRegion. | |
| dgnBoundaryType(): number | Return the boundary type (4) of a corresponding MicroStation CurveVector | |
| dispatchToGeometryHandler(handler: GeometryHandler): any | Second step of double dispatch: call handler.handleRegion(this) |
|
| getChild(i: number): undefined | Loop | Get child i by index. |
|
| isSameGeometryClass(other: GeometryQuery): boolean | Test if other is an instance of ParityRegion |
|
| tryAddChild(child: AnyCurve): boolean | Add child to this parity region (by capturing it). |
|
| create(...data: Loop[]): ParityRegion Static | Create a parity region by capturing the given loops as children. | |
| createLoops(data?: Loop | Loop[] | Loop[][]): Loop | ParityRegion Static | Return a single loop or parity region with given loops. |
Inherited methods
| Name | Inherited from | Description |
|---|---|---|
| allTangents(spacePoint: Point3d, options?: TangentOptions): undefined | CurveLocationDetail[] Inherited | CurveCollection | Return all points P on the contained curves such that the line containing spacePoint and P is tangent to the |
| checkForNonLinearPrimitives(): boolean Inherited | CurveCollection | Return true if the curve collection has any primitives other than LineSegment3d and LineString3d |
| cloneTransformed(transform: Transform): undefined | CurveCollection Inherited | CurveCollection | Create a deep copy of transformed curves. |
| cloneWithExpandedLineStrings(): CurveCollection Inherited | CurveCollection | Create a deep copy with all linestrings broken down into multiple LineSegment3d. |
| closestPoint(spacePoint: Point3d, _extend: VariantCurveExtendParameter = false, result?: CurveLocationDetail): undefined | CurveLocationDetail Inherited | CurveCollection | Return the closest point on the contained curves. |
| closestTangent(spacePoint: Point3d, options?: TangentOptions): undefined | CurveLocationDetail Inherited | CurveCollection | Return the point P on the contained curves such that the line containing spacePoint and P is tangent to the |
| collectCurvePrimitives(collectorArray?: CurvePrimitive[], smallestPossiblePrimitives: boolean = false, explodeLineStrings: boolean = false): CurvePrimitive[] Inherited | CurveCollection | Return an array containing all CurvePrimitives in the instance. |
| emitTangents(spacePoint: Point3d, announceTangent: (tangent: CurveLocationDetail) => any, options?: TangentOptions): void Inherited | CurveCollection | Announce all points P on the contained curves such that the line containing spacePoint and P is tangent to |
| extendRange(rangeToExtend: Range3d, transform?: Transform): void Inherited | CurveCollection | Extend (increase) the given range as needed to encompass all curves in the curve collection. |
| findParentOfDescendant(descendant: AnyCurve): undefined | CurveCollection Inherited | CurveCollection | Return the immediate parent of the input curve in the instance, or undefined if it is not a descendant. |
| isAlmostEqual(other: GeometryQuery): boolean Inherited | CurveCollection | Test for exact structure and nearly identical geometry. |
| isAnyRegion(): this is AnyRegion Inherited | CurveCollection | Type guard for AnyRegion |
| isLoop(): this is Loop Inherited | CurveCollection | Type guard for Loop |
| isPath(): this is Path Inherited | CurveCollection | Type guard for Path |
| maxGap(): number Inherited | CurveCollection | Return the max gap between adjacent primitives in Path and Loop collections. |
| projectedParameterRange(ray: Vector3d | Ray3d, lowHigh?: Range1d): undefined | Range1d Inherited | CurveCollection | Project instance geometry (via dispatch) onto the given ray, and return the extreme fractional parameters |
| range(transform?: Transform, result?: Range3d): Range3d Inherited | CurveCollection | Return the range of the entire GeometryQuery tree. |
| reverseInPlace(): void Inherited | CurveCollection | Reverse the collection's data so that each child curve's fractional stroking moves in the opposite direction. |
| sumLengths(): number Inherited | CurveCollection | Return the sum of the lengths of all contained curves. |
| tryTransformInPlace(transform: Transform): boolean Inherited | CurveCollection | Apply transform recursively to children |
| tryTranslateInPlace(dx: number, dy: number = 0.0, dz: number = 0.0): boolean Inherited | CurveCollection | Try to move the geometry by dx,dy,dz. |
| areAlmostEqual(a: GeometryQuery, b: GeometryQuery): boolean Static Inherited | CurveCollection | Apply instance method isAlmostEqual if both are defined. |
| createCurveLocationDetailOnAnyCurvePrimitive(source: GeometryQuery, fraction: number = 0.5): undefined | CurveLocationDetail Static Inherited | CurveCollection | Find any CurvePrimitive in the source and evaluate it at the given fraction. |
Properties
| Name | Type | Description | |
|---|---|---|---|
| _children Protected | Loop[] | Array of loops in this parity region. | |
| children Accessor ReadOnly | Loop[] | Return the array of loops in this parity region. | |
| curveCollectionType Readonly | "parityRegion" | String name for schema properties |
Inherited properties
| Name | Type | Inherited from | Description |
|---|---|---|---|
| geometryCategory Readonly Inherited | "curveCollection" | CurveCollection | String name for schema properties |
| isAnyRegionType Accessor Inherited ReadOnly | boolean | CurveCollection | Return true for planar region types: * Loop* ParityRegion* UnionRegion |
| isClosedPath Accessor Inherited ReadOnly | boolean | CurveCollection | Return true for a single-loop planar region type, i.e. Loop.* This is NOT a test for physical closure of a Path. |
| isInner Inherited | boolean | CurveCollection | Flag for inner loop status. |
| isOpenPath Accessor Inherited ReadOnly | boolean | CurveCollection | Return true for a Path, i.e. a chain of curves joined head-to-tail |
Defined in
- curve/ParityRegion.ts Line 25
Last Updated: 24 October, 2025
Found something wrong, missing, or unclear on this page? Raise an issue in our repo.