From a20611b4c0262b6c1eb7edba80b9636a77385918 Mon Sep 17 00:00:00 2001 From: Matthias Koefferlein Date: Wed, 18 Sep 2024 23:53:13 +0200 Subject: [PATCH] Skip polygon splitting for triangles and boxes --- src/db/db/dbPolygonTools.cc | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/db/db/dbPolygonTools.cc b/src/db/db/dbPolygonTools.cc index 8d19f0bb0..b7a3fc6ac 100644 --- a/src/db/db/dbPolygonTools.cc +++ b/src/db/db/dbPolygonTools.cc @@ -640,10 +640,9 @@ template 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;