mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-07-07 23:17:35 -06:00
FIX: variable layer height prompt an error when enable the prime tower
Change-Id: I80b3965d25a9e1faaff1298f42b171660974463e (cherry picked from commit a519f82ce7c1b169ad995d10a28e873e133f2373)
This commit is contained in:
parent
4671aed03b
commit
118a13200b
6 changed files with 39 additions and 30 deletions
|
@ -727,7 +727,7 @@ static std::vector<std::string> 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"
|
||||
|
|
|
@ -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
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -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));
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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<ConfigOptionBool>("enable_prime_tower");
|
||||
if (used_filaments > 0 && ept_opt != nullptr) {
|
||||
ConfigOptionBool* islh_opt = this->option<ConfigOptionBool>("independent_support_layer_height", true);
|
||||
ConfigOptionBool* alh_opt = this->option<ConfigOptionBool>("adaptive_layer_height");
|
||||
//ConfigOptionBool* alh_opt = this->option<ConfigOptionBool>("adaptive_layer_height");
|
||||
ConfigOptionEnum<PrintSequence>* ps_opt = this->option<ConfigOptionEnum<PrintSequence>>("print_sequence");
|
||||
|
||||
ConfigOptionEnum<TimelapseType>* timelapse_opt = this->option<ConfigOptionEnum<TimelapseType>>("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<ConfigOptionBool>("enable_prime_tower");
|
||||
if (used_filaments > 0 && ept_opt != nullptr) {
|
||||
ConfigOptionBool* islh_opt = this->option<ConfigOptionBool>("independent_support_layer_height", true);
|
||||
ConfigOptionBool* alh_opt = this->option<ConfigOptionBool>("adaptive_layer_height");
|
||||
//ConfigOptionBool* alh_opt = this->option<ConfigOptionBool>("adaptive_layer_height");
|
||||
ConfigOptionEnum<PrintSequence>* ps_opt = this->option<ConfigOptionEnum<PrintSequence>>("print_sequence");
|
||||
|
||||
ConfigOptionEnum<TimelapseType>* timelapse_opt = this->option<ConfigOptionEnum<TimelapseType>>("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) {
|
||||
|
|
|
@ -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))
|
||||
)
|
||||
|
||||
|
|
|
@ -447,7 +447,7 @@ void ConfigManipulation::update_print_fff_config(DynamicPrintConfig* config, con
|
|||
void ConfigManipulation::apply_null_fff_config(DynamicPrintConfig *config, std::vector<std::string> const &keys, std::map<ObjectBase *, ModelConfig *> 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));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue