From f7b822abb74ca62e23e0ce062556624b6feac984 Mon Sep 17 00:00:00 2001 From: harrierpigeon Date: Fri, 2 Oct 2026 01:07:45 -0500 Subject: [PATCH] Belt: remove the unused clip_support_fills() It had no caller besides its own recursion. Raised in Hanif Koh's review of #14394. --- src/libslic3r/PrintObject.cpp | 61 ----------------------------------- 1 file changed, 61 deletions(-) diff --git a/src/libslic3r/PrintObject.cpp b/src/libslic3r/PrintObject.cpp index 8100241ef8..2c7cdc7335 100644 --- a/src/libslic3r/PrintObject.cpp +++ b/src/libslic3r/PrintObject.cpp @@ -4689,67 +4689,6 @@ void PrintObject::combine_infill() } } -// Belt printer: clip an ExtrusionEntityCollection to a region defined by clip_expoly. -// Handles ExtrusionPath, ExtrusionMultiPath, ExtrusionLoop, and nested ExtrusionEntityCollection. -static void clip_support_fills(ExtrusionEntityCollection &fills, const ExPolygons &clip_region) -{ - ExtrusionEntitiesPtr new_entities; - for (ExtrusionEntity *entity : fills.entities) { - if (auto *path = dynamic_cast(entity)) { - ExtrusionEntityCollection clipped; - path->intersect_expolygons(clip_region, &clipped); - if (!clipped.empty()) { - for (ExtrusionEntity *e : clipped.entities) - new_entities.push_back(e->clone()); - } - delete entity; - } else if (auto *multipath = dynamic_cast(entity)) { - ExtrusionPaths new_paths; - for (const ExtrusionPath &p : multipath->paths) { - ExtrusionEntityCollection clipped; - p.intersect_expolygons(clip_region, &clipped); - for (ExtrusionEntity *e : clipped.entities) - if (auto *cp = dynamic_cast(e)) - new_paths.push_back(std::move(*cp)); - } - if (!new_paths.empty()) { - multipath->paths = std::move(new_paths); - new_entities.push_back(multipath); - } else { - delete entity; - } - } else if (auto *loop = dynamic_cast(entity)) { - ExtrusionPaths new_paths; - for (const ExtrusionPath &p : loop->paths) { - ExtrusionEntityCollection clipped; - p.intersect_expolygons(clip_region, &clipped); - for (ExtrusionEntity *e : clipped.entities) - if (auto *cp = dynamic_cast(e)) - new_paths.push_back(std::move(*cp)); - } - if (!new_paths.empty()) { - // Loop is no longer a closed loop after clipping; emit as individual paths. - for (auto &p : new_paths) - new_entities.push_back(new ExtrusionPath(std::move(p))); - delete entity; - } else { - delete entity; - } - } else if (auto *coll = dynamic_cast(entity)) { - clip_support_fills(*coll, clip_region); - if (!coll->empty()) { - new_entities.push_back(coll); - } else { - delete entity; - } - } else { - // Unknown entity type — keep as-is. - new_entities.push_back(entity); - } - } - fills.entities = std::move(new_entities); -} - void PrintObject::_generate_support_material() { if (is_tree(m_config.support_type.value)) {