Add elephant foot compensation over multiple layers (#2254)

#https://github.com/prusa3d/PrusaSlicer/pull/10976

Co-authored-by: Roberto Mozzicato <bitblasters@gmail.com>
This commit is contained in:
bitingsock 2023-09-30 03:12:12 -07:00 committed by GitHub
parent 3b5f42cf49
commit bda8249e06
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 18 additions and 2 deletions

View file

@ -742,7 +742,7 @@ static std::vector<std::string> s_Preset_print_options {
"ooze_prevention", "standby_temperature_delta", "interface_shells", "line_width", "initial_layer_line_width", "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", "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", "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", "prime_tower_width", "prime_tower_brim_width", "prime_volume",
"wipe_tower_no_sparse_layers", "compatible_printers", "compatible_printers_condition", "inherits", "wipe_tower_no_sparse_layers", "compatible_printers", "compatible_printers_condition", "inherits",
"flush_into_infill", "flush_into_objects", "flush_into_support", "flush_into_infill", "flush_into_objects", "flush_into_support",

View file

@ -392,6 +392,17 @@ void PrintConfigDef::init_common_params()
def->mode = comAdvanced; def->mode = comAdvanced;
def->set_default_value(new ConfigOptionFloat(0.)); 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 = this->add("layer_height", coFloat);
def->label = L("Layer height"); def->label = L("Layer height");
def->category = L("Quality"); def->category = L("Quality");

View file

@ -652,6 +652,7 @@ PRINT_CONFIG_CLASS_DEFINE(
((ConfigOptionFloat, brim_ears_max_angle)) ((ConfigOptionFloat, brim_ears_max_angle))
((ConfigOptionBool, bridge_no_support)) ((ConfigOptionBool, bridge_no_support))
((ConfigOptionFloat, elefant_foot_compensation)) ((ConfigOptionFloat, elefant_foot_compensation))
((ConfigOptionInt, elefant_foot_compensation_layers))
((ConfigOptionFloat, max_bridge_length)) ((ConfigOptionFloat, max_bridge_length))
((ConfigOptionFloatOrPercent, line_width)) ((ConfigOptionFloatOrPercent, line_width))
// Force the generation of solid shells between adjacent materials/volumes. // Force the generation of solid shells between adjacent materials/volumes.

View file

@ -805,6 +805,7 @@ bool PrintObject::invalidate_state_by_config_options(
steps.emplace_back(posSlice); steps.emplace_back(posSlice);
} else if ( } else if (
opt_key == "elefant_foot_compensation" opt_key == "elefant_foot_compensation"
|| opt_key == "elefant_foot_compensation_layers"
|| opt_key == "support_top_z_distance" || opt_key == "support_top_z_distance"
|| opt_key == "support_bottom_z_distance" || opt_key == "support_bottom_z_distance"
|| opt_key == "xy_hole_compensation" || opt_key == "xy_hole_compensation"

View file

@ -1085,7 +1085,9 @@ void PrintObject::slice_volumes()
m_print->throw_if_canceled(); m_print->throw_if_canceled();
Layer *layer = m_layers[layer_id]; Layer *layer = m_layers[layer_id];
// Apply size compensation and perform clipping of multi-part objects. // 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) { if (layer->m_regions.size() == 1) {
// Optimized version for a single region layer. // Optimized version for a single region layer.
// Single region, growing or shrinking. // Single region, growing or shrinking.

View file

@ -1868,6 +1868,7 @@ void TabPrint::build()
optgroup->append_single_option_line("xy_hole_compensation"); optgroup->append_single_option_line("xy_hole_compensation");
optgroup->append_single_option_line("xy_contour_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");
optgroup->append_single_option_line("elefant_foot_compensation_layers");
optgroup->append_single_option_line("precise_outer_wall"); optgroup->append_single_option_line("precise_outer_wall");
optgroup = page->new_optgroup(L("Ironing"), L"param_ironing"); optgroup = page->new_optgroup(L("Ironing"), L"param_ironing");