simplifyRegionType MethodStatic

Return the region's simplest representation by stripping redundant parent(s).

  • No Boolean operations are performed.

simplifyRegionType(region: AnyRegion): AnyRegion

@returns * For a UnionRegion with exactly one child, return the child if it is a Loop, or if it is a ParityRegion with multiple children; otherwise return the ParityRegion's Loop.

  • For a ParityRegion with exactly one child, return the Loop.
  • All other inputs returned unchanged.

@see simplifyRegion

Parameter Type Description
region AnyRegion input region (unchanged). Assumed to have at least one child.

Returns - AnyRegion

  • For a UnionRegion with exactly one child, return the child if it is a Loop, or if it is a ParityRegion with multiple children; otherwise return the ParityRegion's Loop.
  • For a ParityRegion with exactly one child, return the Loop.
  • All other inputs returned unchanged.

Defined in

Last Updated: 07 June, 2025