overhangs_width threshold #99

This commit is contained in:
supermerill 2019-10-14 17:31:26 +02:00
parent 60d2ddde55
commit fd26796cb1
6 changed files with 37 additions and 19 deletions

View File

@ -121,23 +121,26 @@ void Layer::make_perimeters()
for (LayerRegionPtrs::const_iterator it = layerm + 1; it != m_regions.end(); ++it) {
LayerRegion* other_layerm = *it;
const PrintRegionConfig &other_config = other_layerm->region()->config();
//FIXME get this list from the menu list itself to avoid duplication
// also, this list is TOO SHORT
/// !!! add here the settings you want to be added in the per-object menu.
/// if you don't do that, objects will share the same region, and the same settings.
if (config.perimeter_extruder == other_config.perimeter_extruder
&& config.perimeters == other_config.perimeters
&& config.only_one_perimeter_top == other_config.only_one_perimeter_top
&& config.perimeter_speed == other_config.perimeter_speed
&& config.external_perimeter_speed == other_config.external_perimeter_speed
&& config.gap_fill_speed == other_config.gap_fill_speed
&& config.overhangs == other_config.overhangs
&& config.opt_serialize("perimeter_extrusion_width") == other_config.opt_serialize("perimeter_extrusion_width")
if (config.perimeter_extruder == other_config.perimeter_extruder
&& config.perimeters == other_config.perimeters
&& config.only_one_perimeter_top == other_config.only_one_perimeter_top
&& config.perimeter_speed == other_config.perimeter_speed
&& config.external_perimeter_speed == other_config.external_perimeter_speed
&& config.gap_fill_speed == other_config.gap_fill_speed
&& config.overhangs == other_config.overhangs
&& config.overhangs_width == other_config.overhangs_width
&& config.opt_serialize("perimeter_extrusion_width").compare(other_config.opt_serialize("perimeter_extrusion_width")) == 0
&& config.opt_serialize("external_perimeter_extrusion_width").compare(other_config.opt_serialize("external_perimeter_extrusion_width")) == 0
&& config.thin_walls == other_config.thin_walls
&& config.thin_walls_min_width == other_config.thin_walls_min_width
&& config.thin_walls_overlap == other_config.thin_walls_overlap
&& config.thin_walls == other_config.thin_walls
&& config.thin_walls_min_width == other_config.thin_walls_min_width
&& config.thin_walls_overlap == other_config.thin_walls_overlap
&& config.external_perimeters_first == other_config.external_perimeters_first
&& config.infill_overlap == other_config.infill_overlap
&& config.perimeter_loop == other_config.perimeter_loop) {
&& config.infill_overlap == other_config.infill_overlap
&& config.perimeter_loop == other_config.perimeter_loop) {
layerms.push_back(other_layerm);
done[it - m_regions.begin()] = true;
}

View File

@ -72,7 +72,7 @@ void PerimeterGenerator::process()
// We consider overhang any part where the entire nozzle diameter is not supported by the
// lower layer, so we take lower slices and offset them by half the nozzle diameter used
// in the current layer
this->_lower_slices_p = offset(*this->lower_slices, double(scale_(+nozzle_diameter/2)));
this->_lower_slices_p = offset(*this->lower_slices, double(scale_(config->overhangs_width.get_abs_value(nozzle_diameter))));
}
// we need to process each island separately because we might have different

View File

@ -1800,13 +1800,22 @@ void PrintConfigDef::init_fff_params()
def->set_default_value(new ConfigOptionString("[input_filename_base].gcode"));
def = this->add("overhangs", coBool);
def->label = L("Detect bridging perimeters");
def->label = L("As bridge");
def->full_label = L("Overhangs as bridge");
def->category = L("Layers and Perimeters");
def->tooltip = L("Experimental option to adjust flow for overhangs (bridge flow will be used), "
def->tooltip = L("Option to adjust flow for overhangs (bridge flow will be used), "
"to apply bridge speed to them and enable fan.");
def->mode = comAdvanced;
def->mode = comExpert;
def->set_default_value(new ConfigOptionBool(true));
def = this->add("overhangs_width", coFloatOrPercent);
def->label = L("Threshold");
def->full_label = L("Overhang Threshold");
def->category = L("Layers and Perimeters");
def->tooltip = L("Minimum unsupported width for an extrusion to be considered an overhang. Can be in mm or in a % of the nozzle diameter.");
def->mode = comExpert;
def->set_default_value(new ConfigOptionFloatOrPercent(50, true));
def = this->add("no_perimeter_unsupported_algo", coEnum);
def->label = L("No perimeters on bridge areas");
def->tooltip = L("Experimental option to remove perimeters where there is nothing under it and where a bridged infill should be better. "

View File

@ -607,6 +607,7 @@ public:
ConfigOptionBool infill_first;
// Detect bridging perimeters
ConfigOptionBool overhangs;
ConfigOptionFloatOrPercent overhangs_width;
ConfigOptionEnum<NoPerimeterUnsupportedAlgo> no_perimeter_unsupported_algo;
ConfigOptionInt perimeter_extruder;
ConfigOptionFloatOrPercent perimeter_extrusion_width;
@ -672,6 +673,7 @@ protected:
OPT_PTR(infill_dense_algo);
OPT_PTR(infill_first);
OPT_PTR(overhangs);
OPT_PTR(overhangs_width);
OPT_PTR(no_perimeter_unsupported_algo);
OPT_PTR(perimeter_extruder);
OPT_PTR(perimeter_extrusion_width);

View File

@ -380,6 +380,7 @@ 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",
"overhangs_width",
"seam_position", "external_perimeters_first", "fill_density"
, "fill_pattern"
, "fill_top_flow_ratio"

View File

@ -1060,7 +1060,10 @@ void TabPrint::build()
line.append_option(optgroup->get_option("thin_walls_min_width"));
line.append_option(optgroup->get_option("thin_walls_overlap"));
optgroup->append_line(line);
optgroup->append_single_option_line("overhangs");
line = { _(L("Overhangs")), "" };
line.append_option(optgroup->get_option("overhangs"));
line.append_option(optgroup->get_option("overhangs_width"));
optgroup->append_line(line);
optgroup->append_single_option_line("no_perimeter_unsupported_algo");
optgroup = page->new_optgroup(_(L("Advanced")));