Don't split tiny cracks on first layer (#9917)

Don't split tiny cracks on first layer to get an uninterrupted bottom surface
This commit is contained in:
Noisyfox
2025-06-17 19:22:16 +08:00
committed by GitHub
parent 5041e0772e
commit 1aee8a0783

View File

@@ -1382,6 +1382,7 @@ void PrintObject::detect_surfaces_type()
if (! top.empty() && ! bottom.empty()) { if (! top.empty() && ! bottom.empty()) {
const auto cracks = intersection_ex(top, bottom); const auto cracks = intersection_ex(top, bottom);
if (!cracks.empty()) { if (!cracks.empty()) {
if (lower_layer) { // Only detect small cracks for non-first layer, because first layer should always be bottom
const float small_crack_threshold = -layerm->flow(frExternalPerimeter).scaled_width() * 1.5; const float small_crack_threshold = -layerm->flow(frExternalPerimeter).scaled_width() * 1.5;
for (const auto& crack : cracks) { for (const auto& crack : cracks) {
@@ -1402,6 +1403,7 @@ void PrintObject::detect_surfaces_type()
bottom = std::move(bot_tmp); bottom = std::move(bot_tmp);
} }
} }
}
Polygons top_polygons = to_polygons(std::move(top)); Polygons top_polygons = to_polygons(std::move(top));
top.clear(); top.clear();