CGAL 6.2 - 2D Regularized Boolean Set-Operations: Polygon Intersection Functions

CGAL 6.2 - 2D Regularized Boolean Set-Operations

Loading...
Searching...
No Matches
Functions
Polygon Intersection Functions
Reference Manual

##

There are several overloaded function templates called `intersection()` that compute the intersection of two or more polygons and insert the resulting polygons with holes into a container via an output iterator.

A function template in this group that accepts two input polygons has one of the following signatures:

1.1. | `OutputIterator intersection(const Type1& pgn1, const Type2& pgn2, OutputIterator oi, UsePolylines = Tag_true());`
1.2. | `OutputIterator intersection(const Type1& pgn1, const Type2& pgn2, OutputIterator oi);`
2. | `OutputIterator intersection(const Type1& pgn1, const Type2& pgn2, OutputIterator oi, const GpsTraits& traits);`

There are also function templates that accept one or two ranges of input polygons:

3.1. | `OutputIterator intersection(InputIterator begin, InputIterator end, OutputIterator oi, UsePolylines = Tag_true());`
3.2. | `OutputIterator intersection(InputIterator begin, InputIterator end, OutputIterator oi);`
4. | `OutputIterator intersection(InputIterator begin, InputIterator end, OutputIterator oi, const GpsTraits& traits);`
5.1. | `OutputIterator intersection(InputIterator1 begin1, InputIterator1 end1, InputIterator2 begin2, InputIterator2 end2, OutputIterator oi, UsePolylines = Tag_true());`
5.2. | `OutputIterator intersection(InputIterator1 begin1, InputIterator1 end1, InputIterator2 begin2, InputIterator2 end2, OutputIterator oi);`
6. | `OutputIterator intersection(InputIterator1 begin1, InputIterator1 end1, InputIterator2 begin2, InputIterator2 end2, OutputIterator oi, const GpsTraits& traits);`

Template Parameters

  Kernel | a model of the concept `PolygonTraits_2`.
  Container | a model of the concept `Container`; defaults to `std::vector<Kernel::Point_2`>.
  ArrTraits | a model of the concept `AosDirectionalXMonotoneTraits_2`.
  GpsTraits | a model of the concept `GeneralPolygonSetTraits_2`, which must be convertible to `ArrTraits`.
  UsePolylines | determines whether the boundaries of the input polygons are treated as cyclic sequences of single ( \(x\)-monotone) segments or as cyclic sequences of ( \(x\)-monotone) polylines. If substituted with `CGAL::Tag_true`, which is the default, the input polygons are converted to general polygons bounded by polylines before the operation is actually performed. Then, the resulting general polygons with holes are converted back to standard polygons with holes. If substituted with `CGAL::Tag_false`, the input polygons are used as is. Refer to Traits Selection for more information.

Parameters

  oi | the output iterator for the result.

- The types `Type1` and `Type2` of the parameters and of `InputIterator1::value_type` and `InputIterator2::value_type` must be convertible to the types specified in a row in the table below, respectively. The 3rd column specifies the corresponding dereference type of the output iterator.
- The types that apply to signatures (1.1.) and (5.1.) above are restricted to those listed in rows 1–4 in the table below.
- The types that apply to signatures (1.2.) and (5.2.) above are restricted to those listed in rows 5–8 in the table below.
- The type of `InputIterator::value_type` in (3.1.) above must be convertible to either `Polygon_2` or `Polygon_with_holes_2`.
- The type of `InputIterator::value_type` in (3.2.) above must be convertible to either `General_polygon_2` or `General_polygon_with_holes_2`.

| `Type1` | `Type2` | Dereference Type of `oi`
--- | --- | --- | ---
1 | `Polygon_2` | `Polygon_2` | `Polygon_with_holes_2`
2 | `Polygon_2` | `Polygon_with_holes_2` | `Polygon_with_holes_2`
3 | `Polygon_with_holes_2` | `Polygon_2` | `Polygon_with_holes_2`
4 | `Polygon_with_holes_2` | `Polygon_with_holes_2` | `Polygon_with_holes_2`
5 | `General_polygon_2` | `General_polygon_2` | `General_polygon_with_holes_2`
6 | `General_polygon_2` | `General_polygon_with_holes_2` | `General_polygon_with_holes_2`
7 | `General_polygon_with_holes_2` | `General_polygon_2` | `General_polygon_with_holes_2`
8 | `General_polygon_with_holes_2` | `General_polygon_with_holes_2` | `General_polygon_with_holes_2`

Parameters

  pgn1,pgn2 | the input polygons.
  (end,begin) | a range of input polygons.
  (end1,begin1) | the first range of input polygons.
  (end2,begin2) | the second range of input polygons.
  oi | the output iterator for the result.
  traits | an optional traits object.

See also
  `CGAL::complement()`
  `CGAL::do_intersect()`
  `CGAL::join()`
  `CGAL::difference()`
  `CGAL::symmetric_difference()`
  Polygon_2<Kernel, Container>
  Polygon_with_holes_2<Kernel, Container>

