Skip polygon splitting for triangles and boxes

This commit is contained in:
Matthias Koefferlein 2024-09-18 23:53:13 +02:00
parent 1e6b983942
commit a20611b4c0
1 changed files with 2 additions and 3 deletions

View File

@ -640,10 +640,9 @@ template <class PolygonType>
bool
suggest_split_polygon (const PolygonType &polygon, size_t max_vertex_count, double max_area_ratio)
{
size_t v = polygon.vertices ();
if (v <= 4) {
if (polygon.is_box () || polygon.vertices () <= 3) {
return false;
} else if (max_vertex_count > 0 && v > max_vertex_count) {
} else if (max_vertex_count > 0 && polygon.vertices () > max_vertex_count) {
return true;
} else if (max_area_ratio > 0 && polygon.area_ratio () > max_area_ratio) {
return true;