Skip to content

union2_closed_polygons_xldunion2_closed_polygons_xldUnion2ClosedPolygonsXldUnion2ClosedPolygonsXldunion2_closed_polygons_xldunion2_closed_polygons_xldπŸ”—

Short descriptionπŸ”—

union2_closed_polygons_xldunion2_closed_polygons_xldUnion2ClosedPolygonsXldUnion2ClosedPolygonsXldunion2_closed_polygons_xldunion2_closed_polygons_xld β€” Compute the union of closed polygons.

SignatureπŸ”—

union2_closed_polygons_xld( xld_poly Polygons1, xld_poly Polygons2, out xld_poly PolygonsUnion )union2_closed_polygons_xld( Polygons1, Polygons2 : PolygonsUnion : : )void Union2ClosedPolygonsXld( const HObject& Polygons1, const HObject& Polygons2, HObject* PolygonsUnion )static void HOperatorSet.Union2ClosedPolygonsXld( HObject polygons1, HObject polygons2, out HObject polygonsUnion )def union2_closed_polygons_xld( polygons_1: HObject, polygons_2: HObject ) -> HObject

Herror union2_closed_polygons_xld( const Hobject Polygons1, const Hobject Polygons2, Hobject* PolygonsUnion )

Herror T_union2_closed_polygons_xld( const Hobject Polygons1, const Hobject Polygons2, Hobject* PolygonsUnion )

HXLDPoly HXLDPoly::Union2ClosedPolygonsXld( const HXLDPoly& Polygons2 ) const

HXLDPoly HXLDPoly.Union2ClosedPolygonsXld( HXLDPoly polygons2 )

DescriptionπŸ”—

The operator union2_closed_polygons_xldUnion2ClosedPolygonsXld calculates the union of the regions enclosed by the polygons Polygons1polygons1polygons_1 and Polygons2polygons2polygons_2. The boundaries of this union are returned in PolygonsUnionpolygonsUnionpolygons_union.

If the individual input polygons are not closed, they are closed automatically by connecting their start and end points.

Internally, first, the regions enclosed by each set of polygons (Polygons1polygons1polygons_1 and Polygons2polygons2polygons_2, respectively) are determined as described below. Then, the union of these two regions is calculated.

In the following, the two sets of input polygons are referred to as boundary sets. A boundary set consists of an arbitrary number of boundaries (the individual polygons of Polygons1polygons1polygons_1 and Polygons2polygons2polygons_2, respectively). Each boundary may be convex or concave and self-intersecting. Internal holes may be formed by the nesting of boundaries.

The region enclosed by such a boundary set is defined by the so-called Even-Odd-Rule. Thus, it consists of all points with the following property: The line constructed by connecting the point with another reference point that lies outside of the region has an odd number of intersections with boundaries.

More descriptive, this means that a boundary defines a hole in the region enclosed by another boundary if it lies completely inside that region. Similarly, the overlapping area of two separate boundaries of one boundary set is taken as a β€œhole”, i.e., it does not belong to the region enclosed by the two boundaries. Note that the region enclosed by a boundary does not depend on the orientation of the boundary.

A self-intersecting boundary may be split at the intersection point or it is reordered such that it touches itself at the intersection point. The resulting boundaries are treated as separate boundaries.

AttentionπŸ”—

The resulting polygons PolygonsUnionpolygonsUnionpolygons_union contain no references to the XLD contours that are possibly referenced by Polygons1polygons1polygons_1 and Polygons2polygons2polygons_2. Hence, operators that access the contours associated with a polygon, e.g., split_contours_xldSplitContoursXld will not work correctly.

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πŸ”—

Polygons1polygons1polygons_1 (input_object) xld_poly(-array) β†’ objectobjectHObjectHXLDPolyHObjectHobject

Polygons enclosing the first region.

Polygons2polygons2polygons_2 (input_object) xld_poly(-array) β†’ objectobjectHObjectHXLDPolyHObjectHobject

Polygons enclosing the second region.

PolygonsUnionpolygonsUnionpolygons_union (output_object) xld_poly(-array) β†’ objectobjectHObjectHXLDPolyHObjectHobject *

Polygons enclosing the union.

ResultπŸ”—

union2_closed_polygons_xldUnion2ClosedPolygonsXld returns 2 (H_MSG_TRUE) if all parameters are correct. If necessary, an exception is raised.

Combinations with other operatorsπŸ”—

Combinations

Possible predecessors

gen_polygons_xldGenPolygonsXld

Alternatives

union2Union2

See also

difference_closed_polygons_xldDifferenceClosedPolygonsXld, symm_difference_closed_polygons_xldSymmDifferenceClosedPolygonsXld, intersection_closed_polygons_xldIntersectionClosedPolygonsXld, union2_closed_contours_xldUnion2ClosedContoursXld

ModuleπŸ”—

Foundation