## Functions
template<typename Kernel , typename Container , typename OutputIterator >
OutputIterator | CGAL::intersection (const Polygon_2< Kernel, Container > &pgn1, const Polygon_2< Kernel, Container > &pgn2, OutputIterator oi)
| computes the intersection of two polygons and inserts the resulting polygons with holes into a container via an output iterator.
template<typename Kernel , typename Container , typename OutputIterator , typename UsePolylines >
OutputIterator | CGAL::intersection (const Polygon_2< Kernel, Container > &pgn1, const Polygon_2< Kernel, Container > &pgn2, OutputIterator oi, UsePolylines=Tag_true())
| computes the intersection of two polygons and inserts the resulting polygons with holes into a container via an output iterator.
template<typename Kernel , typename Container , typename OutputIterator >
OutputIterator | CGAL::intersection (const Polygon_2< Kernel, Container > &pgn1, const Polygon_with_holes_2< Kernel, Container > &pgn2, OutputIterator oi)
| computes the intersection of two polygons and inserts the resulting polygons with holes into a container via an output iterator.
template<typename Kernel , typename Container , typename OutputIterator , typename UsePolylines >
OutputIterator | CGAL::intersection (const Polygon_2< Kernel, Container > &pgn1, const Polygon_with_holes_2< Kernel, Container > &pgn2, OutputIterator oi, UsePolylines=Tag_true())
| computes the intersection of two polygons and inserts the resulting polygons with holes into a container via an output iterator.
template<typename Kernel , typename Container , typename OutputIterator >
OutputIterator | CGAL::intersection (const Polygon_with_holes_2< Kernel, Container > &pgn1, const Polygon_2< Kernel, Container > &pgn2, OutputIterator oi)
| computes the intersection of two polygons and inserts the resulting polygons with holes into a container via an output iterator.
template<ctypename Kernel, ctypename Container, ctypename OutputIterator, typename UsePolylines >
OutputIterator | CGAL::intersection (const Polygon_with_holes_2< Kernel, Container > &pgn1, const Polygon_2< Kernel, Container > &pgn2, OutputIterator oi, UsePolylines=Tag_true())
| computes the intersection of two polygons and inserts the resulting polygons with holes into a container via an output iterator.
template<typename Kernel , typename Container , typename OutputIterator >
OutputIterator | CGAL::intersection (const Polygon_with_holes_2< Kernel, Container > &pgn1, const Polygon_with_holes_2< Kernel, Container > &pgn2, OutputIterator oi)
| computes the intersection of two polygons and inserts the resulting polygons with holes into a container via an output iterator.
template<typename Kernel , typename Container , typename OutputIterator , typename UsePolylines >
OutputIterator | CGAL::intersection (const Polygon_with_holes_2< Kernel, Container > &pgn1, const Polygon_with_holes_2< Kernel, Container > &pgn2, OutputIterator oi, UsePolylines=Tag_true())
| computes the intersection of two polygons and inserts the resulting polygons with holes into a container via an output iterator.
template<typename ArrTraits , typename OutputIterator >
OutputIterator | CGAL::intersection (const General_polygon_2< ArrTraits > &pgn1, const General_polygon_2< ArrTraits > &pgn2, OutputIterator oi)
| computes the intersection of two general polygons and inserts the resulting general polygons with holes into a container via an output iterator.
template<typename ArrTraits , typename OutputIterator >
OutputIterator | CGAL::intersection (const General_polygon_with_holes_2< General_polygon_2< ArrTraits > > &pgn1, const General_polygon_2< ArrTraits > &pgn2, OutputIterator oi)
| computes the intersection of two general polygons and inserts the resulting general polygons with holes into a container via an output iterator.
template<typename ArrTraits , typename OutputIterator >
OutputIterator | CGAL::intersection (const General_polygon_2< ArrTraits > &pgn1, const General_polygon_with_holes_2< General_polygon_2< ArrTraits > > &pgn2, OutputIterator oi)
| computes the intersection of two general polygons and inserts the resulting general polygons with holes into a container via an output iterator.
template<typename Polygon , typename OutputIterator >
OutputIterator | CGAL::intersection (const General_polygon_with_holes_2< Polygon > &pgn1, const General_polygon_with_holes_2< Polygon > &pgn2, OutputIterator oi)
| computes the intersection of two general polygons with holes and inserts the resulting general polygons with holes into a container via an output iterator.
template<typename InputIterator , typename OutputIterator >
OutputIterator | CGAL::intersection (InputIterator begin, InputIterator end, OutputIterator oi)
| Given a range of polygons (respectively general polygons) or a range of polygons with holes (respectively general polygons with holes) computes the intersection of all polygons in the range and inserts the resulting polygons with holes (respectively general polygons with holes) into a container via an output iterator.
template<typename InputIterator , typename OutputIterator , typename UsePolylines >
OutputIterator | CGAL::intersection (InputIterator begin, InputIterator end, OutputIterator oi, UsePolylines=Tag_true())
| Given a range of polygons (respectively general polygons) or a range of polygons with holes (respectively general polygons with holes) computes the intersection of all polygons in the range and inserts the resulting polygons with holes (respectively general polygons with holes) into a container via an output iterator.
template<typename InputIterator1 , typename InputIterator2 , typename OutputIterator >
OutputIterator | CGAL::intersection (InputIterator1 begin1, InputIterator1 end1, InputIterator2 begin2, InputIterator2 end2, OutputIterator oi)
| Given a range of polygons (respectively general polygons) and a range of polygons with holes (respectively general polygons with holes) computes the intersection of all polygons in the two ranges and inserts the resulting polygons with holes (respectively general polygons with holes) into a container via an output iterator.
template<typename InputIterator1 , typename InputIterator2 , typename OutputIterator , typename UsePolylines >
OutputIterator | CGAL::intersection (InputIterator1 begin1, InputIterator1 end1, InputIterator2 begin2, InputIterator2 end2, OutputIterator oi, UsePolylines=Tag_true())
| Given a range of polygons (respectively general polygons) and a range of polygons with holes (respectively general polygons with holes) computes the intersection of all polygons in the two ranges and inserts the resulting polygons with holes (respectively general polygons with holes) into a container via an output iterator.
template<typename Kernel , typename Container , typename OutputIterator , typename GpsTraits >
OutputIterator | CGAL::intersection (const Polygon_2< Kernel, Container > &pgn1, const Polygon_2< Kernel, Container > &pgn2, OutputIterator oi, const GpsTraits &traits)
| computes the intersection between two polygons and inserts the resulting polygons with holes into a container via an output iterator.
template<typename Kernel , typename Container , typename OutputIterator , typename GpsTraits >
OutputIterator | CGAL::intersection (const Polygon_2< Kernel, Container > &pgn1, const Polygon_with_holes_2< Kernel, Container > &pgn2, OutputIterator oi, const GpsTraits &traits)
| computes the intersection between two polygons and inserts the resulting polygons with holes into a container via an output iterator.
template<typename Kernel , typename Container , typename OutputIterator , typename GpsTraits >
OutputIterator | CGAL::intersection (const Polygon_with_holes_2< Kernel, Container > &pgn1, const Polygon_2< Kernel, Container > &pgn2, OutputIterator oi, const GpsTraits &traits)
| computes the intersection between two polygons and inserts the resulting polygons with holes into a container via an output iterator.
template<typename Kernel , typename Container , typename OutputIterator , typename GpsTraits >
OutputIterator | CGAL::intersection (const Polygon_with_holes_2< Kernel, Container > &pgn1, const Polygon_with_holes_2< Kernel, Container > &pgn2, OutputIterator oi, const GpsTraits &traits)
| computes the intersection between two polygons with holes and inserts the resulting polygons with holes into a container via an output iterator.
template<typename ArrTraits , typename OutputIterator , typename GpsTraits >
OutputIterator | CGAL::intersection (const General_polygon_2< ArrTraits > &pgn1, const General_polygon_2< ArrTraits > &pgn2, OutputIterator oi, const GpsTraits &traits)
| computes the intersection between two general polygons and inserts the resulting general polygons with holes into a container via an output iterator.
template<typename ArrTraits , typename OutputIterator , typename GpsTraits >
OutputIterator | CGAL::intersection (const General_polygon_with_holes_2< General_polygon_2< ArrTraits > > &pgn1, const General_polygon_2< ArrTraits > &pgn2, OutputIterator oi, const GpsTraits &traits)
| computes the intersection between two general polygons and inserts the resulting general polygons with holes into a container via an output iterator.
template<typename ArrTraits , typename OutputIterator , typename GpsTraits >
OutputIterator | CGAL::intersection (const General_polygon_2< ArrTraits > &pgn1, const General_polygon_with_holes_2< General_polygon_2< ArrTraits > > &pgn2, OutputIterator oi, const GpsTraits &traits)
| computes the intersection between two general polygons and inserts the resulting general polygons with holes into a container via an output iterator.
template<typename Polygon , typename OutputIterator , typename GpsTraits >
OutputIterator | CGAL::intersection (const General_polygon_with_holes_2< Polygon > &pgn1, const General_polygon_with_holes_2< Polygon > &pgn2, OutputIterator oi, const GpsTraits &traits)
| computes the intersection between two general polygons and inserts the resulting general polygons with holes into a container via an output iterator.
template<typename InputIterator , typename OutputIterator , typename GpsTraits >
OutputIterator | CGAL::intersection (InputIterator begin, InputIterator end, OutputIterator oi, const GpsTraits &traits)
| Given a range of polygons (respectively general polygons) or a range of polygons with holes (respectively general polygons with holes) computes the intersection of all polygons in the range and inserts the resulting polygons with holes (respectively general polygons with holes) into a container via an output iterator.
template<typename InputIterator1 , typename InputIterator2 , typename OutputIterator , typename GpsTraits >
OutputIterator | CGAL::intersection (InputIterator1 begin1, InputIterator1 end1, InputIterator2 begin2, InputIterator2 end2, OutputIterator oi, const GpsTraits &traits)
| Given a range of polygons (respectively general polygons) and a range of polygons with holes (respectively general polygons with holes) computes the intersection between all polygons in the two ranges and inserts the resulting polygons with holes (respectively general polygons with holes) into a container via an output iterator.

