diff --git a/src/libslic3r/Print.cpp b/src/libslic3r/Print.cpp index 509419db6..1a4eb11d2 100644 --- a/src/libslic3r/Print.cpp +++ b/src/libslic3r/Print.cpp @@ -2112,6 +2112,11 @@ void Print::_extrude_brim_from_tree(std::vector>& loops, }; extrude_ptr = &extrude; + if (loops.empty()) { + BOOST_LOG_TRIVIAL(error) << "Failed to extrude brim: no loops to extrude, are you sure your settings are ok?"; + return; + } + //launch extrude for (BrimLoop& loop : loops[0]) { extrude(loop, &out); diff --git a/src/libslic3r/PrintConfig.cpp b/src/libslic3r/PrintConfig.cpp index f6460b0a5..dc4c3332e 100644 --- a/src/libslic3r/PrintConfig.cpp +++ b/src/libslic3r/PrintConfig.cpp @@ -368,7 +368,7 @@ void PrintConfigDef::init_fff_params() def = this->add("brim_offset", coFloat); def->label = L("brim offset"); def->category = OptionCategory::skirtBrim; - def->tooltip = L("Distance between the brim and the part. Should be kept at 0 unless you encounter great difficulties to separate them. It's substracted to brim_width and brim_width_interior., so it has to be lower than them"); + def->tooltip = L("Distance between the brim and the part. Should be kept at 0 unless you encounter great difficulties to separate them. It's subtracted to brim_width and brim_width_interior., so it has to be lower than them"); def->sidetext = L("mm"); def->min = 0; def->mode = comExpert; diff --git a/src/slic3r/GUI/ConfigManipulation.cpp b/src/slic3r/GUI/ConfigManipulation.cpp index f64af515e..1453fa5bf 100644 --- a/src/slic3r/GUI/ConfigManipulation.cpp +++ b/src/slic3r/GUI/ConfigManipulation.cpp @@ -208,6 +208,21 @@ void ConfigManipulation::update_print_fff_config(DynamicPrintConfig* config, con } } + if (config->opt_float("brim_width") > 0 && config->opt_float("brim_offset") >= config->opt_float("brim_width")) { + wxString msg_text = _(L("It's not possible to use a bigger value for the brim offset than the brim width, as it won't extrude anything." + " Brim offset have to be lower than the brim width.")); + if (is_global_config) + msg_text += "\n\n" + _(L("Shall I switch the brim offset to 0?")); + wxMessageDialog dialog(nullptr, msg_text, _(L("Brim configuration")), + wxICON_WARNING | (is_global_config ? wxYES | wxNO : wxOK)); + auto answer = dialog.ShowModal(); + if (!is_global_config || answer == wxID_YES) { + DynamicPrintConfig new_conf = *config; + new_conf.set_key_value("brim_offset", new ConfigOptionFloat(0)); + apply(config, &new_conf); + } + } + static bool support_material_overhangs_queried = false; if (config->opt_bool("support_material")) {