ENH: regenerate wall when switch to manual brim

The first layer order should be outer wall first,
when the object indeed has brim.

So must regenerate wall when switch to manual brim.

Signed-off-by: salt.wei <salt.wei@bambulab.com>
Change-Id: I44fd0686b7a0e836337f5e6ff8ee311ea0c7bceb
This commit is contained in:
salt.wei authored and Lane.Wei committed 2022-12-15 04:33:48 -05:00
1 parent 5f20d14476
commit 1c6c8ff696
1 file changed
+8
+8
View File
@@ -663,6 +663,14 @@ bool PrintObject::invalidate_state_by_config_options(
|| opt_key == "top_surface_speed") {
// Brim is printed below supports, support invalidates brim and skirt.
steps.emplace_back(posSupportMaterial);
if (opt_key == "brim_type") {
const auto* old_brim_type = old_config.option<ConfigOptionEnum<BrimType>>(opt_key);
const auto* new_brim_type = new_config.option<ConfigOptionEnum<BrimType>>(opt_key);
//BBS: When switch to manual brim, the object must have brim, then re-generate perimeter
//to make the wall order of first layer to be outer-first
if (old_brim_type->value == btOuterOnly || new_brim_type->value == btOuterOnly)
steps.emplace_back(posPerimeters);
}
} else if (
opt_key == "wall_loops"
|| opt_key == "only_one_wall_top"