## Function Documentation

## ◆ intersection() [1/26]

template<typename ArrTraits , typename OutputIterator >

OutputIterator CGAL::intersection | ( | const General_polygon_2< ArrTraits > & | pgn1,
|  | const General_polygon_2< ArrTraits > & | pgn2,
|  | OutputIterator | oi
| ) |  |

`#include <CGAL/Boolean_set_operations_2.h>`

computes the intersection of two general polygons and inserts the resulting general polygons with holes into a container via an output iterator.

Parameters

  pgn1 | the 1st input polygon.
  pgn2 | the 2nd input polygon.
  oi | the output iterator for the result. Its dereference type must be convertible to `General_polygon_with_holes_2<General_polygon_2<ArrTraits>>`.

Returns
  the past-the-end iterator of the output container.

Precondition
  `ArrTraits` must be a model of the concept `AosDirectionalXMonotoneTraits_2`.

## ◆ intersection() [2/26]

template<typename ArrTraits , typename OutputIterator , typename GpsTraits >

OutputIterator CGAL::intersection | ( | const General_polygon_2< ArrTraits > & | pgn1,
|  | const General_polygon_2< ArrTraits > & | pgn2,
|  | OutputIterator | oi,
|  | const GpsTraits & | traits
| ) |  |

`#include <CGAL/Boolean_set_operations_2.h>`

