\( \newcommand{\E}{\mathrm{E}} \) \( \newcommand{\A}{\mathrm{A}} \) \( \newcommand{\R}{\mathrm{R}} \) \( \newcommand{\N}{\mathrm{N}} \) \( \newcommand{\Q}{\mathrm{Q}} \) \( \newcommand{\Z}{\mathrm{Z}} \) \( \def\ccSum #1#2#3{ \sum_{#1}^{#2}{#3} } \def\ccProd #1#2#3{ \sum_{#1}^{#2}{#3} }\)
CGAL 4.14 - 2D Regularized Boolean Set-Operations

Each one of these functions computes the difference between two given polygons p1 and p2, and inserts the resulting polygons with holes into an output container through the output iterator oi. The value type of the OutputIterator is either Polygon_with_holes_2 or General_polygon_with_holes_2.

The signature of the function is

OutputIterator difference(const Type1 & p1, const Type2 & p2, OutputIterator oi);

Parameters

The types of the paramters of the difference() function are any of the following combinations.

Type1Type2
Polygon_2Polygon_2
Polygon_2Polygon_with_holes_2
Polygon_with_holes_2Polygon_2
Polygon_with_holes_2Polygon_with_holes_2
General_polygon_2General_polygon_2
General_polygon_2General_polygon_with_holes_2
General_polygon_with_holes_2General_polygon_2
General_polygon_with_holes_2General_polygon_with_holes_2
See also
CGAL::do_intersect()
CGAL::intersection()
CGAL::join()
CGAL::symmetric_difference()

Functions

template<class Kernel , class Container , class OutputIterator >
OutputIterator CGAL::difference (const Polygon_2< Kernel, Container > &p1, const Polygon_2< Kernel, Container > &p2, OutputIterator oi)
 writes the difference of the polygons p1 and p2 into the output iterator oi. More...
 
template<class Kernel , class Container , class OutputIterator >
OutputIterator CGAL::difference (const Polygon_2< Kernel, Container > &p1, const Polygon_with_holes_2< Kernel, Container > &p2, OutputIterator oi)
 writes the difference of the polygons p1 and p2 into the output iterator oi. More...
 
template<class Kernel , class Container , class OutputIterator >
OutputIterator CGAL::difference (const Polygon_with_holes_2< Kernel, Container > &p1, const Polygon_2< Kernel, Container > &p2, OutputIterator oi)
 writes the difference of the polygons p1 and p2 into the output iterator oi. More...
 
template<class Kernel , class Container , class OutputIterator >
OutputIterator CGAL::difference (const Polygon_with_holes_2< Kernel, Container > &p1, const Polygon_with_holes_2< Kernel, Container > &p2, OutputIterator oi)
 writes the difference of the polygons p1 and p2 into the output iterator oi. More...
 
template<class Traits , class OutputIterator >
OutputIterator CGAL::difference (const General_polygon_2< Traits > &p1, const General_polygon_2< Traits > &p2, OutputIterator oi)
 writes the difference of the general polygons p1 and p2 into the output iterator oi. More...
 
template<class Traits , class OutputIterator >
OutputIterator CGAL::difference (const General_polygon_with_holes_2< General_polygon_2< Traits > > &p1, const General_polygon_2< Traits > &p2, OutputIterator oi)
 writes the difference of the general polygons p1 and p2 into the output iterator oi. More...
 
template<class Traits , class OutputIterator >
OutputIterator CGAL::difference (const General_polygon_2< Traits > &p1, const General_polygon_with_holes_2< General_polygon_2< Traits > > &p2, OutputIterator oi)
 writes the difference of the general polygons p1 and p2 into the output iterator oi. More...
 
template<class Polygon , class OutputIterator >
OutputIterator CGAL::difference (const General_polygon_with_holes_2< Polygon > &p1, const General_polygon_with_holes_2< Polygon > &p2, OutputIterator oi)
 writes the difference of the general polygons p1 and p2 into the output iterator oi. More...
 

Function Documentation

◆ difference() [1/8]

template<class Kernel , class Container , class OutputIterator >
OutputIterator CGAL::difference ( const Polygon_2< Kernel, Container > &  p1,
const Polygon_2< Kernel, Container > &  p2,
OutputIterator  oi 
)

#include <CGAL/Boolean_set_operations_2.h>

writes the difference of the polygons p1 and p2 into the output iterator oi.

The value type of oi is Polygon_with_holes_2.

◆ difference() [2/8]

template<class Kernel , class Container , class OutputIterator >
OutputIterator CGAL::difference ( const Polygon_2< Kernel, Container > &  p1,
const Polygon_with_holes_2< Kernel, Container > &  p2,
OutputIterator  oi 
)

#include <CGAL/Boolean_set_operations_2.h>

writes the difference of the polygons p1 and p2 into the output iterator oi.

The value type of oi is Polygon_with_holes_2.

◆ difference() [3/8]

template<class Kernel , class Container , class OutputIterator >
OutputIterator CGAL::difference ( const Polygon_with_holes_2< Kernel, Container > &  p1,
const Polygon_2< Kernel, Container > &  p2,
OutputIterator  oi 
)

#include <CGAL/Boolean_set_operations_2.h>

writes the difference of the polygons p1 and p2 into the output iterator oi.

The value type of oi is Polygon_with_holes_2.

◆ difference() [4/8]

template<class Kernel , class Container , class OutputIterator >
OutputIterator CGAL::difference ( const Polygon_with_holes_2< Kernel, Container > &  p1,
const Polygon_with_holes_2< Kernel, Container > &  p2,
OutputIterator  oi 
)

#include <CGAL/Boolean_set_operations_2.h>

writes the difference of the polygons p1 and p2 into the output iterator oi.

The value type of oi is Polygon_with_holes_2.

◆ difference() [5/8]

template<class Traits , class OutputIterator >
OutputIterator CGAL::difference ( const General_polygon_2< Traits > &  p1,
const General_polygon_2< Traits > &  p2,
OutputIterator  oi 
)

#include <CGAL/Boolean_set_operations_2.h>

writes the difference of the general polygons p1 and p2 into the output iterator oi.

The value type of oi is General_polygon_with_holes_2.

◆ difference() [6/8]

template<class Traits , class OutputIterator >
OutputIterator CGAL::difference ( const General_polygon_with_holes_2< General_polygon_2< Traits > > &  p1,
const General_polygon_2< Traits > &  p2,
OutputIterator  oi 
)

#include <CGAL/Boolean_set_operations_2.h>

writes the difference of the general polygons p1 and p2 into the output iterator oi.

The value type of oi is General_polygon_with_holes_2.

◆ difference() [7/8]

template<class Traits , class OutputIterator >
OutputIterator CGAL::difference ( const General_polygon_2< Traits > &  p1,
const General_polygon_with_holes_2< General_polygon_2< Traits > > &  p2,
OutputIterator  oi 
)

#include <CGAL/Boolean_set_operations_2.h>

writes the difference of the general polygons p1 and p2 into the output iterator oi.

The value type of oi is General_polygon_with_holes_2.

◆ difference() [8/8]

template<class Polygon , class OutputIterator >
OutputIterator CGAL::difference ( const General_polygon_with_holes_2< Polygon > &  p1,
const General_polygon_with_holes_2< Polygon > &  p2,
OutputIterator  oi 
)

#include <CGAL/Boolean_set_operations_2.h>

writes the difference of the general polygons p1 and p2 into the output iterator oi.

The value type of oi is General_polygon_with_holes_2.