From f1fdcf424390395d064b25bdbf9683ed1aae0031 Mon Sep 17 00:00:00 2001 From: supermerill Date: Tue, 18 Aug 2020 01:14:07 +0200 Subject: [PATCH] #280 new setting: fill_angle_increment. rotate every infill by this angle, multiplied by the layer id. --- resources/ui_layout/print.ui | 1 + src/libslic3r/Fill/Fill.cpp | 1 + src/libslic3r/PrintConfig.cpp | 13 +++++++++++++ src/libslic3r/PrintConfig.hpp | 2 ++ src/libslic3r/PrintObject.cpp | 1 + src/slic3r/GUI/Preset.cpp | 5 ++++- 6 files changed, 22 insertions(+), 1 deletion(-) diff --git a/resources/ui_layout/print.ui b/resources/ui_layout/print.ui index 8e1e148dc..c02eaf7c4 100644 --- a/resources/ui_layout/print.ui +++ b/resources/ui_layout/print.ui @@ -123,6 +123,7 @@ group:sidetext_width$3:Advanced line:Angle setting:label_width$6:width$5:fill_angle setting:label_width$6:width$5:bridge_angle + setting:label_width$6:width$5:label$increment:fill_angle_increment end_line line:Anchor solid infill by X mm setting:label_width$6:width$5:external_infill_margin diff --git a/src/libslic3r/Fill/Fill.cpp b/src/libslic3r/Fill/Fill.cpp index 571eefa0c..c12a51dcf 100644 --- a/src/libslic3r/Fill/Fill.cpp +++ b/src/libslic3r/Fill/Fill.cpp @@ -303,6 +303,7 @@ void make_fill(LayerRegion &layerm, ExtrusionEntityCollection &out) f->z = layerm.layer()->print_z; if (is_denser)f->angle = 0; else f->angle = float(Geometry::deg2rad(layerm.region()->config().fill_angle.value)); + f->angle += PI * (layerm.region()->config().fill_angle_increment.value * layerm.layer()->id()) / 180.; // Maximum length of the perimeter segment linking two infill lines. f->link_max_length = (coord_t)scale_(link_max_length); // Used by the concentric infill pattern to clip the loops to create extrusion paths. diff --git a/src/libslic3r/PrintConfig.cpp b/src/libslic3r/PrintConfig.cpp index fd9269b6f..0bd3f4449 100644 --- a/src/libslic3r/PrintConfig.cpp +++ b/src/libslic3r/PrintConfig.cpp @@ -1329,6 +1329,19 @@ void PrintConfigDef::init_fff_params() def->mode = comAdvanced; def->set_default_value(new ConfigOptionFloat(45)); + def = this->add("fill_angle_increment", coFloat); + def->label = L("Fill"); + def->full_label = L("Fill angle increment"); + def->category = OptionCategory::infill; + def->tooltip = L("Add this angle each layer to the base angle for infill. " + "May be useful for art, or to be sure to hit every object's feature even with very low infill. " + "Still experiemental, tell me what makes it useful, or the problems that arise using it."); + def->sidetext = L("°"); + def->min = 0; + def->max = 360; + def->mode = comAdvanced; + def->set_default_value(new ConfigOptionFloat(0)); + def = this->add("fill_density", coPercent); def->gui_type = "f_enum_open"; def->gui_flags = "show_value"; diff --git a/src/libslic3r/PrintConfig.hpp b/src/libslic3r/PrintConfig.hpp index 7136a4a23..1aabf312c 100644 --- a/src/libslic3r/PrintConfig.hpp +++ b/src/libslic3r/PrintConfig.hpp @@ -639,6 +639,7 @@ public: ConfigOptionBool extra_perimeters_overhangs; ConfigOptionBool only_one_perimeter_top; ConfigOptionFloat fill_angle; + ConfigOptionFloat fill_angle_increment; ConfigOptionPercent fill_density; ConfigOptionEnum fill_pattern; ConfigOptionPercent fill_top_flow_ratio; @@ -726,6 +727,7 @@ protected: OPT_PTR(extra_perimeters_overhangs); OPT_PTR(only_one_perimeter_top); OPT_PTR(fill_angle); + OPT_PTR(fill_angle_increment); OPT_PTR(fill_density); OPT_PTR(fill_pattern); OPT_PTR(fill_top_flow_ratio); diff --git a/src/libslic3r/PrintObject.cpp b/src/libslic3r/PrintObject.cpp index e5f6f9482..53d20a2e2 100644 --- a/src/libslic3r/PrintObject.cpp +++ b/src/libslic3r/PrintObject.cpp @@ -709,6 +709,7 @@ bool PrintObject::invalidate_state_by_config_options(const std::vector& Preset::print_options() , "top_fill_pattern" , "bottom_fill_pattern" , "solid_fill_pattern", - "infill_every_layers", "infill_only_where_needed", "solid_infill_every_layers", "fill_angle", "bridge_angle", + "infill_every_layers", "infill_only_where_needed", "solid_infill_every_layers", + "fill_angle", + "fill_angle_increment", + "bridge_angle", "solid_infill_below_area", "only_retract_when_crossing_perimeters", "infill_first", "max_print_speed", "max_volumetric_speed",