computes the intersection between two general polygons and inserts the resulting general polygons with holes into a container via an output iterator.

Parameters

  pgn1 | the 1st input polygon.
  pgn2 | the 2nd input polygon.
  oi | the output iterator for the result. Its dereference type must be convertible to `General_polygon_with_holes_2<General_polygon_2<ArrTraits>>`.
  traits | a traits object.

Returns
  the past-the-end iterator of the output container.

Precondition
  `ArrTraits` must be a model of the concept `AosDirectionalXMonotoneTraits_2`.
  GpsTraits must be a model of `GeneralPolygonSetTraits_2`.

## ◆ intersection() [3/26]

template<typename ArrTraits , typename OutputIterator >

OutputIterator CGAL::intersection | ( | const General_polygon_2< ArrTraits > & | pgn1,
|  | const General_polygon_with_holes_2< General_polygon_2< ArrTraits > > & | pgn2,
|  | OutputIterator | oi
| ) |  |

`#include <CGAL/Boolean_set_operations_2.h>`

computes the intersection of two general polygons and inserts the resulting general polygons with holes into a container via an output iterator.

Parameters

  pgn1 | the 1st input polygon.
  pgn2 | the 2nd input polygon.
  oi | the output iterator for the result. Its dereference type must be convertible to `General_polygon_with_holes_2<General_polygon_2<ArrTraits>>`.

Returns
  the past-the-end iterator of the output container.

Precondition
  `ArrTraits` must be a model of the concept `AosDirectionalXMonotoneTraits_2`.

## ◆ intersection() [4/26]

template<typename ArrTraits , typename OutputIterator , typename GpsTraits >

OutputIterator CGAL::intersection | ( | const General_polygon_2< ArrTraits > & | pgn1,
|  | const General_polygon_with_holes_2< General_polygon_2< ArrTraits > > & | pgn2,
|  | OutputIterator | oi,
|  | const GpsTraits & | traits
| ) |  |

`#include <CGAL/Boolean_set_operations_2.h>`

computes the intersection between two general polygons and inserts the resulting general polygons with holes into a container via an output iterator.

Parameters

  pgn1 | the 1st input polygon.
  pgn2 | the 2nd input polygon.
  oi | the output iterator for the result. Its dereference type must be convertible to `General_polygon_with_holes_2<General_polygon_2<ArrTraits>>`.
  traits | a traits object.

Returns
  the past-the-end iterator of the output container.

Precondition
  `ArrTraits` must be a model of the concept `AosDirectionalXMonotoneTraits_2`.
  GpsTraits must be a model of `GeneralPolygonSetTraits_2`.

## ◆ intersection() [5/26]

template<typename ArrTraits , typename OutputIterator >

OutputIterator CGAL::intersection | ( | const General_polygon_with_holes_2< General_polygon_2< ArrTraits > > & | pgn1,
|  | const General_polygon_2< ArrTraits > & | pgn2,
|  | OutputIterator | oi
| ) |  |

`#include <CGAL/Boolean_set_operations_2.h>`

computes the intersection of two general polygons and inserts the resulting general polygons with holes into a container via an output iterator.

Parameters

  pgn1 | the 1st input polygon.
  pgn2 | the 2nd input polygon.
  oi | the output iterator for the result. Its dereference type must be convertible to `General_polygon_with_holes_2<General_polygon_2<ArrTraits>>`.

Returns
  the past-the-end iterator of the output container.

Precondition
  `ArrTraits` must be a model of the concept `AosDirectionalXMonotoneTraits_2`.

## ◆ intersection() [6/26]

template<typename ArrTraits , typename OutputIterator , typename GpsTraits >

OutputIterator CGAL::intersection | ( | const General_polygon_with_holes_2< General_polygon_2< ArrTraits > > & | pgn1,
|  | const General_polygon_2< ArrTraits > & | pgn2,
|  | OutputIterator | oi,
|  | const GpsTraits & | traits
| ) |  |

`#include <CGAL/Boolean_set_operations_2.h>`

computes the intersection between two general polygons and inserts the resulting general polygons with holes into a container via an output iterator.

Parameters

  pgn1 | the 1st input polygon.
  pgn2 | the 2nd input polygon.
  oi | the output iterator for the result. Its dereference type must be convertible to `General_polygon_with_holes_2<General_polygon_2<ArrTraits>>`.
  traits | a traits object.

Returns
  the past-the-end iterator of the output container.

Precondition
  `ArrTraits` must be a model of the concept `AosDirectionalXMonotoneTraits_2`.
  GpsTraits must be a model of `GeneralPolygonSetTraits_2`.

## ◆ intersection() [7/26]

template<typename Polygon , typename OutputIterator >

OutputIterator CGAL::intersection | ( | const General_polygon_with_holes_2< Polygon > & | pgn1,
|  | const General_polygon_with_holes_2< Polygon > & | pgn2,
|  | OutputIterator | oi
| ) |  |

