diff --git a/lib/Slic3r/GUI/Tab.pm b/lib/Slic3r/GUI/Tab.pm index 2c3de27d9c..3ba9cd47b8 100644 --- a/lib/Slic3r/GUI/Tab.pm +++ b/lib/Slic3r/GUI/Tab.pm @@ -566,7 +566,7 @@ sub build { external_perimeter_extrusion_width infill_extrusion_width solid_infill_extrusion_width top_infill_extrusion_width support_material_extrusion_width infill_overlap bridge_flow_ratio - clip_multipart_objects xy_size_compensation threads resolution + clip_multipart_objects elefant_foot_compensation xy_size_compensation threads resolution wipe_tower wipe_tower_x wipe_tower_y wipe_tower_width wipe_tower_per_color_wipe )); $self->{config}->set('print_settings_id', ''); @@ -770,6 +770,7 @@ sub build { { my $optgroup = $page->new_optgroup('Other'); $optgroup->append_single_option_line('clip_multipart_objects'); + $optgroup->append_single_option_line('elefant_foot_compensation'); $optgroup->append_single_option_line('xy_size_compensation'); $optgroup->append_single_option_line('threads') if $Slic3r::have_threads; $optgroup->append_single_option_line('resolution'); diff --git a/slic3r.pl b/slic3r.pl index e158da656a..e62576ebe5 100755 --- a/slic3r.pl +++ b/slic3r.pl @@ -495,9 +495,13 @@ $j --dont-arrange Don't arrange the objects on the build plate. The model coordinates define the absolute positions on the build plate. The option --print-center will be ignored. - --clip_multipart_objects When printing multi-material objects, this settings will make slic3r to clip the overlapping + --clip_multipart_objects + When printing multi-material objects, this settings will make slic3r to clip the overlapping object parts one by the other (2nd part will be clipped by the 1st, 3rd part will be clipped by the 1st and 2nd etc). (default: $config->{clip_multipart_objects})"; + --elefant-foot-compensation + Shrink the first layer by the configured value to compensate for the 1st layer squish + aka an Elefant Foot effect (mm, default: $config->{elefant_foot_compensation}) --xy-size-compensation Grow/shrink objects by the configured absolute distance (mm, default: $config->{xy_size_compensation}) diff --git a/xs/src/libslic3r/PrintConfig.cpp b/xs/src/libslic3r/PrintConfig.cpp index a9074b6a4c..01bb71cc13 100644 --- a/xs/src/libslic3r/PrintConfig.cpp +++ b/xs/src/libslic3r/PrintConfig.cpp @@ -163,6 +163,15 @@ PrintConfigDef::PrintConfigDef() def->min = 0; def->default_value = new ConfigOptionFloat(6); + def = this->add("elefant_foot_compensation", coFloat); + def->label = "Elefant foot compensation"; + def->category = "Advanced"; + def->tooltip = "The first layer will be shrunk in the XY plane by the configured value to compensate for the 1st layer squish aka an Elefant Foot effect."; + def->sidetext = "mm"; + def->cli = "elefant-foot-compensation=f"; + def->min = 0; + def->default_value = new ConfigOptionFloat(0); + def = this->add("end_gcode", coString); def->label = "End G-code"; def->tooltip = "This end procedure is inserted at the end of the output file. Note that you can use placeholder variables for all Slic3r settings."; diff --git a/xs/src/libslic3r/PrintConfig.hpp b/xs/src/libslic3r/PrintConfig.hpp index 55b5324ed9..29e829ea1d 100644 --- a/xs/src/libslic3r/PrintConfig.hpp +++ b/xs/src/libslic3r/PrintConfig.hpp @@ -165,6 +165,7 @@ class PrintObjectConfig : public virtual StaticPrintConfig public: ConfigOptionBool clip_multipart_objects; ConfigOptionBool dont_support_bridges; + ConfigOptionFloat elefant_foot_compensation; ConfigOptionFloatOrPercent extrusion_width; ConfigOptionFloatOrPercent first_layer_height; ConfigOptionBool infill_only_where_needed; @@ -203,6 +204,7 @@ public: virtual ConfigOption* optptr(const t_config_option_key &opt_key, bool create = false) { OPT_PTR(clip_multipart_objects); OPT_PTR(dont_support_bridges); + OPT_PTR(elefant_foot_compensation); OPT_PTR(extrusion_width); OPT_PTR(first_layer_height); OPT_PTR(infill_only_where_needed); diff --git a/xs/src/libslic3r/PrintObject.cpp b/xs/src/libslic3r/PrintObject.cpp index 588e46ef67..3999551c0d 100644 --- a/xs/src/libslic3r/PrintObject.cpp +++ b/xs/src/libslic3r/PrintObject.cpp @@ -160,6 +160,7 @@ bool PrintObject::invalidate_state_by_config_options(const std::vectorlayers[layer_id]; // Apply size compensation and perform clipping of multi-part objects. float delta = float(scale_(this->config.xy_size_compensation.value)); + if (layer_id == 0) + delta -= float(scale_(this->config.elefant_foot_compensation.value)); bool scale = delta != 0.f; bool clip = this->config.clip_multipart_objects.value || delta > 0.f; if (layer->regions.size() == 1) {