From bb22f1dc8a73b782564ae2b8eb6d5f6b30f89a10 Mon Sep 17 00:00:00 2001 From: slicer-builder Date: Sat, 19 Mar 2016 22:30:02 -0500 Subject: [PATCH] prototyping tweakable XY supports; option should be present now in advanced support menu. Can't figure out what's going on atm; support should be moving but isn't --- lib/Slic3r/GUI/Tab.pm | 2 ++ lib/Slic3r/Print/SupportMaterial.pm | 7 ++++--- slic3r.pl | 3 +++ xs/src/libslic3r/PrintConfig.cpp | 7 +++++++ xs/src/libslic3r/PrintConfig.hpp | 2 ++ xs/src/libslic3r/PrintObject.cpp | 1 + 6 files changed, 19 insertions(+), 3 deletions(-) diff --git a/lib/Slic3r/GUI/Tab.pm b/lib/Slic3r/GUI/Tab.pm index 8bb06c63d..3cf914862 100644 --- a/lib/Slic3r/GUI/Tab.pm +++ b/lib/Slic3r/GUI/Tab.pm @@ -523,6 +523,7 @@ sub build { max_volumetric_extrusion_rate_slope_positive max_volumetric_extrusion_rate_slope_negative perimeter_speed small_perimeter_speed external_perimeter_speed infill_speed solid_infill_speed top_solid_infill_speed support_material_speed + support_material_xy_spacing support_material_interface_speed bridge_speed gap_fill_speed travel_speed first_layer_speed @@ -648,6 +649,7 @@ sub build { $optgroup->append_single_option_line('support_material_interface_spacing'); $optgroup->append_single_option_line('support_material_interface_contact_loops'); $optgroup->append_single_option_line('support_material_buildplate_only'); + $optgroup->append_single_option_line('support_material_xy_spacing'); $optgroup->append_single_option_line('dont_support_bridges'); $optgroup->append_single_option_line('support_material_synchronize_layers'); } diff --git a/lib/Slic3r/Print/SupportMaterial.pm b/lib/Slic3r/Print/SupportMaterial.pm index e8b3a1316..72f09269f 100644 --- a/lib/Slic3r/Print/SupportMaterial.pm +++ b/lib/Slic3r/Print/SupportMaterial.pm @@ -372,7 +372,7 @@ sub object_top { # grow top surfaces so that interface and support generation are generated # with some spacing from object - it looks we don't need the actual # top shapes so this can be done here - $top{ $layer->print_z } = offset($touching, $self->flow->scaled_width + ($self->object_config->support_material_xy_spacing / 0.000001) ); + $top{ $layer->print_z } = offset($touching, $self->flow->scaled_width + $self->object_config->support_material_xy_spacing); } # remove the areas that touched from the projection that will continue on @@ -624,10 +624,11 @@ sub clip_with_object { # $layer->slices contains the full shape of layer, thus including # perimeter's width. $support contains the full shape of support # material, thus including the width of its foremost extrusion. - # We leave a gap equal to a full extrusion width. + # We leave a gap equal to a full extrusion width + an offset + # if the user wants to play around with this setting. $support->{$i} = diff( $support->{$i}, - offset([ map @$_, map @{$_->slices}, @layers ], +($self->flow->scaled_width +($self->object_config->support_material_xy_spacing / 0.000001))), + offset([ map @$_, map @{$_->slices}, @layers ], +$self->object_config->support_material_xy_spacing), ); } } diff --git a/slic3r.pl b/slic3r.pl index f6fe4bb4f..651efa483 100755 --- a/slic3r.pl +++ b/slic3r.pl @@ -426,6 +426,9 @@ $j Support material angle in degrees (range: 0-90, default: $config->{support_material_angle}) --support-material-contact-distance Vertical distance between object and support material (0+, default: $config->{support_material_contact_distance}) + + --support-material-xy-spacing + horizontal distance between object and support material (0+, default: $config->{support_material_xy_spacing}) --support-material-interface-layers Number of perpendicular layers between support material and object (0+, default: $config->{support_material_interface_layers}) --support-material-interface-spacing diff --git a/xs/src/libslic3r/PrintConfig.cpp b/xs/src/libslic3r/PrintConfig.cpp index 25f0c626f..c530b30aa 100644 --- a/xs/src/libslic3r/PrintConfig.cpp +++ b/xs/src/libslic3r/PrintConfig.cpp @@ -1121,6 +1121,13 @@ PrintConfigDef::PrintConfigDef() def->cli = "support-material!"; def->default_value = new ConfigOptionBool(false); + def = this->add("support_material_xy_spacing", coFloat); + def->label = "Extra separation between part and support (mm)"; + def->category = "Support material"; + def->tooltip = "Add offset to support material separation (0 is 1 extrusion width)."; + def->cli = "support-material-xy-spacing=f"; + def->default_value = new ConfigOptionFloat(0.0); + def = this->add("support_material_angle", coInt); def->label = "Pattern angle"; def->category = "Support material"; diff --git a/xs/src/libslic3r/PrintConfig.hpp b/xs/src/libslic3r/PrintConfig.hpp index 8e66d1482..c14889c88 100644 --- a/xs/src/libslic3r/PrintConfig.hpp +++ b/xs/src/libslic3r/PrintConfig.hpp @@ -164,6 +164,7 @@ class PrintObjectConfig : public virtual StaticPrintConfig ConfigOptionBool support_material_synchronize_layers; ConfigOptionInt support_material_threshold; ConfigOptionBool support_material_with_sheath; + ConfigOptionFloat support_material_xy_spacing; ConfigOptionFloat xy_size_compensation; PrintObjectConfig(bool initialize = true) : StaticPrintConfig() { @@ -198,6 +199,7 @@ class PrintObjectConfig : public virtual StaticPrintConfig OPT_PTR(support_material_spacing); OPT_PTR(support_material_speed); OPT_PTR(support_material_synchronize_layers); + OPT_PTR(support_material_xy_spacing); OPT_PTR(support_material_threshold); OPT_PTR(support_material_with_sheath); OPT_PTR(xy_size_compensation); diff --git a/xs/src/libslic3r/PrintObject.cpp b/xs/src/libslic3r/PrintObject.cpp index 93a924b1d..c323f5d9d 100644 --- a/xs/src/libslic3r/PrintObject.cpp +++ b/xs/src/libslic3r/PrintObject.cpp @@ -221,6 +221,7 @@ PrintObject::invalidate_state_by_config_options(const std::vector