From a52364f03bd315465c5eba83ba4d6f8ef3b19cb3 Mon Sep 17 00:00:00 2001 From: Cyril-CC <792552360@qq.com> Date: Thu, 15 Sep 2022 18:41:26 +0800 Subject: [PATCH] Fixed: Fix model simplify limit --- src/lunarmp/model/ModelSimplification.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/lunarmp/model/ModelSimplification.cpp b/src/lunarmp/model/ModelSimplification.cpp index 6be8c51..0421129 100644 --- a/src/lunarmp/model/ModelSimplification.cpp +++ b/src/lunarmp/model/ModelSimplification.cpp @@ -93,8 +93,13 @@ void ModelSimplification::modelSimplification(std::string input_file, std::strin } case SimplifyType::EDGE_RATIO_STOP: { auto edge_ratio_threshold = data_group.settings.get("edge_ratio_threshold"); -// edgeCollapseGarlandHeckbert(mesh, edge_ratio_threshold); - edgeCollapseBoundedNormalChange(mesh, mesh.edges().size() * edge_ratio_threshold); + double edge_count_threshold = mesh.number_of_edges() * edge_ratio_threshold; + if (edge_count_threshold < 1000) { + edgeCollapseGarlandHeckbert(mesh, edge_ratio_threshold); + } + else { + edgeCollapseBoundedNormalChange(mesh, edge_count_threshold); + } simplification_time = t.time(); break; }