diff --git a/src/libslic3r/Fill/Lightning/Generator.cpp b/src/libslic3r/Fill/Lightning/Generator.cpp index 6044f0f0a0..c638610aa5 100644 --- a/src/libslic3r/Fill/Lightning/Generator.cpp +++ b/src/libslic3r/Fill/Lightning/Generator.cpp @@ -89,9 +89,9 @@ Generator::Generator(const PrintObject &print_object, const std::function& contours, std //TODO: decide whether enable density controller in advanced options or not density = std::max(0.15f, density); m_supporting_radius = coord_t(m_infill_extrusion_width) / density; - + // Keep support-lightning behavior fixed and independent of user print-region angles. const double lightning_infill_overhang_angle = M_PI / 4; // 45 degrees const double lightning_infill_prune_angle = M_PI / 4; // 45 degrees const double lightning_infill_straightening_angle = M_PI / 4; // 45 degrees diff --git a/src/libslic3r/Preset.cpp b/src/libslic3r/Preset.cpp index 484283e5ea..0070bdcbd7 100644 --- a/src/libslic3r/Preset.cpp +++ b/src/libslic3r/Preset.cpp @@ -1005,6 +1005,9 @@ static std::vector s_Preset_print_options{ "lateral_lattice_angle_1", "lateral_lattice_angle_2", "infill_overhang_angle", + "lightning_overhang_angle", + "lightning_prune_angle", + "lightning_straightening_angle", "top_surface_pattern", "bottom_surface_pattern", "infill_direction", diff --git a/src/libslic3r/PrintConfig.cpp b/src/libslic3r/PrintConfig.cpp index 552a884fd9..539add1bce 100644 --- a/src/libslic3r/PrintConfig.cpp +++ b/src/libslic3r/PrintConfig.cpp @@ -3047,6 +3047,36 @@ void PrintConfigDef::init_fff_params() def->mode = comAdvanced; def->set_default_value(new ConfigOptionFloat(60)); + def = this->add("lightning_overhang_angle", coFloat); + def->label = L("Lightning overhang angle"); + def->category = L("Strength"); + def->tooltip = L("Maximum overhang angle for Lightning infill support propagation."); + def->sidetext = u8"°"; + def->min = 5; + def->max = 85; + def->mode = comExpert; + def->set_default_value(new ConfigOptionFloat(45)); + + def = this->add("lightning_prune_angle", coFloat); + def->label = L("Prune angle"); + def->category = L("Strength"); + def->tooltip = L("Controls how aggressively short or unsupported Lightning branches are pruned. This angle is converted internally to a per-layer distance."); + def->sidetext = u8"°"; + def->min = 5; + def->max = 85; + def->mode = comExpert; + def->set_default_value(new ConfigOptionFloat(45)); + + def = this->add("lightning_straightening_angle", coFloat); + def->label = L("Straightening angle"); + def->category = L("Strength"); + def->tooltip = L("Maximum straightening angle used to simplify Lightning branches."); + def->sidetext = u8"°"; + def->min = 5; + def->max = 85; + def->mode = comExpert; + def->set_default_value(new ConfigOptionFloat(45)); + auto def_infill_anchor_min = def = this->add("infill_anchor", coFloatOrPercent); def->label = L("Sparse infill anchor length"); def->category = L("Strength"); diff --git a/src/libslic3r/PrintConfig.hpp b/src/libslic3r/PrintConfig.hpp index bb3051f7fa..aae20833d4 100644 --- a/src/libslic3r/PrintConfig.hpp +++ b/src/libslic3r/PrintConfig.hpp @@ -1103,6 +1103,9 @@ PRINT_CONFIG_CLASS_DEFINE( ((ConfigOptionFloat, lateral_lattice_angle_1)) ((ConfigOptionFloat, lateral_lattice_angle_2)) ((ConfigOptionFloat, infill_overhang_angle)) + ((ConfigOptionFloat, lightning_overhang_angle)) + ((ConfigOptionFloat, lightning_prune_angle)) + ((ConfigOptionFloat, lightning_straightening_angle)) ((ConfigOptionBool, align_infill_direction_to_model)) ((ConfigOptionString, extra_solid_infills)) ((ConfigOptionEnum, fuzzy_skin)) diff --git a/src/libslic3r/PrintObject.cpp b/src/libslic3r/PrintObject.cpp index 5449f7df3a..65d624be46 100644 --- a/src/libslic3r/PrintObject.cpp +++ b/src/libslic3r/PrintObject.cpp @@ -1300,6 +1300,9 @@ bool PrintObject::invalidate_state_by_config_options( || opt_key == "infill_shift_step" || opt_key == "sparse_infill_rotate_template" || opt_key == "solid_infill_rotate_template" + || opt_key == "lightning_overhang_angle" + || opt_key == "lightning_prune_angle" + || opt_key == "lightning_straightening_angle" || opt_key == "skeleton_infill_density" || opt_key == "skin_infill_density" || opt_key == "infill_lock_depth" diff --git a/src/slic3r/GUI/ConfigManipulation.cpp b/src/slic3r/GUI/ConfigManipulation.cpp index 49b4410d18..1e5b350039 100644 --- a/src/slic3r/GUI/ConfigManipulation.cpp +++ b/src/slic3r/GUI/ConfigManipulation.cpp @@ -961,6 +961,10 @@ void ConfigManipulation::toggle_print_fff_options(DynamicPrintConfig *config, co bool lattice_options = config->opt_enum("sparse_infill_pattern") == InfillPattern::ipLateralLattice; for (auto el : { "lateral_lattice_angle_1", "lateral_lattice_angle_2"}) toggle_line(el, lattice_options); + + bool lightning_options = config->opt_enum("sparse_infill_pattern") == InfillPattern::ipLightning; + for (auto el : { "lightning_overhang_angle", "lightning_prune_angle", "lightning_straightening_angle" }) + toggle_line(el, lightning_options); // Adaptative Cubic and support cubic infill patterns do not support infill rotation. bool FillAdaptive = (pattern == InfillPattern::ipAdaptiveCubic || pattern == InfillPattern::ipSupportCubic); diff --git a/src/slic3r/GUI/GUI_Factories.cpp b/src/slic3r/GUI/GUI_Factories.cpp index 2b128eb85a..357c39e47a 100644 --- a/src/slic3r/GUI/GUI_Factories.cpp +++ b/src/slic3r/GUI/GUI_Factories.cpp @@ -126,6 +126,9 @@ std::map> SettingsFactory::PART_CATE {"lateral_lattice_angle_1", "", 1}, {"lateral_lattice_angle_2", "", 1}, {"infill_overhang_angle", "", 1}, + {"lightning_overhang_angle", "", 1}, + {"lightning_prune_angle", "", 1}, + {"lightning_straightening_angle", "", 1}, {"infill_anchor", "", 1}, {"infill_anchor_max", "", 1}, {"top_surface_pattern", "", 1}, diff --git a/src/slic3r/GUI/Tab.cpp b/src/slic3r/GUI/Tab.cpp index 5a6c909877..2d6b2d385c 100644 --- a/src/slic3r/GUI/Tab.cpp +++ b/src/slic3r/GUI/Tab.cpp @@ -2482,6 +2482,9 @@ void TabPrint::build() optgroup->append_single_option_line("lateral_lattice_angle_1", "strength_settings_patterns#lateral-lattice"); optgroup->append_single_option_line("lateral_lattice_angle_2", "strength_settings_patterns#lateral-lattice"); optgroup->append_single_option_line("infill_overhang_angle", "strength_settings_patterns#lateral-honeycomb"); + optgroup->append_single_option_line("lightning_overhang_angle", "strength_settings_patterns#lightning-infill"); + optgroup->append_single_option_line("lightning_prune_angle", "strength_settings_patterns#lightning-infill"); + optgroup->append_single_option_line("lightning_straightening_angle", "strength_settings_patterns#lightning-infill"); optgroup->append_single_option_line("infill_anchor_max", "strength_settings_infill#anchor"); optgroup->append_single_option_line("infill_anchor", "strength_settings_infill#anchor"); optgroup->append_single_option_line("internal_solid_infill_pattern", "strength_settings_infill#internal-solid-infill");