From 5268574adebb0c2cc9c6148436900dffc0346abb Mon Sep 17 00:00:00 2001 From: bubnikv Date: Tue, 4 Oct 2016 14:38:13 +0200 Subject: [PATCH] Made the sheath around the base support configurable. Without the sheath it is easier to remove the support, but the support is more fragile. --- lib/Slic3r/GUI/Tab.pm | 5 +++-- lib/Slic3r/Print/SupportMaterial.pm | 3 ++- slic3r.pl | 3 +++ xs/src/libslic3r/PrintConfig.cpp | 7 +++++++ xs/src/libslic3r/PrintConfig.hpp | 2 ++ xs/src/libslic3r/PrintObject.cpp | 1 + 6 files changed, 18 insertions(+), 3 deletions(-) diff --git a/lib/Slic3r/GUI/Tab.pm b/lib/Slic3r/GUI/Tab.pm index 7304c2f58..ec7f35c19 100644 --- a/lib/Slic3r/GUI/Tab.pm +++ b/lib/Slic3r/GUI/Tab.pm @@ -480,7 +480,7 @@ sub build { brim_width support_material support_material_threshold support_material_enforce_layers raft_layers - support_material_pattern support_material_spacing support_material_angle + support_material_pattern support_material_with_sheath support_material_spacing support_material_angle support_material_interface_layers support_material_interface_spacing support_material_contact_distance support_material_buildplate_only dont_support_bridges notes @@ -588,6 +588,7 @@ sub build { my $optgroup = $page->new_optgroup('Options for support material and raft'); $optgroup->append_single_option_line('support_material_contact_distance'); $optgroup->append_single_option_line('support_material_pattern'); + $optgroup->append_single_option_line('support_material_with_sheath'); $optgroup->append_single_option_line('support_material_spacing'); $optgroup->append_single_option_line('support_material_angle'); $optgroup->append_single_option_line('support_material_interface_layers'); @@ -826,7 +827,7 @@ sub _update { my $have_support_material = $config->support_material || $config->raft_layers > 0; my $have_support_interface = $config->support_material_interface_layers > 0; $self->get_field($_)->toggle($have_support_material) - for qw(support_material_threshold support_material_pattern + for qw(support_material_threshold support_material_pattern support_material_with_sheath support_material_spacing support_material_angle support_material_interface_layers dont_support_bridges support_material_extrusion_width support_material_contact_distance); diff --git a/lib/Slic3r/Print/SupportMaterial.pm b/lib/Slic3r/Print/SupportMaterial.pm index b1e82f088..69acd3251 100644 --- a/lib/Slic3r/Print/SupportMaterial.pm +++ b/lib/Slic3r/Print/SupportMaterial.pm @@ -592,6 +592,7 @@ sub generate_toolpaths { # prepare fillers my $pattern = $self->object_config->support_material_pattern; + my $with_sheath = $self->object_config->support_material_with_sheath; my @angles = ($self->object_config->support_material_angle); if ($pattern eq 'rectilinear-grid') { $pattern = 'rectilinear'; @@ -791,7 +792,7 @@ sub generate_toolpaths { # use the proper spacing for first layer as we don't need to align # its pattern to the other layers $filler->spacing($base_flow->spacing); - } else { + } elsif ($with_sheath) { # draw a perimeter all around support infill # TODO: use brim ordering algorithm my $mm3_per_mm = $_flow->mm3_per_mm; diff --git a/slic3r.pl b/slic3r.pl index 573d01068..408ae4cb8 100755 --- a/slic3r.pl +++ b/slic3r.pl @@ -418,6 +418,9 @@ $j default: $config->{support_material_threshold}) --support-material-pattern Pattern to use for support material (default: $config->{support_material_pattern}) + --support-material-with-sheath + Add a sheath (a single perimeter line) around the base support. + This makes the support more reliable, but also more difficult to remove. (default: yes) --support-material-spacing Spacing between pattern lines (mm, default: $config->{support_material_spacing}) --support-material-angle diff --git a/xs/src/libslic3r/PrintConfig.cpp b/xs/src/libslic3r/PrintConfig.cpp index be5226fe3..90dfbff62 100644 --- a/xs/src/libslic3r/PrintConfig.cpp +++ b/xs/src/libslic3r/PrintConfig.cpp @@ -1219,6 +1219,13 @@ PrintConfigDef::PrintConfigDef() def->max = 90; def->default_value = new ConfigOptionInt(0); + def = this->add("support_material_with_sheath", coBool); + def->label = "With sheath around the support"; + def->category = "Support material"; + def->tooltip = "Add a sheath (a single perimeter line) around the base support. This makes the support more reliable, but also more difficult to remove."; + def->cli = "support-material-with-sheath!"; + def->default_value = new ConfigOptionBool(true); + def = this->add("temperature", coInts); def->label = "Other layers"; def->tooltip = "Extruder temperature for layers after the first one. Set this to zero to disable temperature control commands in the output."; diff --git a/xs/src/libslic3r/PrintConfig.hpp b/xs/src/libslic3r/PrintConfig.hpp index c459bf1c1..08d81eab4 100644 --- a/xs/src/libslic3r/PrintConfig.hpp +++ b/xs/src/libslic3r/PrintConfig.hpp @@ -158,6 +158,7 @@ class PrintObjectConfig : public virtual StaticPrintConfig ConfigOptionFloat support_material_spacing; ConfigOptionFloat support_material_speed; ConfigOptionInt support_material_threshold; + ConfigOptionBool support_material_with_sheath; ConfigOptionFloat xy_size_compensation; PrintObjectConfig(bool initialize = true) : StaticPrintConfig() { @@ -191,6 +192,7 @@ class PrintObjectConfig : public virtual StaticPrintConfig OPT_PTR(support_material_spacing); OPT_PTR(support_material_speed); OPT_PTR(support_material_threshold); + OPT_PTR(support_material_with_sheath); OPT_PTR(xy_size_compensation); return NULL; diff --git a/xs/src/libslic3r/PrintObject.cpp b/xs/src/libslic3r/PrintObject.cpp index 8b2b34ae0..97022a414 100644 --- a/xs/src/libslic3r/PrintObject.cpp +++ b/xs/src/libslic3r/PrintObject.cpp @@ -240,6 +240,7 @@ PrintObject::invalidate_state_by_config_options(const std::vector