`#include <CGAL/Boolean_set_operations_2.h>`

computes the intersection of two general polygons with holes and inserts the resulting general polygons with holes into a container via an output iterator.

Parameters

  pgn1 | the 1st input polygon.
  pgn2 | the 2nd input polygon.
  oi | the output iterator for the result. Its dereference type must be convertible to `General_polygon_with_holes_2<Polygon>`.

Returns
  the past-the-end iterator of the output container.

## ◆ intersection() [8/26]

template<typename Polygon , typename OutputIterator , typename GpsTraits >

OutputIterator CGAL::intersection | ( | const General_polygon_with_holes_2< Polygon > & | pgn1,
|  | const General_polygon_with_holes_2< Polygon > & | pgn2,
|  | OutputIterator | oi,
|  | const GpsTraits & | traits
| ) |  |

`#include <CGAL/Boolean_set_operations_2.h>`

computes the intersection between two general polygons and inserts the resulting general polygons with holes into a container via an output iterator.

Parameters

  pgn1 | the 1st input polygon.
  pgn2 | the 2nd input polygon.
  oi | the output iterator for the result. Its dereference type must be convertible to `General_polygon_with_holes_2<Polygon>`.
  traits | a traits object.

Returns
  the past-the-end iterator of the output container.

Precondition
  GpsTraits must be a model of `GeneralPolygonSetTraits_2`.

## ◆ intersection() [9/26]

template<typename Kernel , typename Container , typename OutputIterator >

OutputIterator CGAL::intersection | ( | const Polygon_2< Kernel, Container > & | pgn1,
|  | const Polygon_2< Kernel, Container > & | pgn2,
|  | OutputIterator | oi
| ) |  |

`#include <CGAL/Boolean_set_operations_2.h>`

computes the intersection of two polygons and inserts the resulting polygons with holes into a container via an output iterator.

Parameters

  pgn1 | the 1st input polygon.
  pgn2 | the 2nd input polygon.
  oi | the output iterator for the result. Its dereference type must be convertible to `Polygon_with_holes_2<Kernel, Container>`.

Returns
  the past-the-end iterator of the output container.

## ◆ intersection() [10/26]

template<typename Kernel , typename Container , typename OutputIterator , typename GpsTraits >

OutputIterator CGAL::intersection | ( | const Polygon_2< Kernel, Container > & | pgn1,
|  | const Polygon_2< Kernel, Container > & | pgn2,
|  | OutputIterator | oi,
|  | const GpsTraits & | traits
| ) |  |

`#include <CGAL/Boolean_set_operations_2.h>`

computes the intersection between two polygons and inserts the resulting polygons with holes into a container via an output iterator.

Parameters

  pgn1 | the 1st input polygon.
  pgn2 | the 2nd input polygon.
  oi | the output iterator for the result. Its dereference type must be convertible to `Polygon_with_holes_2<Kernel, Container>`.
  traits | a traits object.

Returns
  the past-the-end iterator of the output container.

Precondition
  GpsTraits must be a model of `GeneralPolygonSetTraits_2`.

## ◆ intersection() [11/26]

template<typename Kernel , typename Container , typename OutputIterator , typename UsePolylines >

OutputIterator CGAL::intersection | ( | const Polygon_2< Kernel, Container > & | pgn1,
|  | const Polygon_2< Kernel, Container > & | pgn2,
|  | OutputIterator | oi,
|  | UsePolylines | = `Tag_true()`
| ) |  |

`#include <CGAL/Boolean_set_operations_2.h>`

computes the intersection of two polygons and inserts the resulting polygons with holes into a container via an output iterator.

Template Parameters

  UsePolylines | determines whether the boundary of `pgn` is treated as a cyclic sequence of single ( \(x\)-monotone) segments or as a cyclic sequence of ( \(x\)-monotone) polylines. If substituted with `CGAL::Tag_true`, which is the default, `pgn` is converted to a general polygon bounded by polylines before the operation is actually performed. Then, the resulting general polygon with holes is converted back to a standard polygon. If substituted with `CGAL::Tag_false`, `pgn` is used as is. Refer to Traits Selection for more information.

Parameters

  pgn1 | the 1st input polygon.
  pgn2 | the 2nd input polygon.
  oi | the output iterator for the result. Its dereference type must be convertible to `Polygon_with_holes_2<Kernel, Container>`.

Returns
  the past-the-end iterator of the output container.

## ◆ intersection() [12/26]

template<typename Kernel , typename Container , typename OutputIterator >

OutputIterator CGAL::intersection | ( | const Polygon_2< Kernel, Container > & | pgn1,
|  | const Polygon_with_holes_2< Kernel, Container > & | pgn2,
|  | OutputIterator | oi
| ) |  |

`#include <CGAL/Boolean_set_operations_2.h>`

computes the intersection of two polygons and inserts the resulting polygons with holes into a container via an output iterator.

Parameters

  pgn1 | the 1st input polygon.
  pgn2 | the 2nd input polygon.
  oi | the output iterator for the result. Its dereference type must be convertible to `Polygon_with_holes_2<Kernel, Container>`.

Returns
  the past-the-end iterator of the output container.

## ◆ intersection() [13/26]

template<typename Kernel , typename Container , typename OutputIterator , typename GpsTraits >

