From 0c3b7bc72e50541ef99794aff654edb1e61d0703 Mon Sep 17 00:00:00 2001 From: harrierpigeon Date: Sat, 3 Oct 2026 12:03:18 -0500 Subject: [PATCH] Belt brim: move the apron bands with the purge plan's layer grid The purge plan snaps every object onto one layer grid after the brim is built; the per-layer brim bands follow their layers but the apron bands below the first layer carry their own print_z and were left behind, which is why a brim was refused next to a purge tower object. The shift now moves them too and the combination is accepted again. --- src/libslic3r/BeltPurge.cpp | 3 +++ src/libslic3r/Print.cpp | 10 +++------- tests/fff_print/test_skirt_brim.cpp | 11 +++++------ 3 files changed, 11 insertions(+), 13 deletions(-) diff --git a/src/libslic3r/BeltPurge.cpp b/src/libslic3r/BeltPurge.cpp index cff3de8846..c4cbc83425 100644 --- a/src/libslic3r/BeltPurge.cpp +++ b/src/libslic3r/BeltPurge.cpp @@ -322,6 +322,9 @@ void PrintObject::belt_shift_layer_grid(double delta) layer->print_z += delta; for (SupportLayer *layer : m_support_layers) layer->print_z += delta; + // The brim's apron bands below the first layer carry their own print_z. + for (BeltBrimBand &band : m_belt_brim_prologue) + band.print_z += delta; m_slicing_params.belt_floor_z_shift += delta; } diff --git a/src/libslic3r/Print.cpp b/src/libslic3r/Print.cpp index 66de6d88ee..550cfbbd64 100644 --- a/src/libslic3r/Print.cpp +++ b/src/libslic3r/Print.cpp @@ -1420,14 +1420,10 @@ StringObjectException Print::validate(std::vector *warnin return { L("Draft shield is not compatible with belt printer mode.") }; // Belt brim spans many layers and owns the layers below the object, which - // neither the belt purge tower nor spiral vase can share (the purge plan moves - // objects onto a common layer grid after the brim bands are built). The prime - // tower setting alone is no obstacle: it stays on for any multi-filament - // project, and belt printers never print the classic tower. + // spiral vase cannot share. The prime tower setting is no obstacle: belt + // printers never print the classic tower, and the belt purge prism is an + // ordinary object that never takes a brim. if (this->has_belt_brim()) { - if (this->has_belt_purge_tower()) - return { L("Brim is not compatible with the belt purge tower. " - "Disable one of them.") }; if (m_config.spiral_mode.value) return { L("Brim is not compatible with spiral vase mode on a belt printer. " "Disable one of them.") }; diff --git a/tests/fff_print/test_skirt_brim.cpp b/tests/fff_print/test_skirt_brim.cpp index d762c49421..ede355c151 100644 --- a/tests/fff_print/test_skirt_brim.cpp +++ b/tests/fff_print/test_skirt_brim.cpp @@ -930,9 +930,9 @@ TEST_CASE("Belt inner-only leading brim does not reject the prime tower or spira CHECK(print.validate().string.empty()); CHECK_FALSE(gcode(print).empty()); } - // An actual purge tower object is different: the purge plan moves objects onto a common - // layer grid after the brim bands are built, so the two are still refused together. - SECTION("a brim is refused next to a belt purge tower object") { + // A purge tower object is accepted too: the purge plan moves every object, apron + // bands included, onto one layer grid. + SECTION("a brim is accepted next to a belt purge tower object") { DynamicPrintConfig config = belt_brim_multifilament_config(2, { { "brim_type", "outer_only" }, { "brim_width", 4 }, @@ -945,12 +945,11 @@ TEST_CASE("Belt inner-only leading brim does not reject the prime tower or spira Print print; Model model; init_print({ cube(20), cube(20) }, print, model, config, &overrides); - CHECK(print.validate().string.empty()); - model.objects.back()->config.set_key_value("belt_purge_tower_object", new ConfigOptionBool(true)); print.apply(model, config); REQUIRE(print.has_belt_purge_tower()); - CHECK_FALSE(print.validate().string.empty()); + CHECK(print.validate().string.empty()); + CHECK_FALSE(gcode(print).empty()); } }