diff --git a/src/libslic3r/Preset.cpp b/src/libslic3r/Preset.cpp index 490590fdb6..828639218b 100644 --- a/src/libslic3r/Preset.cpp +++ b/src/libslic3r/Preset.cpp @@ -727,7 +727,7 @@ static std::vector s_Preset_print_options { "tree_support_branch_angle", "tree_support_with_infill", "tree_support_wall_count", "tree_support_branch_distance", "tree_support_branch_diameter", "detect_narrow_internal_solid_infill", - "gcode_add_line_number", "enable_arc_fitting", "infill_combination", "adaptive_layer_height", + "gcode_add_line_number", "enable_arc_fitting", "infill_combination", /*"adaptive_layer_height",*/ "support_bottom_interface_spacing", "enable_overhang_speed", "overhang_1_4_speed", "overhang_2_4_speed", "overhang_3_4_speed", "overhang_4_4_speed", "initial_layer_infill_speed", "only_one_wall_top", "timelapse_type" diff --git a/src/libslic3r/Print.cpp b/src/libslic3r/Print.cpp index 51685031c7..32e6e2e2be 100644 --- a/src/libslic3r/Print.cpp +++ b/src/libslic3r/Print.cpp @@ -947,16 +947,25 @@ StringObjectException Print::validate(StringObjectException *warning, Polygons* } // BBS: remove obsolete logics and _L() -#if 0 if (has_custom_layering) { - for (size_t idx_object = 0; idx_object < m_objects.size(); ++ idx_object) { - if (idx_object == tallest_object_idx) - continue; - if (layer_height_profiles[idx_object] != layer_height_profiles[tallest_object_idx]) - return {("The prime tower is only supported if all objects have the same variable layer height"), m_objects[idx_object]}; + for (size_t idx_object = 0; idx_object < m_objects.size(); ++idx_object) { + if (idx_object == tallest_object_idx) continue; + // Check that the layer height profiles are equal. This will happen when one object is + // a copy of another, or when a layer height modifier is used the same way on both objects. + // The latter case might create a floating point inaccuracy mismatch, so compare + // element-wise using an epsilon check. + size_t i = 0; + const coordf_t eps = 0.5 * EPSILON; // layers closer than EPSILON will be merged later. Let's make + // this check a bit more sensitive to make sure we never consider two different layers as one. + while (i < layer_height_profiles[idx_object].size() && i < layer_height_profiles[tallest_object_idx].size()) { + if (i % 2 == 0 && layer_height_profiles[tallest_object_idx][i] > layer_height_profiles[idx_object][layer_height_profiles[idx_object].size() - 2]) + break; + if (std::abs(layer_height_profiles[idx_object][i] - layer_height_profiles[tallest_object_idx][i]) > eps) + return {L("The prime tower is only supported if all objects have the same variable layer height")}; + ++i; + } } } -#endif } } diff --git a/src/libslic3r/PrintApply.cpp b/src/libslic3r/PrintApply.cpp index 761b5cf44d..73da62d38e 100644 --- a/src/libslic3r/PrintApply.cpp +++ b/src/libslic3r/PrintApply.cpp @@ -1401,7 +1401,7 @@ Print::ApplyStatus Print::apply(const Model &model, DynamicPrintConfig new_full_ // BBS for (PrintObject* object : m_objects) { auto ept_iter = std::find(print_diff.begin(), print_diff.end(), "enable_prime_tower"); - if (object->config().adaptive_layer_height && ept_iter != print_diff.end()) { + if (/*object->config().adaptive_layer_height &&*/ ept_iter != print_diff.end()) { update_apply_status(object->invalidate_step(posSlice)); } } diff --git a/src/libslic3r/PrintConfig.cpp b/src/libslic3r/PrintConfig.cpp index 48253fef98..229a96e7f0 100644 --- a/src/libslic3r/PrintConfig.cpp +++ b/src/libslic3r/PrintConfig.cpp @@ -1328,13 +1328,13 @@ void PrintConfigDef::init_fff_params() def->min = 0; def->set_default_value(new ConfigOptionFloat(0.2)); - def = this->add("adaptive_layer_height", coBool); - def->label = L("Adaptive layer height"); - def->category = L("Quality"); - def->tooltip = L("Enabling this option means the height of every layer except the first will be automatically calculated " - "during slicing according to the slope of the model’s surface.\n" - "Note that this option only takes effect if no prime tower is generated in current plate."); - def->set_default_value(new ConfigOptionBool(0)); + //def = this->add("adaptive_layer_height", coBool); + //def->label = L("Adaptive layer height"); + //def->category = L("Quality"); + //def->tooltip = L("Enabling this option means the height of every layer except the first will be automatically calculated " + // "during slicing according to the slope of the model’s surface.\n" + // "Note that this option only takes effect if no prime tower is generated in current plate."); + //def->set_default_value(new ConfigOptionBool(0)); def = this->add("initial_layer_speed", coFloat); def->label = L("Initial layer"); @@ -3720,7 +3720,7 @@ void PrintConfigDef::handle_legacy(t_config_option_key &opt_key, std::string &va "support_bottom_z_distance", "support_closing_radius", "remove_freq_sweep", "remove_bed_leveling", "remove_extrusion_calibration", "support_transition_line_width", "support_transition_speed", "bed_temperature", "bed_temperature_initial_layer", - "can_switch_nozzle_type", "can_add_auxiliary_fan", "extra_flush_volume", "spaghetti_detector", "adaptive_layer_height" + "can_switch_nozzle_type", "can_add_auxiliary_fan", "extra_flush_volume", "spaghetti_detector"/*, "adaptive_layer_height"*/ }; if (ignore.find(opt_key) != ignore.end()) { @@ -3826,7 +3826,7 @@ void DynamicPrintConfig::normalize_fdm(int used_filaments) ConfigOptionBool* ept_opt = this->option("enable_prime_tower"); if (used_filaments > 0 && ept_opt != nullptr) { ConfigOptionBool* islh_opt = this->option("independent_support_layer_height", true); - ConfigOptionBool* alh_opt = this->option("adaptive_layer_height"); + //ConfigOptionBool* alh_opt = this->option("adaptive_layer_height"); ConfigOptionEnum* ps_opt = this->option>("print_sequence"); ConfigOptionEnum* timelapse_opt = this->option>("timelapse_type"); @@ -3838,8 +3838,8 @@ void DynamicPrintConfig::normalize_fdm(int used_filaments) if (ept_opt->value) { if (islh_opt) islh_opt->value = false; - if (alh_opt) - alh_opt->value = false; + //if (alh_opt) + // alh_opt->value = false; } else { if (islh_opt) @@ -3901,7 +3901,7 @@ t_config_option_keys DynamicPrintConfig::normalize_fdm_2(int used_filaments) ConfigOptionBool* ept_opt = this->option("enable_prime_tower"); if (used_filaments > 0 && ept_opt != nullptr) { ConfigOptionBool* islh_opt = this->option("independent_support_layer_height", true); - ConfigOptionBool* alh_opt = this->option("adaptive_layer_height"); + //ConfigOptionBool* alh_opt = this->option("adaptive_layer_height"); ConfigOptionEnum* ps_opt = this->option>("print_sequence"); ConfigOptionEnum* timelapse_opt = this->option>("timelapse_type"); @@ -3922,13 +3922,13 @@ t_config_option_keys DynamicPrintConfig::normalize_fdm_2(int used_filaments) } //islh_opt->value = false; } - if (alh_opt) { - if (alh_opt->value) { - alh_opt->value = false; - changed_keys.push_back("adaptive_layer_height"); - } - //alh_opt->value = false; - } + //if (alh_opt) { + // if (alh_opt->value) { + // alh_opt->value = false; + // changed_keys.push_back("adaptive_layer_height"); + // } + // //alh_opt->value = false; + //} } else { if (islh_opt) { diff --git a/src/libslic3r/PrintConfig.hpp b/src/libslic3r/PrintConfig.hpp index f978935cc8..d3f7ee2deb 100644 --- a/src/libslic3r/PrintConfig.hpp +++ b/src/libslic3r/PrintConfig.hpp @@ -654,7 +654,7 @@ PRINT_CONFIG_CLASS_DEFINE( ((ConfigOptionInt, tree_support_wall_count)) ((ConfigOptionBool, tree_support_with_infill)) ((ConfigOptionBool, detect_narrow_internal_solid_infill)) - ((ConfigOptionBool, adaptive_layer_height)) + // ((ConfigOptionBool, adaptive_layer_height)) ((ConfigOptionFloat, support_bottom_interface_spacing)) ) diff --git a/src/slic3r/GUI/ConfigManipulation.cpp b/src/slic3r/GUI/ConfigManipulation.cpp index 40bc5a4103..f1774ec429 100644 --- a/src/slic3r/GUI/ConfigManipulation.cpp +++ b/src/slic3r/GUI/ConfigManipulation.cpp @@ -447,7 +447,7 @@ void ConfigManipulation::update_print_fff_config(DynamicPrintConfig* config, con void ConfigManipulation::apply_null_fff_config(DynamicPrintConfig *config, std::vector const &keys, std::map const &configs) { for (auto &k : keys) { - if (k == "adaptive_layer_height" || k == "independent_support_layer_height" || k == "enable_support" || k == "detect_thin_wall") + if (/*k == "adaptive_layer_height" || */k == "independent_support_layer_height" || k == "enable_support" || k == "detect_thin_wall") config->set_key_value(k, new ConfigOptionBool(true)); else if (k == "wall_loops") config->set_key_value(k, new ConfigOptionInt(0));