OutputIterator CGAL::intersection | ( | const Polygon_2< Kernel, Container > & | pgn1,
|  | const Polygon_with_holes_2< Kernel, Container > & | pgn2,
|  | OutputIterator | oi,
|  | const GpsTraits & | traits
| ) |  |

`#include <CGAL/Boolean_set_operations_2.h>`

computes the intersection between two polygons and inserts the resulting polygons with holes into a container via an output iterator.

Parameters

  pgn1 | the 1st input polygon.
  pgn2 | the 2nd input polygon.
  oi | the output iterator for the result. Its dereference type must be convertible to `Polygon_with_holes_2<Kernel, Container>`.
  traits | a traits object.

Returns
  the past-the-end iterator of the output container.

Precondition
  GpsTraits must be a model of `GeneralPolygonSetTraits_2`.

## ◆ intersection() [14/26]

template<typename Kernel , typename Container , typename OutputIterator , typename UsePolylines >

OutputIterator CGAL::intersection | ( | const Polygon_2< Kernel, Container > & | pgn1,
|  | const Polygon_with_holes_2< Kernel, Container > & | pgn2,
|  | OutputIterator | oi,
|  | UsePolylines | = `Tag_true()`
| ) |  |

`#include <CGAL/Boolean_set_operations_2.h>`

computes the intersection of two polygons and inserts the resulting polygons with holes into a container via an output iterator.

Template Parameters

  UsePolylines | determines whether the boundaries of `pgn` is treated as cyclic sequences of single ( \(x\)-monotone) segments or as cyclic sequences of ( \(x\)-monotone) polylines. If substituted with `CGAL::Tag_true`, which is the default, `pgn` is converted to a general polygon with holes bounded by polylines before the operation is actually performed. Then, the resulting general polygons with holes are converted back to a standard polygon with holes. If substituted with `CGAL::Tag_false`, `pgn` is used as is. Refer to Traits Selection for more information.

Parameters

  pgn1 | the 1st input polygon.
  pgn2 | the 2nd input polygon.
  oi | the output iterator for the result. Its dereference type must be convertible to `Polygon_with_holes_2<Kernel, Container>`.

Returns
  the past-the-end iterator of the output container.

## ◆ intersection() [15/26]

template<typename Kernel , typename Container , typename OutputIterator >

OutputIterator CGAL::intersection | ( | const Polygon_with_holes_2< Kernel, Container > & | pgn1,
|  | const Polygon_2< Kernel, Container > & | pgn2,
|  | OutputIterator | oi
| ) |  |

`#include <CGAL/Boolean_set_operations_2.h>`

computes the intersection of two polygons and inserts the resulting polygons with holes into a container via an output iterator.

Parameters

  pgn1 | the 1st input polygon.
  pgn2 | the 2nd input polygon.
  oi | the output iterator for the result. Its dereference type must be convertible to `Polygon_with_holes_2<Kernel, Container>`.

Returns
  the past-the-end iterator of the output container.

## ◆ intersection() [16/26]

template<typename Kernel , typename Container , typename OutputIterator , typename GpsTraits >

OutputIterator CGAL::intersection | ( | const Polygon_with_holes_2< Kernel, Container > & | pgn1,
|  | const Polygon_2< Kernel, Container > & | pgn2,
|  | OutputIterator | oi,
|  | const GpsTraits & | traits
| ) |  |

`#include <CGAL/Boolean_set_operations_2.h>`

computes the intersection between two polygons and inserts the resulting polygons with holes into a container via an output iterator.

Parameters

  pgn1 | the 1st input polygon.
  pgn2 | the 2nd input polygon.
  oi | the output iterator for the result. Its dereference type must be convertible to `Polygon_with_holes_2<Kernel, Container>`.
  traits | a traits object.

Returns
  the past-the-end iterator of the output container.

Precondition
  GpsTraits must be a model of `GeneralPolygonSetTraits_2`.

## ◆ intersection() [17/26]

template<ctypename Kernel, ctypename Container, ctypename OutputIterator, typename UsePolylines >

OutputIterator CGAL::intersection | ( | const Polygon_with_holes_2< Kernel, Container > & | pgn1,
|  | const Polygon_2< Kernel, Container > & | pgn2,
|  | OutputIterator | oi,
|  | UsePolylines | = `Tag_true()`
| ) |  |

`#include <CGAL/Boolean_set_operations_2.h>`

computes the intersection of two polygons and inserts the resulting polygons with holes into a container via an output iterator.

Template Parameters

  UsePolylines | determines whether the boundaries of `pgn1` and `pgn2` are treated as cyclic sequences of single ( \(x\)-monotone) segments or as a cyclic sequences of ( \(x\)-monotone) polylines. If substituted with `CGAL::Tag_true`, which is the default, `pgn1` and `pgn2` are converted to a general polygons bounded by polylines before the operation is actually performed. Then, the resulting general polygons with holes are converted back to standard polygons with holes. If substituted with `CGAL::Tag_false`, `pgn1` and `pgn2` are used as is. Refer to Traits Selection for more information.

Parameters

  pgn1 | the 1st input polygon.
  pgn2 | the 2nd input polygon.
  oi | the output iterator for the result. Its dereference type must be convertible to `Polygon_with_holes_2<Kernel, Container>`.

Returns
  the past-the-end iterator of the output container.

## ◆ intersection() [18/26]

template<typename Kernel , typename Container , typename OutputIterator >

