CGAL 5.3.1 - 2D Regularized Boolean Set-Operations

There are several overloaded function templates called join() that compute the union of two polygons.

A function template in this group has one of the two following signatures:

Parameters

The types Type1, Type2, and `Type3, of the parameters must be convertible to the types specified in a row in the table below, respectively.

Type1 Type2 Type3
Polygon_2 Polygon_2 Polygon_with_holes_2
Polygon_2 Polygon_with_holes_2 Polygon_with_holes_2
Polygon_with_holes_2 Polygon_2 Polygon_with_holes_2
Polygon_with_holes_2 Polygon_with_holes_2 Polygon_with_holes_2
General_polygon_2 General_polygon_2 General_polygon_with_holes_2
General_polygon_2 General_polygon_with_holes_2General_polygon_with_holes_2
General_polygon_with_holes_2General_polygon_2 General_polygon_with_holes_2
General_polygon_with_holes_2General_polygon_with_holes_2General_polygon_with_holes_2
See also
CGAL::complement()
CGAL::do_intersect()
CGAL::intersection()
CGAL::difference()
CGAL::symmetric_difference()

Functions

template<typename Kernel , typename Container >
bool CGAL::join (const Polygon_2< Kernel, Container > &pgn1, const Polygon_2< Kernel, Container > &pgn2, General_polygon_with_holes_2< Polygon_2< Kernel, Container > > &res)
 computes the union of two polygons. More...
 
template<typename Kernel , typename Container >
bool CGAL::join (const Polygon_2< Kernel, Container > &pgn1, const Polygon_with_holes_2< Kernel, Container > &pgn2, General_polygon_with_holes_2< Polygon_2< Kernel, Container > > &res)
 computes the union of two polygons. More...
 
template<typename Kernel , typename Container >
bool CGAL::join (const Polygon_with_holes_2< Kernel, Container > &pgn2, const Polygon_2< Kernel, Container > &pgn1, General_polygon_with_holes_2< Polygon_2< Kernel, Container > > &res)
 computes the union of two polygons. More...
 
template<typename Kernel , typename Container >
bool CGAL::join (const Polygon_with_holes_2< Kernel, Container > &pgn2, const Polygon_with_holes_2< Kernel, Container > &pgn1, General_polygon_with_holes_2< Polygon_2< Kernel, Container > > &res)
 computes the union of two polygons with holes. More...
 
template<typename ArrTraits >
bool CGAL::join (const General_polygon_2< ArrTraits > &pgn1, const General_polygon_2< ArrTraits > &pgn2, General_polygon_with_holes_2< General_polygon_2< ArrTraits > > &res)
 computes the union of two general polygons. More...
 
template<typename ArrTraits >
bool CGAL::join (const General_polygon_2< ArrTraits > &pgn1, const General_polygon_with_holes_2< General_polygon_2< ArrTraits > > &pgn2, General_polygon_with_holes_2< General_polygon_2< ArrTraits > > &res)
 computes the union of two general polygons. More...
 
template<typename ArrTraits >
bool CGAL::join (const General_polygon_with_holes_2< General_polygon_2< ArrTraits > > &pgn2, const General_polygon_2< ArrTraits > &pgn1, General_polygon_with_holes_2< General_polygon_2< ArrTraits > > &res)
 computes the union of two general polygons. More...
 
template<typename Polygon >
bool CGAL::join (const General_polygon_with_holes_2< Polygon > &pgn1, const General_polygon_with_holes_2< Polygon > &pgn2, General_polygon_with_holes_2< Polygon > &res)
 computes the union of two general polygons with holes. More...
 
template<typename InputIterator , typename OutputIterator >
OutputIterator CGAL::join (InputIterator begin, InputIterator end, OutputIterator oi)
 Given a range of polygons (resp. More...
 
template<typename InputIterator1 , typename InputIterator2 , typename OutputIterator >
OutputIterator CGAL::join (InputIterator1 begin1, InputIterator1 end1, InputIterator2 begin2, InputIterator2 end2, OutputIterator oi)
 Given a range of polygons (resp. More...
 
template<typename Kernel , typename Container , typename GpsTraits >
bool CGAL::join (const Polygon_2< Kernel, Container > &pgn1, const Polygon_2< Kernel, Container > &pgn2, General_polygon_with_holes_2< Polygon_2< Kernel, Container > > &res, const GpsTraits &traits)
 computes the union of two polygons. More...
 
template<typename Kernel , typename Container , typename GpsTraits >
bool CGAL::join (const Polygon_2< Kernel, Container > &pgn1, const Polygon_with_holes_2< Kernel, Container > &pgn2, General_polygon_with_holes_2< Polygon_2< Kernel, Container > > &res, const GpsTraits &traits)
 computes the union of two polygons. More...
 
template<typename Kernel , typename Container , typename GpsTraits >
bool CGAL::join (const Polygon_with_holes_2< Kernel, Container > &pgn2, const Polygon_2< Kernel, Container > &pgn1, General_polygon_with_holes_2< Polygon_2< Kernel, Container > > &res, const GpsTraits &traits)
 computes the union of two polygons. More...
 
template<typename Kernel , typename Container , typename GpsTraits >
bool CGAL::join (const Polygon_with_holes_2< Kernel, Container > &pgn2, const Polygon_with_holes_2< Kernel, Container > &pgn1, General_polygon_with_holes_2< Polygon_2< Kernel, Container > > &res, const GpsTraits &traits)
 computes the union of two polygons with holes. More...
 
template<typename ArrTraits , typename GpsTraits >
bool CGAL::join (const General_polygon_2< ArrTraits > &pgn1, const General_polygon_2< ArrTraits > &pgn2, General_polygon_with_holes_2< General_polygon_2< ArrTraits > > &res, const GpsTraits &traits)
 computes the union of two general polygons. More...
 
template<typename ArrTraits , typename GpsTraits >
bool CGAL::join (const General_polygon_2< ArrTraits > &pgn1, const General_polygon_with_holes_2< General_polygon_2< ArrTraits > > &pgn2, General_polygon_with_holes_2< General_polygon_2< ArrTraits > > &res, const GpsTraits &traits)
 computes the union of two general polygons. More...
 
template<typename ArrTraits , typename GpsTraits >
bool CGAL::join (const General_polygon_with_holes_2< General_polygon_2< ArrTraits > > &pgn2, const General_polygon_2< ArrTraits > &pgn1, General_polygon_with_holes_2< General_polygon_2< ArrTraits > > &res, const GpsTraits &traits)
 computes the union of two general polygons. More...
 
template<typename Polygon , typename GpsTraits >
bool CGAL::join (const General_polygon_with_holes_2< Polygon > &pgn1, const General_polygon_with_holes_2< Polygon > &pgn2, General_polygon_with_holes_2< Polygon > &res, const GpsTraits &traits)
 computes the union of two general polygons with holes. More...
 
template<typename InputIterator , typename OutputIterator , typename GpsTraits >
OutputIterator CGAL::join (InputIterator begin, InputIterator end, OutputIterator oi, const GpsTraits &traits)
 Given a range of polygons (resp. More...
 
template<typename InputIterator1 , typename InputIterator2 , typename OutputIterator , typename GpsTraits >
OutputIterator CGAL::join (InputIterator1 begin1, InputIterator1 end1, InputIterator2 begin2, InputIterator2 end2, OutputIterator oi, const GpsTraits &traits)
 Given a range of polygons (resp. More...
 

Function Documentation

◆ join() [1/20]

template<typename Kernel , typename Container >
bool CGAL::join ( const Polygon_2< Kernel, Container > &  pgn1,
const Polygon_2< Kernel, Container > &  pgn2,
General_polygon_with_holes_2< Polygon_2< Kernel, Container > > &  res 
)

#include <CGAL/Boolean_set_operations_2.h>

computes the union of two polygons.

Parameters
pgn1the 1st input polygon.
pgn2the 2nd input polygon.
resthe resulting union of pgn1 and pgn2.
Returns
true if the two input polygons overlap.
Examples:
Boolean_set_operations_2/set_union.cpp, and Boolean_set_operations_2/simple_join_intersect.cpp.

◆ join() [2/20]

template<typename Kernel , typename Container >
bool CGAL::join ( const Polygon_2< Kernel, Container > &  pgn1,
const Polygon_with_holes_2< Kernel, Container > &  pgn2,
General_polygon_with_holes_2< Polygon_2< Kernel, Container > > &  res 
)

#include <CGAL/Boolean_set_operations_2.h>

computes the union of two polygons.

Parameters
pgn1the 1st input polygon.
pgn2the 2nd input polygon.
resthe resulting union of pgn1 and pgn2.
Returns
true if the two input polygons overlap.

◆ join() [3/20]

template<typename Kernel , typename Container >
bool CGAL::join ( const Polygon_with_holes_2< Kernel, Container > &  pgn2,
const Polygon_2< Kernel, Container > &  pgn1,
General_polygon_with_holes_2< Polygon_2< Kernel, Container > > &  res 
)

#include <CGAL/Boolean_set_operations_2.h>

computes the union of two polygons.

Parameters
pgn1the 1st input polygon.
pgn2the 2nd input polygon.
resthe resulting union of pgn1 and pgn2.
Returns
true if the two input polygons overlap.

◆ join() [4/20]

template<typename Kernel , typename Container >
bool CGAL::join ( const Polygon_with_holes_2< Kernel, Container > &  pgn2,
const Polygon_with_holes_2< Kernel, Container > &  pgn1,
General_polygon_with_holes_2< Polygon_2< Kernel, Container > > &  res 
)

#include <CGAL/Boolean_set_operations_2.h>

computes the union of two polygons with holes.

Parameters
pgn1the 1st input polygon.
pgn2the 2nd input polygon.
resthe resulting union of pgn1 and pgn2.
Returns
true if the two input polygons overlap.

◆ join() [5/20]

template<typename ArrTraits >
bool CGAL::join ( const General_polygon_2< ArrTraits > &  pgn1,
const General_polygon_2< ArrTraits > &  pgn2,
General_polygon_with_holes_2< General_polygon_2< ArrTraits > > &  res 
)

#include <CGAL/Boolean_set_operations_2.h>

computes the union of two general polygons.

Parameters
pgn1the 1st input polygon.
pgn2the 2nd input polygon.
resthe resulting union of pgn1 and pgn2.
Returns
true if the two input polygons overlap.
Precondition
ArrTraits must be a model of the concept ArrangementDirectionalXMonotoneTraits_2.

◆ join() [6/20]

template<typename ArrTraits >
bool CGAL::join ( const General_polygon_2< ArrTraits > &  pgn1,
const General_polygon_with_holes_2< General_polygon_2< ArrTraits > > &  pgn2,
General_polygon_with_holes_2< General_polygon_2< ArrTraits > > &  res 
)

#include <CGAL/Boolean_set_operations_2.h>

computes the union of two general polygons.

Parameters
pgn1the 1st input polygon.
pgn2the 2nd input polygon.
resthe resulting union of pgn1 and pgn2.
Returns
true if the two input polygons overlap.
Precondition
ArrTraits must be a model of the concept ArrangementDirectionalXMonotoneTraits_2.

◆ join() [7/20]

template<typename ArrTraits >
bool CGAL::join ( const General_polygon_with_holes_2< General_polygon_2< ArrTraits > > &  pgn2,
const General_polygon_2< ArrTraits > &  pgn1,
General_polygon_with_holes_2< General_polygon_2< ArrTraits > > &  res 
)

#include <CGAL/Boolean_set_operations_2.h>

computes the union of two general polygons.

Parameters
pgn1the 1st input polygon.
pgn2the 2nd input polygon.
resthe resulting union of pgn1 and pgn2.
Returns
true if the two input polygons overlap.
Precondition
ArrTraits must be a model of the concept ArrangementDirectionalXMonotoneTraits_2.

◆ join() [8/20]

template<typename Polygon >
bool CGAL::join ( const General_polygon_with_holes_2< Polygon > &  pgn1,
const General_polygon_with_holes_2< Polygon > &  pgn2,
General_polygon_with_holes_2< Polygon > &  res 
)

#include <CGAL/Boolean_set_operations_2.h>

computes the union of two general polygons with holes.

Parameters
pgn1the 1st input polygon.
pgn2the 2nd input polygon.
resthe resulting union of pgn1 and pgn2.
Returns
true if the two input polygons overlap.

◆ join() [9/20]

template<typename InputIterator , typename OutputIterator >
OutputIterator CGAL::join ( InputIterator  begin,
InputIterator  end,
OutputIterator  oi 
)

#include <CGAL/Boolean_set_operations_2.h>

Given a range of polygons (resp.

general polygons) or a range of general polygons with holes (resp. general polygons with holes) computes the union of all polygons in the range and inserts the resulting polygons with holes (resp. general polygons with holes) into a container via an output iterator.

Parameters
beginthe first iterator of the input range. Its value type is either Polygon_2 (resp. General_polygon_2) or Polygon_with_holes_2 (resp. General_polygon_with_holes_2).
endthe past-the-end iterator of the input range. Its value type is either Polygon_2 (resp. General_polygon_2) or Polygon_with_holes_2 (resp. General_polygon_with_holes_2).
oithe output iterator for the result. Its dereference type must be convertible to Polygon_with_holes_2 (resp. General_polygons_with_holes_2).
Returns
the past-the-end iterator of the output container.

◆ join() [10/20]

template<typename InputIterator1 , typename InputIterator2 , typename OutputIterator >
OutputIterator CGAL::join ( InputIterator1  begin1,
InputIterator1  end1,
InputIterator2  begin2,
InputIterator2  end2,
OutputIterator  oi 
)

#include <CGAL/Boolean_set_operations_2.h>

Given a range of polygons (resp.

general polygons) and a range of general polygons with holes (resp. general polygons with holes) computes the union of all polygons in the two ranges and inserts the resulting polygons with holes (resp. general polygons with holes) into a container via an output iterator.

Parameters
begin1the first iterator of the 1st input range. Its value type is Polygon_2 (resp. General_polygon_2).
end1the past-the-end iterator of the 1st input range. Its value type is Polygon_2 (resp. General_polygon_2).
begin2the first iterator of the 2nd input range. Its value type is Polygon_with_holes_2 (resp. General_polygon_with_holes_2).
end2the past-the-end iterator of the 2nd input range. Its value type is Polygon_with_holes_2 (resp. General_polygon_with_holes_2).
oithe output iterator for the result. Its dereference type must be convertible to Polygon_with_holes_2 (resp. General_polygons_with_holes_2).
Returns
the past-the-end iterator of the output container.

◆ join() [11/20]

template<typename Kernel , typename Container , typename GpsTraits >
bool CGAL::join ( const Polygon_2< Kernel, Container > &  pgn1,
const Polygon_2< Kernel, Container > &  pgn2,
General_polygon_with_holes_2< Polygon_2< Kernel, Container > > &  res,
const GpsTraits &  traits 
)

#include <CGAL/Boolean_set_operations_2.h>

computes the union of two polygons.

Parameters
pgn1the 1st input polygon.
pgn2the 2nd input polygon.
resthe resulting union of pgn1 and pgn2.
traitsa traits object.
Returns
true if the two input polygons overlap.
Precondition
GpsTraits must be a model of the concept GeneralPolygonSetTraits_2.

◆ join() [12/20]

template<typename Kernel , typename Container , typename GpsTraits >
bool CGAL::join ( const Polygon_2< Kernel, Container > &  pgn1,
const Polygon_with_holes_2< Kernel, Container > &  pgn2,
General_polygon_with_holes_2< Polygon_2< Kernel, Container > > &  res,
const GpsTraits &  traits 
)

#include <CGAL/Boolean_set_operations_2.h>

computes the union of two polygons.

Parameters
pgn1the 1st input polygon.
pgn2the 2nd input polygon.
resthe resulting union of pgn1 and pgn2.
traitsa traits object.
Returns
true if the two input polygons overlap.
Precondition
GpsTraits must be a model of the concept GeneralPolygonSetTraits_2.

◆ join() [13/20]

template<typename Kernel , typename Container , typename GpsTraits >
bool CGAL::join ( const Polygon_with_holes_2< Kernel, Container > &  pgn2,
const Polygon_2< Kernel, Container > &  pgn1,
General_polygon_with_holes_2< Polygon_2< Kernel, Container > > &  res,
const GpsTraits &  traits 
)

#include <CGAL/Boolean_set_operations_2.h>

computes the union of two polygons.

Parameters
pgn1the 1st input polygon.
pgn2the 2nd input polygon.
resthe resulting union of pgn1 and pgn2.
traitsa traits object.
Returns
true if the two input polygons overlap.
Precondition
GpsTraits must be a model of the concept GeneralPolygonSetTraits_2.

◆ join() [14/20]

template<typename Kernel , typename Container , typename GpsTraits >
bool CGAL::join ( const Polygon_with_holes_2< Kernel, Container > &  pgn2,
const Polygon_with_holes_2< Kernel, Container > &  pgn1,
General_polygon_with_holes_2< Polygon_2< Kernel, Container > > &  res,
const GpsTraits &  traits 
)

#include <CGAL/Boolean_set_operations_2.h>

computes the union of two polygons with holes.

Parameters
pgn1the 1st input polygon.
pgn2the 2nd input polygon.
resthe resulting union of pgn1 and pgn2.
traitsa traits object.
Returns
true if the two input polygons overlap.
Precondition
GpsTraits must be a model of the concept GeneralPolygonSetTraits_2.

◆ join() [15/20]

template<typename ArrTraits , typename GpsTraits >
bool CGAL::join ( const General_polygon_2< ArrTraits > &  pgn1,
const General_polygon_2< ArrTraits > &  pgn2,
General_polygon_with_holes_2< General_polygon_2< ArrTraits > > &  res,
const GpsTraits &  traits 
)

#include <CGAL/Boolean_set_operations_2.h>

computes the union of two general polygons.

Parameters
pgn1the 1st input polygon.
pgn2the 2nd input polygon.
resthe resulting union of pgn1 and pgn2.
traitsa traits object.
Returns
true if the two input polygons overlap.
Precondition
ArrTraits must be a model of the concept ArrangementDirectionalXMonotoneTraits_2.
GpsTraits must be a model of the concept GeneralPolygonSetTraits_2.

◆ join() [16/20]

template<typename ArrTraits , typename GpsTraits >
bool CGAL::join ( const General_polygon_2< ArrTraits > &  pgn1,
const General_polygon_with_holes_2< General_polygon_2< ArrTraits > > &  pgn2,
General_polygon_with_holes_2< General_polygon_2< ArrTraits > > &  res,
const GpsTraits &  traits 
)

#include <CGAL/Boolean_set_operations_2.h>

computes the union of two general polygons.

Parameters
pgn1the 1st input polygon.
pgn2the 2nd input polygon.
resthe resulting union of pgn1 and pgn2.
traitsa traits object.
Returns
true if the two input polygons overlap.
Precondition
ArrTraits must be a model of the concept ArrangementDirectionalXMonotoneTraits_2.
GpsTraits must be a model of the concept GeneralPolygonSetTraits_2.

◆ join() [17/20]

template<typename ArrTraits , typename GpsTraits >
bool CGAL::join ( const General_polygon_with_holes_2< General_polygon_2< ArrTraits > > &  pgn2,
const General_polygon_2< ArrTraits > &  pgn1,
General_polygon_with_holes_2< General_polygon_2< ArrTraits > > &  res,
const GpsTraits &  traits 
)

#include <CGAL/Boolean_set_operations_2.h>

computes the union of two general polygons.

Parameters
pgn1the 1st input polygon.
pgn2the 2nd input polygon.
resthe resulting union of pgn1 and pgn2.
traitsa traits object.
Returns
true if the two input polygons overlap.
Precondition
ArrTraits must be a model of the concept ArrangementDirectionalXMonotoneTraits_2.
GpsTraits must be a model of the concept GeneralPolygonSetTraits_2.

◆ join() [18/20]

template<typename Polygon , typename GpsTraits >
bool CGAL::join ( const General_polygon_with_holes_2< Polygon > &  pgn1,
const General_polygon_with_holes_2< Polygon > &  pgn2,
General_polygon_with_holes_2< Polygon > &  res,
const GpsTraits &  traits 
)

#include <CGAL/Boolean_set_operations_2.h>

computes the union of two general polygons with holes.

Parameters
pgn1the 1st input polygon.
pgn2the 2nd input polygon.
resthe resulting union of pgn1 and pgn2.
traitsa traits object.
Returns
true if the two input polygons overlap.
Precondition
GpsTraits must be a model of the concept GeneralPolygonSetTraits_2.

◆ join() [19/20]

template<typename InputIterator , typename OutputIterator , typename GpsTraits >
OutputIterator CGAL::join ( InputIterator  begin,
InputIterator  end,
OutputIterator  oi,
const GpsTraits &  traits 
)

#include <CGAL/Boolean_set_operations_2.h>

Given a range of polygons (resp.

general polygons) or a range of general polygons with holes (resp. general polygons with holes) computes the union of all polygons in the range and inserts the resulting polygons with holes (resp. general polygons with holes) into a container via an output iterator.

Parameters
beginthe first iterator of the input range. Its value type is either Polygon_2 (resp. General_polygon_2) or Polygon_with_holes_2 (resp. General_polygon_with_holes_2).
endthe past-the-end iterator of the input range. Its value type is either Polygon_2 (resp. General_polygon_2) or Polygon_with_holes_2 (resp. General_polygon_with_holes_2).
oithe output iterator for the result. Its dereference type must be convertible to Polygon_with_holes_2 (resp. General_polygons_with_holes_2).
traitsa traits object.
Returns
the past-the-end iterator of the output container.
Precondition
GpsTraits must be a model of the concept GeneralPolygonSetTraits_2.

◆ join() [20/20]

template<typename InputIterator1 , typename InputIterator2 , typename OutputIterator , typename GpsTraits >
OutputIterator CGAL::join ( InputIterator1  begin1,
InputIterator1  end1,
InputIterator2  begin2,
InputIterator2  end2,
OutputIterator  oi,
const GpsTraits &  traits 
)

#include <CGAL/Boolean_set_operations_2.h>

Given a range of polygons (resp.

general polygons) and a range of general polygons with holes (resp. general polygons with holes) computes the union of all polygons in the two ranges and inserts the resulting polygons with holes (resp. general polygons with holes) into a container via an output iterator.

Parameters
begin1the first iterator of the 1st input range. Its value type is Polygon_2 (resp. General_polygon_2).
end1the past-the-end iterator of the 1st input range. Its value type is Polygon_2 (resp. General_polygon_2).
begin2the first iterator of the 2nd input range. Its value type is Polygon_with_holes_2 (resp. General_polygon_with_holes_2).
end2the past-the-end iterator of the 2nd input range. Its value type is Polygon_with_holes_2 (resp. General_polygon_with_holes_2).
oithe output iterator for the result. Its dereference type must be convertible to Polygon_with_holes_2 (resp. General_polygons_with_holes_2).
traitsa traits object.
Returns
the past-the-end iterator of the output container.
Precondition
GpsTraits must be a model of the concept GeneralPolygonSetTraits_2.