alternate extra wall: on odd layers

#89
This commit is contained in:
supermerill 2019-10-29 19:11:30 +01:00
parent 4229e489fa
commit 004ec5480d
8 changed files with 31 additions and 12 deletions

View File

@ -273,9 +273,10 @@ void PerimeterGenerator::process()
}
surface_idx = 0;
const int extra_odd_perimeter = (config->extra_perimeters_odd_layers && layer_id % 2 == 1 ? 1:0);
for (const Surface &surface : all_surfaces) {
// detect how many perimeters must be generated for this island
int loop_number = this->config->perimeters + surface.extra_perimeters - 1; // 0-indexed loops
int loop_number = this->config->perimeters + surface.extra_perimeters - 1 + extra_odd_perimeter; // 0-indexed loops
surface_idx++;
if (this->config->only_one_perimeter_top && this->upper_slices == NULL){

View File

@ -622,14 +622,24 @@ void PrintConfigDef::init_fff_params()
def->set_default_value(new ConfigOptionEnum<SeamPosition>(spRear));
def = this->add("extra_perimeters", coBool);
def->label = L("Extra perimeters if needed");
def->label = L("filling horizontal gaps on slopes");
def->full_label = L("Extra perimeters if needed");
def->category = L("Layers and Perimeters");
def->tooltip = L("Add more perimeters when needed for avoiding gaps in sloping walls. "
"Slic3r keeps adding perimeters, until more than 70% of the loop immediately above "
"is supported, and keep adding periemter until all overhangs are filled."
"\n!! this is a very slow algorithm !!");
def->mode = comAdvanced;
def->set_default_value(new ConfigOptionBool(true));
def->set_default_value(new ConfigOptionBool(false));
def = this->add("extra_perimeters_odd_layers", coBool);
def->label = L("on odd layers");
def->full_label = L("Extra perimeter on odd layers");
def->category = L("Layers and Perimeters");
def->tooltip = L("Add one perimeter every odd layer. With this, infill is taken into sandwitch"
" and you may be able to reduce drastically the infill/perimeter overlap setting. ");
def->mode = comAdvanced;
def->set_default_value(new ConfigOptionBool(false));
def = this->add("only_one_perimeter_top", coBool);
def->label = "Only one perimeter on Top surfaces";

View File

@ -587,6 +587,7 @@ public:
ConfigOptionFloatOrPercent external_perimeter_speed;
ConfigOptionBool external_perimeters_first;
ConfigOptionBool extra_perimeters;
ConfigOptionBool extra_perimeters_odd_layers;
ConfigOptionBool only_one_perimeter_top;
ConfigOptionFloat fill_angle;
ConfigOptionPercent fill_density;
@ -655,6 +656,7 @@ protected:
OPT_PTR(external_perimeter_speed);
OPT_PTR(external_perimeters_first);
OPT_PTR(extra_perimeters);
OPT_PTR(extra_perimeters_odd_layers);
OPT_PTR(only_one_perimeter_top);
OPT_PTR(fill_angle);
OPT_PTR(fill_density);

View File

@ -472,6 +472,7 @@ bool PrintObject::invalidate_state_by_config_options(const std::vector<t_config_
for (const t_config_option_key &opt_key : opt_keys) {
if ( opt_key == "perimeters"
|| opt_key == "extra_perimeters"
|| opt_key == "extra_perimeters_odd_layers"
|| opt_key == "gap_fill"
|| opt_key == "gap_fill_speed"
|| opt_key == "overhangs"

View File

@ -241,7 +241,7 @@ void ConfigManipulation::update_print_fff_config(DynamicPrintConfig* config, con
void ConfigManipulation::toggle_print_fff_options(DynamicPrintConfig* config)
{
bool have_perimeters = config->opt_int("perimeters") > 0;
for (auto el : { "extra_perimeters", "only_one_perimeter_top", "ensure_vertical_shell_thickness", "thin_walls", "overhangs",
for (auto el : { "extra_perimeters", "extra_perimeters_odd_layers", "only_one_perimeter_top", "ensure_vertical_shell_thickness", "thin_walls", "overhangs",
"seam_position", "external_perimeters_first", "external_perimeter_extrusion_width",
"perimeter_speed", "small_perimeter_speed", "external_perimeter_speed", "perimeter_loop", "perimeter_loop_seam" })
toggle_field(el, have_perimeters);

View File

@ -379,7 +379,9 @@ const std::vector<std::string>& Preset::print_options()
{
static std::vector<std::string> s_opts {
"layer_height", "first_layer_height", "perimeters", "spiral_vase", "slice_closing_radius", "top_solid_layers", "bottom_solid_layers",
"extra_perimeters", "only_one_perimeter_top", "ensure_vertical_shell_thickness", "avoid_crossing_perimeters", "thin_walls", "overhangs",
"extra_perimeters",
"extra_perimeters_odd_layers",
"only_one_perimeter_top", "ensure_vertical_shell_thickness", "avoid_crossing_perimeters", "thin_walls", "overhangs",
"overhangs_width",
"seam_position", "external_perimeters_first", "fill_density"
, "fill_pattern"

View File

@ -267,7 +267,7 @@ std::string PresetHints::recommended_thin_wall_thickness(const PresetBundle &pre
if (num_perimeters > 0) {
int num_lines = std::min(num_perimeters * 2, 10);
out += (boost::format(_utf8(L("Recommended object min thin wall thickness for layer height %.2f and"))) % layer_height).str() + " ";
out += (boost::format(_utf8(L("Recommended object min wall thickness for layer height %.2f and"))) % layer_height).str() + " ";
// Start with the width of two closely spaced
double width = external_perimeter_flow.width + external_perimeter_flow.spacing();
for (int i = 2; i <= num_lines; thin_walls ? ++ i : i += 2) {

View File

@ -1051,7 +1051,10 @@ void TabPrint::build()
optgroup->append_single_option_line("enforce_full_fill_volume");
optgroup = page->new_optgroup(_(L("Quality (slower slicing)")));
optgroup->append_single_option_line("extra_perimeters");
line = { _(L("Extra perimeters")), "" };
line.append_option(optgroup->get_option("extra_perimeters"));
line.append_option(optgroup->get_option("extra_perimeters_odd_layers"));
optgroup->append_line(line);
optgroup->append_single_option_line("only_one_perimeter_top");
optgroup->append_single_option_line("ensure_vertical_shell_thickness");
optgroup->append_single_option_line("avoid_crossing_perimeters");