OutputIterator CGAL::intersection | ( | const Polygon_with_holes_2< Kernel, Container > & | pgn1,
|  | const Polygon_with_holes_2< Kernel, Container > & | pgn2,
|  | OutputIterator | oi
| ) |  |

`#include <CGAL/Boolean_set_operations_2.h>`

computes the intersection of two polygons and inserts the resulting polygons with holes into a container via an output iterator.

Parameters

  pgn1 | the 1st input polygon.
  pgn2 | the 2nd input polygon.
  oi | the output iterator for the result. Its dereference type must be convertible to `Polygon_with_holes_2<Kernel, Container>`.

Returns
  the past-the-end iterator of the output container.

## ◆ intersection() [19/26]

template<typename Kernel , typename Container , typename OutputIterator , typename GpsTraits >

OutputIterator CGAL::intersection | ( | const Polygon_with_holes_2< Kernel, Container > & | pgn1,
|  | const Polygon_with_holes_2< Kernel, Container > & | pgn2,
|  | OutputIterator | oi,
|  | const GpsTraits & | traits
| ) |  |

`#include <CGAL/Boolean_set_operations_2.h>`

computes the intersection between two polygons with holes and inserts the resulting polygons with holes into a container via an output iterator.

Parameters

  pgn1 | the 1st input polygon.
  pgn2 | the 2nd input polygon.
  oi | the output iterator for the result. Its dereference type must be convertible to `Polygon_with_holes_2<Kernel, Container>`.
  traits | a traits object.

Returns
  the past-the-end iterator of the output container.

Precondition
  GpsTraits must be a model of `GeneralPolygonSetTraits_2`.

## ◆ intersection() [20/26]

template<typename Kernel , typename Container , typename OutputIterator , typename UsePolylines >

OutputIterator CGAL::intersection | ( | const Polygon_with_holes_2< Kernel, Container > & | pgn1,
|  | const Polygon_with_holes_2< Kernel, Container > & | pgn2,
|  | OutputIterator | oi,
|  | UsePolylines | = `Tag_true()`
| ) |  |

`#include <CGAL/Boolean_set_operations_2.h>`

computes the intersection of two polygons and inserts the resulting polygons with holes into a container via an output iterator.

Template Parameters

  UsePolylines | determines whether the boundaries of `pgn1` and `pgn2` are treated as cyclic sequences of single ( \(x\)-monotone) segments or as a cyclic sequences of ( \(x\)-monotone) polylines. If substituted with `CGAL::Tag_true`, which is the default, `pgn1` and `pgn2` are converted to a general polygon and a general polygon with holes, respectively, bounded by polylines before the operation is actually performed. Then, the resulting general polygons with holes are converted back to standard polygons with holes. If substituted with `CGAL::Tag_false`, `pgn1` and `pgn2` are used as is. Refer to Traits Selection for more information.

Parameters

  pgn1 | the 1st input polygon.
  pgn2 | the 2nd input polygon.
  oi | the output iterator for the result. Its dereference type must be convertible to `Polygon_with_holes_2<Kernel, Container>`.

Returns
  the past-the-end iterator of the output container.

## ◆ intersection() [21/26]

template<typename InputIterator , typename OutputIterator >

OutputIterator CGAL::intersection | ( | InputIterator | begin,
|  | InputIterator | end,
|  | OutputIterator | oi
| ) |  |

`#include <CGAL/Boolean_set_operations_2.h>`

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

Parameters

  begin | the first iterator of the input range. Its value type is either `Polygon_2` (respectively `General_polygon_2`) or `Polygon_with_holes_2` (respectively `General_polygon_with_holes_2`).
  end | the past-the-end iterator of the input range. Its value type is either `Polygon_2` (respectively `General_polygon_2`) or `Polygon_with_holes_2` (respectively `General_polygon_with_holes_2`).
  oi | the output iterator for the result. Its dereference type must be convertible to `Polygon_with_holes_2` (respectively `General_polygon_with_holes_2`).

Returns
  the past-the-end iterator of the output container.

## ◆ intersection() [22/26]

template<typename InputIterator , typename OutputIterator , typename GpsTraits >

OutputIterator CGAL::intersection | ( | InputIterator | begin,
|  | InputIterator | end,
|  | OutputIterator | oi,
|  | const GpsTraits & | traits
| ) |  |

`#include <CGAL/Boolean_set_operations_2.h>`

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

Parameters

  begin | the first iterator of the input range. Its value type is either `Polygon_2` (respectively `General_polygon_2`) or `Polygon_with_holes_2` (respectively `General_polygon_with_holes_2`).
  end | the past-the-end iterator of the input range. Its value type is either `Polygon_2` (respectively `General_polygon_2`) or `Polygon_with_holes_2` (respectively `General_polygon_with_holes_2`).
  oi | the output iterator for the result. Its dereference type must be convertible to `Polygon_with_holes_2` (respectively `General_polygon_with_holes_2`).
  traits | a traits object.

Returns
  the past-the-end iterator of the output container.

Precondition
  GpsTraits must be a model of `GeneralPolygonSetTraits_2`.

## ◆ intersection() [23/26]

template<typename InputIterator , typename OutputIterator , typename UsePolylines >

OutputIterator CGAL::intersection | ( | InputIterator | begin,
|  | InputIterator | end,
|  | OutputIterator | oi,
|  | UsePolylines | = `Tag_true()`
| ) |  |

`#include <CGAL/Boolean_set_operations_2.h>`

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

