From 07cd25d0ecd3d4a2fce834b7f735a44c151aa254 Mon Sep 17 00:00:00 2001 From: Alessandro Ranellucci Date: Sun, 1 Feb 2015 12:08:25 +0100 Subject: [PATCH] New option for customization of infill/perimeters overlap. #2459 --- README.md | 1 + lib/Slic3r.pm | 2 +- lib/Slic3r/GUI/Tab.pm | 6 +++++- lib/Slic3r/Layer/PerimeterGenerator.pm | 2 +- slic3r.pl | 1 + xs/src/libslic3r/PrintConfig.cpp | 8 ++++++++ xs/src/libslic3r/PrintConfig.hpp | 4 ++++ xs/src/libslic3r/PrintObject.cpp | 1 + 8 files changed, 22 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index e9a14100e..ee97e5b65 100644 --- a/README.md +++ b/README.md @@ -350,6 +350,7 @@ The author of the Silk icon set is Mark James. Set a different extrusion width for top infill --support-material-extrusion-width Set a different extrusion width for support material + --infill-overlap Overlap between infill and perimeters (default: 15%) --bridge-flow-ratio Multiplier for extrusion when bridging (> 0, default: 1) Multiple extruder options: diff --git a/lib/Slic3r.pm b/lib/Slic3r.pm index 9352a1083..c4466b9bb 100644 --- a/lib/Slic3r.pm +++ b/lib/Slic3r.pm @@ -79,7 +79,7 @@ use constant RESOLUTION => 0.0125; use constant SCALED_RESOLUTION => RESOLUTION / SCALING_FACTOR; use constant SMALL_PERIMETER_LENGTH => (6.5 / SCALING_FACTOR) * 2 * PI; use constant LOOP_CLIPPING_LENGTH_OVER_NOZZLE_DIAMETER => 0.15; -use constant INFILL_OVERLAP_OVER_SPACING => 0.45; +use constant INFILL_OVERLAP_OVER_SPACING => 0.3; use constant EXTERNAL_INFILL_MARGIN => 3; use constant INSET_OVERLAP_TOLERANCE => 0.4; diff --git a/lib/Slic3r/GUI/Tab.pm b/lib/Slic3r/GUI/Tab.pm index 6ef153191..65e6de494 100644 --- a/lib/Slic3r/GUI/Tab.pm +++ b/lib/Slic3r/GUI/Tab.pm @@ -474,7 +474,7 @@ sub build { extrusion_width first_layer_extrusion_width perimeter_extrusion_width external_perimeter_extrusion_width infill_extrusion_width solid_infill_extrusion_width top_infill_extrusion_width support_material_extrusion_width - bridge_flow_ratio + infill_overlap bridge_flow_ratio xy_size_compensation threads resolution )); @@ -644,6 +644,10 @@ sub build { $optgroup->append_single_option_line('top_infill_extrusion_width'); $optgroup->append_single_option_line('support_material_extrusion_width'); } + { + my $optgroup = $page->new_optgroup('Overlap'); + $optgroup->append_single_option_line('infill_overlap'); + } { my $optgroup = $page->new_optgroup('Flow'); $optgroup->append_single_option_line('bridge_flow_ratio'); diff --git a/lib/Slic3r/Layer/PerimeterGenerator.pm b/lib/Slic3r/Layer/PerimeterGenerator.pm index 0f1953d40..6dcbe5733 100644 --- a/lib/Slic3r/Layer/PerimeterGenerator.pm +++ b/lib/Slic3r/Layer/PerimeterGenerator.pm @@ -316,7 +316,7 @@ sub process { for map Slic3r::Surface->new(expolygon => $_, surface_type => S_TYPE_INTERNAL), # use a bogus surface type @{offset2_ex( [ map @{$_->simplify_p(&Slic3r::SCALED_RESOLUTION)}, @{union_ex(\@last)} ], - -($pspacing/2 + $min_perimeter_infill_spacing/2), + -($pspacing/2 - $self->config->get_abs_value_over('infill_overlap', $pwidth) + $min_perimeter_infill_spacing/2), +$min_perimeter_infill_spacing/2, )}; } diff --git a/slic3r.pl b/slic3r.pl index cad1e6a8b..84590b197 100755 --- a/slic3r.pl +++ b/slic3r.pl @@ -501,6 +501,7 @@ $j Set a different extrusion width for top infill --support-material-extrusion-width Set a different extrusion width for support material + --infill-overlap Overlap between infill and perimeters (default: $config->{infill_overlap}) --bridge-flow-ratio Multiplier for extrusion when bridging (> 0, default: $config->{bridge_flow_ratio}) Multiple extruder options: diff --git a/xs/src/libslic3r/PrintConfig.cpp b/xs/src/libslic3r/PrintConfig.cpp index 1a31265e0..c7afe9fbc 100644 --- a/xs/src/libslic3r/PrintConfig.cpp +++ b/xs/src/libslic3r/PrintConfig.cpp @@ -429,6 +429,14 @@ PrintConfigDef::build_def() { Options["infill_only_where_needed"].tooltip = "This option will limit infill to the areas actually needed for supporting ceilings (it will act as internal support material)."; Options["infill_only_where_needed"].cli = "infill-only-where-needed!"; + Options["infill_overlap"].type = coFloatOrPercent; + Options["infill_overlap"].label = "Infill/perimeters overlap"; + Options["infill_overlap"].category = "Advanced"; + Options["infill_overlap"].tooltip = "This setting applies an additional overlap between infill and perimeters for better bonding. Theoretically this shouldn't be needed, but backlash might cause gaps. If expressed as percentage (example: 15%) it is calculated over perimeter extrusion width."; + Options["infill_overlap"].sidetext = "mm or %"; + Options["infill_overlap"].cli = "infill-overlap=s"; + Options["infill_overlap"].ratio_over = "perimeter_extrusion_width"; + Options["infill_speed"].type = coFloat; Options["infill_speed"].label = "Infill"; Options["infill_speed"].category = "Speed"; diff --git a/xs/src/libslic3r/PrintConfig.hpp b/xs/src/libslic3r/PrintConfig.hpp index c962a8634..19ae75928 100644 --- a/xs/src/libslic3r/PrintConfig.hpp +++ b/xs/src/libslic3r/PrintConfig.hpp @@ -224,6 +224,7 @@ class PrintRegionConfig : public virtual StaticPrintConfig ConfigOptionInt infill_extruder; ConfigOptionFloatOrPercent infill_extrusion_width; ConfigOptionInt infill_every_layers; + ConfigOptionFloatOrPercent infill_overlap; ConfigOptionFloat infill_speed; ConfigOptionBool overhangs; ConfigOptionInt perimeter_extruder; @@ -260,6 +261,8 @@ class PrintRegionConfig : public virtual StaticPrintConfig this->infill_extrusion_width.value = 0; this->infill_extrusion_width.percent = false; this->infill_every_layers.value = 1; + this->infill_overlap.value = 15; + this->infill_overlap.percent = true; this->infill_speed.value = 80; this->overhangs.value = true; this->perimeter_extruder.value = 1; @@ -300,6 +303,7 @@ class PrintRegionConfig : public virtual StaticPrintConfig if (opt_key == "infill_extruder") return &this->infill_extruder; if (opt_key == "infill_extrusion_width") return &this->infill_extrusion_width; if (opt_key == "infill_every_layers") return &this->infill_every_layers; + if (opt_key == "infill_overlap") return &this->infill_overlap; if (opt_key == "infill_speed") return &this->infill_speed; if (opt_key == "overhangs") return &this->overhangs; if (opt_key == "perimeter_extruder") return &this->perimeter_extruder; diff --git a/xs/src/libslic3r/PrintObject.cpp b/xs/src/libslic3r/PrintObject.cpp index 9c7c9ed82..fdf3116b7 100644 --- a/xs/src/libslic3r/PrintObject.cpp +++ b/xs/src/libslic3r/PrintObject.cpp @@ -218,6 +218,7 @@ PrintObject::invalidate_state_by_config_options(const std::vector