Skip to content

Commit b7c81cc

Browse files
authored
Fixed: Fix model simplify limit (#16)
Fixed:Modified the rule of simplifying by the number of edges of the model. Models with less than 1000 edges will be executed according to a more strict simplified logic
1 parent 9358e4f commit b7c81cc

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

src/lunarmp/model/ModelSimplification.cpp

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,8 +93,13 @@ void ModelSimplification::modelSimplification(std::string input_file, std::strin
9393
}
9494
case SimplifyType::EDGE_RATIO_STOP: {
9595
auto edge_ratio_threshold = data_group.settings.get<double>("edge_ratio_threshold");
96-
// edgeCollapseGarlandHeckbert(mesh, edge_ratio_threshold);
97-
edgeCollapseBoundedNormalChange(mesh, mesh.edges().size() * edge_ratio_threshold);
96+
double edge_count_threshold = mesh.number_of_edges() * edge_ratio_threshold;
97+
if (edge_count_threshold < 1000) {
98+
edgeCollapseGarlandHeckbert(mesh, edge_ratio_threshold);
99+
}
100+
else {
101+
edgeCollapseBoundedNormalChange(mesh, edge_count_threshold);
102+
}
98103
simplification_time = t.time();
99104
break;
100105
}

0 commit comments

Comments
 (0)