Template Parameters

  UsePolylines | determines whether the boundaries of the polygons in the input range are treated as cyclic sequences of single ( \(x\)-monotone) segments or as a cyclic sequences of ( \(x\)-monotone) polylines. If substituted with `CGAL::Tag_true`, which is the default, the input polygons are converted to general polygon with holes , bounded by polylines before the operation is actually performed. Then, the resulting general polygons with holes are converted back to standard polygons with holes. If substituted with `CGAL::Tag_false`, `pgn1` and `pgn2` are used as is. Refer to Traits Selection for more information.

Parameters

  begin | the first iterator of the input range. Its value type is either `Polygon_2` (respectively `General_polygon_2`) or `Polygon_with_holes_2` (respectively `General_polygon_with_holes_2`).
  end | the past-the-end iterator of the input range. Its value type is either `Polygon_2` (respectively `General_polygon_2`) or `Polygon_with_holes_2` (respectively `General_polygon_with_holes_2`).
  oi | the output iterator for the result. Its dereference type must be convertible to `Polygon_with_holes_2` (respectively `General_polygon_with_holes_2`).

Returns
  the past-the-end iterator of the output container.

## ◆ intersection() [24/26]

template<typename InputIterator1 , typename InputIterator2 , typename OutputIterator >

OutputIterator CGAL::intersection | ( | InputIterator1 | begin1,
|  | InputIterator1 | end1,
|  | InputIterator2 | begin2,
|  | InputIterator2 | end2,
|  | OutputIterator | oi
| ) |  |

`#include <CGAL/Boolean_set_operations_2.h>`

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

Parameters

  begin1 | the first iterator of the 1st input range. Its value type is `Polygon_2` (respectively `General_polygon_2`).
  end1 | the past-the-end iterator of the 1st input range. Its value type is `Polygon_2` (respectively `General_polygon_2`).
  begin2 | the first iterator of the 2nd input range. Its value type is `Polygon_with_holes_2` (respectively `General_polygon_with_holes_2`).
  end2 | the past-the-end iterator of the 2nd input range. Its value type is `Polygon_with_holes_2` (respectively `General_polygon_with_holes_2`).
  oi | the output iterator for the result. Its dereference type must be convertible to `Polygon_with_holes_2` (respectively `General_polygon_with_holes_2`).

Returns
  the past-the-end iterator of the output container.

## ◆ intersection() [25/26]

template<typename InputIterator1 , typename InputIterator2 , typename OutputIterator , typename GpsTraits >

OutputIterator CGAL::intersection | ( | 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 (respectively general polygons) and a range of polygons with holes (respectively general polygons with holes) computes the intersection between all polygons in the two ranges and inserts the resulting polygons with holes (respectively general polygons with holes) into a container via an output iterator.

Parameters

  begin1 | the first iterator of the 1st input range. Its value type is `Polygon_2` (respectively `General_polygon_2`).
  end1 | the past-the-end iterator of the 1st input range. Its value type is `Polygon_2` (respectively `General_polygon_2`).
  begin2 | the first iterator of the 2nd input range. Its value type is `Polygon_with_holes_2` (respectively `General_polygon_with_holes_2`).
  end2 | the past-the-end iterator of the 2nd input range. Its value type is `Polygon_with_holes_2` (respectively `General_polygon_with_holes_2`).
  oi | the output iterator for the result. Its dereference type must be convertible to `Polygon_with_holes_2` (respectively `General_polygon_with_holes_2`).
  traits | a traits object.

Returns
  the past-the-end iterator of the output container.

Precondition
  GpsTraits must be a model of `GeneralPolygonSetTraits_2`.

## ◆ intersection() [26/26]

template<typename InputIterator1 , typename InputIterator2 , typename OutputIterator , typename UsePolylines >

OutputIterator CGAL::intersection | ( | InputIterator1 | begin1,
|  | InputIterator1 | end1,
|  | InputIterator2 | begin2,
|  | InputIterator2 | end2,
|  | OutputIterator | oi,
|  | UsePolylines | = `Tag_true()`
| ) |  |

`#include <CGAL/Boolean_set_operations_2.h>`

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

Template Parameters

  UsePolylines | determines whether the boundaries of the polygons in the input ranges are treated as cyclic sequences of single ( \(x\)-monotone) segments or as a cyclic sequences of ( \(x\)-monotone) polylines. If substituted with `CGAL::Tag_true`, which is the default, the input polygons are converted to general polygon with holes , bounded by polylines before the operation is actually performed. Then, the resulting general polygons with holes are converted back to standard polygons with holes. If substituted with `CGAL::Tag_false`, `pgn1` and `pgn2` are used as is. Refer to Traits Selection for more information.

Parameters

  begin1 | the first iterator of the 1st input range. Its value type is `Polygon_2` (respectively `General_polygon_2`).
  end1 | the past-the-end iterator of the 1st input range. Its value type is `Polygon_2` (respectively `General_polygon_2`).
  begin2 | the first iterator of the 2nd input range. Its value type is `Polygon_with_holes_2` (respectively `General_polygon_with_holes_2`).
  end2 | the past-the-end iterator of the 2nd input range. Its value type is `Polygon_with_holes_2` (respectively `General_polygon_with_holes_2`).
  oi | the output iterator for the result. Its dereference type must be convertible to `Polygon_with_holes_2` (respectively `General_polygon_with_holes_2`).

Returns
  the past-the-end iterator of the output container.