|
Aleph-w 3.0
A C++ Library for Data Structures and Algorithms
|
Exact Minkowski sum of two closed convex polygons. More...
#include <geom_algorithms.H>
Public Member Functions | |
| Polygon | operator() (const Polygon &P, const Polygon &Q) const |
| Compute the Minkowski sum of two convex polygons. | |
Static Private Member Functions | |
| static Array< Point > | extract_vertices (const Polygon &poly) |
| static Geom_Number | signed_double_area (const Array< Point > &v) |
| static bool | is_convex (const Array< Point > &verts) |
| static Array< Point > | normalize (Array< Point > v) |
| Ensure CCW and rotate so that the bottom-most vertex is first. | |
| static Point | edge_vec (const Array< Point > &v, const size_t i) |
| static Geom_Number | cross (const Point &a, const Point &b) |
Exact Minkowski sum of two closed convex polygons.
The Minkowski sum P ⊕ Q of two convex polygons P and Q is a convex polygon whose vertices are sums of vertex pairs from P and Q. The algorithm merges the edge vectors of both polygons sorted by polar angle in O(n + m).
Definition at line 7391 of file geom_algorithms.H.
|
inlinestaticprivate |
Definition at line 7437 of file geom_algorithms.H.
References Aleph::Point::get_x(), and Aleph::Point::get_y().
Referenced by operator()().
|
inlinestaticprivate |
Definition at line 7431 of file geom_algorithms.H.
References Aleph::Array< T >::size().
Referenced by operator()().
|
inlinestaticprivate |
Definition at line 7394 of file geom_algorithms.H.
References Aleph::GeomPolygonUtils::extract_vertices().
Referenced by operator()().
|
inlinestaticprivate |
Definition at line 7404 of file geom_algorithms.H.
References Aleph::divide_and_conquer_partition_dp(), and Aleph::GeomPolygonUtils::is_convex().
Referenced by operator()().
Ensure CCW and rotate so that the bottom-most vertex is first.
Definition at line 7412 of file geom_algorithms.H.
References Aleph::and, Aleph::Array< T >::append(), Aleph::divide_and_conquer_partition_dp(), Aleph::GeomPolygonUtils::ensure_ccw(), Aleph::Array< T >::reserve(), and Aleph::Array< T >::size().
Referenced by operator()().
Compute the Minkowski sum of two convex polygons.
| P | First convex polygon. |
| Q | Second convex polygon. |
| domain_error | if either polygon is not closed, has < 3 vertices, or is not convex. |
Definition at line 7453 of file geom_algorithms.H.
References Aleph::Polygon::add_vertex(), ah_domain_error_if, Aleph::and, Aleph::Array< T >::append(), cross(), Aleph::divide_and_conquer_partition_dp(), edge_vec(), Aleph::eq(), extract_vertices(), is_convex(), normalize(), Aleph::Array< T >::reserve(), and Aleph::Array< T >::size().
|
inlinestaticprivate |
Definition at line 7399 of file geom_algorithms.H.
References Aleph::GeomPolygonUtils::signed_double_area().