|
Aleph-w 3.0
A C++ Library for Data Structures and Algorithms
|
Decompose a simple polygon into convex parts using Hertel-Mehlhorn. More...
#include <geom_algorithms.H>
Public Member Functions | |
| Array< Polygon > | operator() (const Polygon &poly) const |
Decompose polygon poly into convex parts. | |
Static Private Member Functions | |
| static size_t | find_pos (const Array< size_t > &face, size_t v) |
| static bool | is_polygon_edge (size_t u, size_t v, size_t n) |
| static bool | can_merge (const Array< Point > &pts, const Array< size_t > &f1, const Array< size_t > &f2, size_t u, size_t v) |
| Check whether merging faces f1 and f2 across diagonal (u,v) is convex. | |
| static Array< size_t > | merge_faces (const Array< size_t > &f1, const Array< size_t > &f2, size_t u, size_t v) |
| Merge f1 and f2 by removing their shared edge (u,v). | |
| static Array< Point > | extract_vertices (const Polygon &p) |
Static Private Attributes | |
| static constexpr size_t | NONE = ~static_cast<size_t>(0) |
Decompose a simple polygon into convex parts using Hertel-Mehlhorn.
The algorithm triangulates the polygon, then greedily removes internal diagonals whose removal keeps the merged region convex.
Definition at line 8356 of file geom_algorithms.H.
|
inlinestaticprivate |
Check whether merging faces f1 and f2 across diagonal (u,v) is convex.
Definition at line 8380 of file geom_algorithms.H.
References Aleph::CW, Aleph::divide_and_conquer_partition_dp(), find_pos(), Aleph::orientation(), and Aleph::Array< T >::size().
Referenced by operator()().
|
inlinestaticprivate |
Definition at line 8453 of file geom_algorithms.H.
References Aleph::GeomPolygonUtils::extract_vertices().
Referenced by operator()().
|
inlinestaticprivate |
Definition at line 8360 of file geom_algorithms.H.
References NONE, and Aleph::Array< T >::size().
Referenced by can_merge(), merge_faces(), and operator()().
|
inlinestaticprivate |
Definition at line 8368 of file geom_algorithms.H.
References Aleph::and, and Aleph::divide_and_conquer_partition_dp().
Referenced by operator()().
|
inlinestaticprivate |
Merge f1 and f2 by removing their shared edge (u,v).
Definition at line 8419 of file geom_algorithms.H.
References Aleph::Array< T >::append(), Aleph::divide_and_conquer_partition_dp(), find_pos(), k, Aleph::Array< T >::reserve(), and Aleph::Array< T >::size().
Referenced by operator()().
Decompose polygon poly into convex parts.
| poly | A closed simple polygon with ≥ 3 vertices. |
Definition at line 8465 of file geom_algorithms.H.
References Aleph::Polygon::add_vertex(), ah_domain_error_if, Aleph::and, Aleph::Array< T >::append(), can_merge(), Aleph::Polygon::close(), Aleph::CW, Aleph::divide_and_conquer_partition_dp(), extract_vertices(), find_pos(), Aleph::Triangle::get_p1(), Aleph::Triangle::get_p2(), Aleph::Triangle::get_p3(), Aleph::HTList::Iterator::has_curr(), Aleph::Polygon::is_closed(), is_polygon_edge(), k, merge_faces(), NONE, Aleph::orientation(), Aleph::Array< T >::reserve(), Aleph::Polygon::size(), and Aleph::Array< T >::size().
|
staticconstexprprivate |
Definition at line 8358 of file geom_algorithms.H.
Referenced by find_pos(), and operator()().