Skip to content

union2Union2Union2union2union2🔗

Short description🔗

union2Union2Union2union2union2 — Return the union of two regions.

Signature🔗

union2( region Region1, region Region2, out region RegionUnion )void Union2( const HObject& Region1, const HObject& Region2, HObject* RegionUnion )static void HOperatorSet.Union2( HObject region1, HObject region2, out HObject regionUnion )def union2( region_1: HObject, region_2: HObject ) -> HObject

Herror union2( const Hobject Region1, const Hobject Region2, Hobject* RegionUnion )

Herror T_union2( const Hobject Region1, const Hobject Region2, Hobject* RegionUnion )

HRegion HRegion::Union2( const HRegion& Region2 ) const

HRegion HRegion.Union2( HRegion region2 )

Description🔗

union2Union2 computes the union of the region in Region1region1region_1 with all regions in Region2region2region_2. Internally, all regions of Region2region2region_2 are united to a single region before the individual regions of Region1region1region_1 are united with the already united region. This means that union2Union2 is not commutative!

Execution information🔗

Execution information
  • Multithreading type: reentrant (runs in parallel with non-exclusive operators).

  • Multithreading scope: global (may be called from any thread).

  • Processed without parallelization.

Parameters🔗

Region1region1region_1 (input_object) region(-array) → objectHObjectHRegionHObjectHobject

Region for which the union with all regions in Region2 is to be computed.

Region2region2region_2 (input_object) region(-array) → objectHObjectHRegionHObjectHobject

Regions which should be added to Region1.

RegionUnionregionUnionregion_union (output_object) region(-array) → objectHObjectHRegionHObjectHobject *

Resulting regions.

Number of elements: RegionUnion == Region1

Complexity🔗

Let \(F\) be the sum of all areas of the input regions. Then the runtime complexity is \(O(\log(\sqrt{F}) * \sqrt{F})\).

Result🔗

union2Union2 always returns 2 (H_MSG_TRUE). The behavior in case of empty input (no regions given) can be set via set_system('no_object_result',<Result>) and the behavior in case of an empty input region via set_system('empty_region_result',<Result>). If necessary, an exception is raised.

Combinations with other operators🔗

Combinations

Possible predecessors

thresholdThreshold, connectionConnection, regiongrowingRegiongrowing, pouringPouring

Possible successors

select_shapeSelectShape, disp_regionDispRegion

Alternatives

union1Union1

See also

intersectionIntersection, complementComplement

Module🔗

Foundation