diff --git a/src/libslic3r/Preset.cpp b/src/libslic3r/Preset.cpp index fe30d6ada6..1a1f75008d 100644 --- a/src/libslic3r/Preset.cpp +++ b/src/libslic3r/Preset.cpp @@ -742,7 +742,7 @@ static std::vector s_Preset_print_options { "ooze_prevention", "standby_temperature_delta", "interface_shells", "line_width", "initial_layer_line_width", "inner_wall_line_width", "outer_wall_line_width", "sparse_infill_line_width", "internal_solid_infill_line_width", "top_surface_line_width", "support_line_width", "infill_wall_overlap", "bridge_flow", - "elefant_foot_compensation", "xy_contour_compensation", "xy_hole_compensation", "resolution", "enable_prime_tower", + "elefant_foot_compensation", "elefant_foot_compensation_layers", "xy_contour_compensation", "xy_hole_compensation", "resolution", "enable_prime_tower", "prime_tower_width", "prime_tower_brim_width", "prime_volume", "wipe_tower_no_sparse_layers", "compatible_printers", "compatible_printers_condition", "inherits", "flush_into_infill", "flush_into_objects", "flush_into_support", diff --git a/src/libslic3r/PrintConfig.cpp b/src/libslic3r/PrintConfig.cpp index eb97f6293f..b802400550 100644 --- a/src/libslic3r/PrintConfig.cpp +++ b/src/libslic3r/PrintConfig.cpp @@ -392,6 +392,17 @@ void PrintConfigDef::init_common_params() def->mode = comAdvanced; def->set_default_value(new ConfigOptionFloat(0.)); + def = this->add("elefant_foot_compensation_layers", coInt); + def->label = L("Elephant foot compensation layers"); + def->category = L("Quality"); + def->tooltip = L("The number of layers on which the elephant foot compensation will be active. " + "The first layer will be shrunk by the elephant foot compensation value, then " + "the next layers will be linearly shrunk less, up to the layer indicated by this value."); + def->sidetext = L("layers"); + def->min = 1; + def->mode = comAdvanced; + def->set_default_value(new ConfigOptionInt(1)); + def = this->add("layer_height", coFloat); def->label = L("Layer height"); def->category = L("Quality"); diff --git a/src/libslic3r/PrintConfig.hpp b/src/libslic3r/PrintConfig.hpp index 951d6283a9..41de30a2a7 100644 --- a/src/libslic3r/PrintConfig.hpp +++ b/src/libslic3r/PrintConfig.hpp @@ -652,6 +652,7 @@ PRINT_CONFIG_CLASS_DEFINE( ((ConfigOptionFloat, brim_ears_max_angle)) ((ConfigOptionBool, bridge_no_support)) ((ConfigOptionFloat, elefant_foot_compensation)) + ((ConfigOptionInt, elefant_foot_compensation_layers)) ((ConfigOptionFloat, max_bridge_length)) ((ConfigOptionFloatOrPercent, line_width)) // Force the generation of solid shells between adjacent materials/volumes. diff --git a/src/libslic3r/PrintObject.cpp b/src/libslic3r/PrintObject.cpp index c356da1b0f..c66c3406ed 100644 --- a/src/libslic3r/PrintObject.cpp +++ b/src/libslic3r/PrintObject.cpp @@ -805,6 +805,7 @@ bool PrintObject::invalidate_state_by_config_options( steps.emplace_back(posSlice); } else if ( opt_key == "elefant_foot_compensation" + || opt_key == "elefant_foot_compensation_layers" || opt_key == "support_top_z_distance" || opt_key == "support_bottom_z_distance" || opt_key == "xy_hole_compensation" diff --git a/src/libslic3r/PrintObjectSlice.cpp b/src/libslic3r/PrintObjectSlice.cpp index 092ae14b59..42443c7408 100644 --- a/src/libslic3r/PrintObjectSlice.cpp +++ b/src/libslic3r/PrintObjectSlice.cpp @@ -1085,7 +1085,9 @@ void PrintObject::slice_volumes() m_print->throw_if_canceled(); Layer *layer = m_layers[layer_id]; // Apply size compensation and perform clipping of multi-part objects. - float elfoot = (layer_id == 0) ? elephant_foot_compensation_scaled : 0.f; + float elfoot = elephant_foot_compensation_scaled > 0 && layer_id < m_config.elefant_foot_compensation_layers.value ? + elephant_foot_compensation_scaled - (elephant_foot_compensation_scaled / m_config.elefant_foot_compensation_layers.value) * layer_id : + 0.f; if (layer->m_regions.size() == 1) { // Optimized version for a single region layer. // Single region, growing or shrinking. diff --git a/src/slic3r/GUI/Tab.cpp b/src/slic3r/GUI/Tab.cpp index 4ea1b4e19d..cb1eb6a56a 100644 --- a/src/slic3r/GUI/Tab.cpp +++ b/src/slic3r/GUI/Tab.cpp @@ -1868,6 +1868,7 @@ void TabPrint::build() optgroup->append_single_option_line("xy_hole_compensation"); optgroup->append_single_option_line("xy_contour_compensation"); optgroup->append_single_option_line("elefant_foot_compensation"); + optgroup->append_single_option_line("elefant_foot_compensation_layers"); optgroup->append_single_option_line("precise_outer_wall"); optgroup = page->new_optgroup(L("Ironing"), L"param_ironing");