|
Aleph-w 7.10.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 6945 of file geom_algorithms.H.
|
inlinestaticprivate |
Definition at line 6991 of file geom_algorithms.H.
References Aleph::Point::get_x(), and Aleph::Point::get_y().
Referenced by operator()().
|
inlinestaticprivate |
Definition at line 6985 of file geom_algorithms.H.
References Aleph::Array< T >::size().
Referenced by operator()().
|
inlinestaticprivate |
Definition at line 6948 of file geom_algorithms.H.
References Aleph::GeomPolygonUtils::extract_vertices().
Referenced by operator()().
|
inlinestaticprivate |
Definition at line 6958 of file geom_algorithms.H.
References Aleph::GeomPolygonUtils::is_convex(), and Aleph::Array< T >::size().
Referenced by operator()().
Ensure CCW and rotate so that the bottom-most vertex is first.
Definition at line 6966 of file geom_algorithms.H.
References Aleph::and, Aleph::Array< T >::append(), 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 7007 of file geom_algorithms.H.
References Aleph::Polygon::add_vertex(), ah_domain_error_if, Aleph::and, Aleph::Array< T >::append(), Aleph::Polygon::close(), cross(), edge_vec(), Aleph::eq(), extract_vertices(), Aleph::Array< T >::get_last(), Aleph::Polygon::is_closed(), is_convex(), Aleph::Array< T >::is_empty(), normalize(), Aleph::Array< T >::remove_last(), Aleph::Array< T >::reserve(), Aleph::Polygon::size(), and Aleph::Array< T >::size().
|
inlinestaticprivate |
Definition at line 6953 of file geom_algorithms.H.
References Aleph::GeomPolygonUtils::signed_double_area().