Internal Bridge Flow rate parameter introduction (#2859)

* Internal Bridge Flow rate parameter introduction

* updated incorrect capitalisation

* Updated parameter ordering
This commit is contained in:
Ioannis Giannakas 2023-11-26 13:43:47 +00:00 committed by GitHub
parent cd35995402
commit ce9a8d7b20
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
8 changed files with 24 additions and 6 deletions

View file

@ -487,7 +487,7 @@ std::vector<SurfaceFill> group_fills(const Layer &layer)
params.bridge = is_bridge || Fill::use_bridge_flow(params.pattern); params.bridge = is_bridge || Fill::use_bridge_flow(params.pattern);
params.flow = params.bridge ? params.flow = params.bridge ?
//BBS: always enable thick bridge for internal bridge //BBS: always enable thick bridge for internal bridge
layerm.bridging_flow(extrusion_role, (surface.is_bridge() && !surface.is_external()) || object_config.thick_bridges) : layerm.bridging_flow(extrusion_role, (surface.is_bridge() && !surface.is_external()) || object_config.thick_bridges, params.extrusion_role == erInternalBridgeInfill) :
layerm.flow(extrusion_role, (surface.thickness == -1) ? layer.height : surface.thickness); layerm.flow(extrusion_role, (surface.thickness == -1) ? layer.height : surface.thickness);
// Calculate flow spacing for infill pattern generation. // Calculate flow spacing for infill pattern generation.

View file

@ -72,7 +72,7 @@ public:
Flow flow(FlowRole role) const; Flow flow(FlowRole role) const;
Flow flow(FlowRole role, double layer_height) const; Flow flow(FlowRole role, double layer_height) const;
Flow bridging_flow(FlowRole role, bool thick_bridge = false) const; Flow bridging_flow(FlowRole role, bool thick_bridge = false, bool internal_bridge = false) const;
void slices_to_fill_surfaces_clipped(); void slices_to_fill_surfaces_clipped();
void prepare_fill_surfaces(); void prepare_fill_surfaces();

View file

@ -32,14 +32,16 @@ Flow LayerRegion::flow(FlowRole role, double layer_height) const
return m_region->flow(*m_layer->object(), role, layer_height, m_layer->id() == 0); return m_region->flow(*m_layer->object(), role, layer_height, m_layer->id() == 0);
} }
Flow LayerRegion::bridging_flow(FlowRole role, bool thick_bridge) const Flow LayerRegion::bridging_flow(FlowRole role, bool thick_bridge, bool internal_bridge) const
{ {
const PrintRegion &region = this->region(); const PrintRegion &region = this->region();
const PrintRegionConfig &region_config = region.config(); const PrintRegionConfig &region_config = region.config();
const PrintObject &print_object = *this->layer()->object(); const PrintObject &print_object = *this->layer()->object();
Flow bridge_flow; Flow bridge_flow;
auto nozzle_diameter = float(print_object.print()->config().nozzle_diameter.get_at(region.extruder(role) - 1)); auto nozzle_diameter = float(print_object.print()->config().nozzle_diameter.get_at(region.extruder(role) - 1));
if (thick_bridge) { if(internal_bridge) { // internal bridge is using the thick bridge logic with the internal bridge flow ratio
bridge_flow = Flow::bridging_flow(float(sqrt(region_config.internal_bridge_flow)) * nozzle_diameter, nozzle_diameter);
} else if (thick_bridge) {
// The old Slic3r way (different from all other slicers): Use rounded extrusions. // The old Slic3r way (different from all other slicers): Use rounded extrusions.
// Get the configured nozzle_diameter for the extruder associated to the flow role requested. // Get the configured nozzle_diameter for the extruder associated to the flow role requested.
// Here this->extruder(role) - 1 may underflow to MAX_INT, but then the get_at() will follback to zero'th element, so everything is all right. // Here this->extruder(role) - 1 may underflow to MAX_INT, but then the get_at() will follback to zero'th element, so everything is all right.

View file

@ -749,7 +749,7 @@ static std::vector<std::string> s_Preset_print_options {
"sparse_infill_filament", "solid_infill_filament", "support_filament", "support_interface_filament", "sparse_infill_filament", "solid_infill_filament", "support_filament", "support_interface_filament",
"ooze_prevention", "standby_temperature_delta", "interface_shells", "line_width", "initial_layer_line_width", "ooze_prevention", "standby_temperature_delta", "interface_shells", "line_width", "initial_layer_line_width",
"inner_wall_line_width", "outer_wall_line_width", "sparse_infill_line_width", "internal_solid_infill_line_width", "inner_wall_line_width", "outer_wall_line_width", "sparse_infill_line_width", "internal_solid_infill_line_width",
"top_surface_line_width", "support_line_width", "infill_wall_overlap", "bridge_flow", "top_surface_line_width", "support_line_width", "infill_wall_overlap", "bridge_flow", "internal_bridge_flow",
"elefant_foot_compensation", "elefant_foot_compensation_layers", "xy_contour_compensation", "xy_hole_compensation", "resolution", "enable_prime_tower", "elefant_foot_compensation", "elefant_foot_compensation_layers", "xy_contour_compensation", "xy_hole_compensation", "resolution", "enable_prime_tower",
"prime_tower_width", "prime_tower_brim_width", "prime_volume", "prime_tower_width", "prime_tower_brim_width", "prime_volume",
"wipe_tower_no_sparse_layers", "compatible_printers", "compatible_printers_condition", "inherits", "wipe_tower_no_sparse_layers", "compatible_printers", "compatible_printers_condition", "inherits",

View file

@ -776,6 +776,15 @@ void PrintConfigDef::init_fff_params()
def->mode = comAdvanced; def->mode = comAdvanced;
def->set_default_value(new ConfigOptionFloat(1)); def->set_default_value(new ConfigOptionFloat(1));
def = this->add("internal_bridge_flow", coFloat);
def->label = L("Internal bridge flow");
def->category = L("Quality");
def->tooltip = L("This value governs the thickness of the internal bridge layer. This is the first layer over sparse infill. Decrease this value slightly (for example 0.9) to improve surface quality over sparse infill.");
def->min = 0;
def->max = 2.0;
def->mode = comAdvanced;
def->set_default_value(new ConfigOptionFloat(1));
def = this->add("top_solid_infill_flow_ratio", coFloat); def = this->add("top_solid_infill_flow_ratio", coFloat);
def->label = L("Top surface flow ratio"); def->label = L("Top surface flow ratio");
def->category = L("Advanced"); def->category = L("Advanced");
@ -5711,6 +5720,11 @@ std::map<std::string, std::string> validate(const FullPrintConfig &cfg, bool und
error_message.emplace("bridge_flow", L("invalid value ") + std::to_string(cfg.bridge_flow)); error_message.emplace("bridge_flow", L("invalid value ") + std::to_string(cfg.bridge_flow));
} }
// --bridge-flow-ratio
if (cfg.bridge_flow <= 0) {
error_message.emplace("internal_bridge_flow", L("invalid value ") + std::to_string(cfg.internal_bridge_flow));
}
// extruder clearance // extruder clearance
if (cfg.extruder_clearance_radius <= 0) { if (cfg.extruder_clearance_radius <= 0) {
error_message.emplace("extruder_clearance_radius", L("invalid value ") + std::to_string(cfg.extruder_clearance_radius)); error_message.emplace("extruder_clearance_radius", L("invalid value ") + std::to_string(cfg.extruder_clearance_radius));

View file

@ -796,6 +796,7 @@ PRINT_CONFIG_CLASS_DEFINE(
((ConfigOptionFloat, bottom_shell_thickness)) ((ConfigOptionFloat, bottom_shell_thickness))
((ConfigOptionFloat, bridge_angle)) ((ConfigOptionFloat, bridge_angle))
((ConfigOptionFloat, bridge_flow)) ((ConfigOptionFloat, bridge_flow))
((ConfigOptionFloat, internal_bridge_flow))
((ConfigOptionFloat, bridge_speed)) ((ConfigOptionFloat, bridge_speed))
((ConfigOptionFloatOrPercent, internal_bridge_speed)) ((ConfigOptionFloatOrPercent, internal_bridge_speed))
((ConfigOptionBool, ensure_vertical_shell_thickness)) ((ConfigOptionBool, ensure_vertical_shell_thickness))

View file

@ -1106,7 +1106,7 @@ bool PrintObject::invalidate_state_by_config_options(
|| opt_key == "overhang_speed_classic") { || opt_key == "overhang_speed_classic") {
steps.emplace_back(posPerimeters); steps.emplace_back(posPerimeters);
steps.emplace_back(posSupportMaterial); steps.emplace_back(posSupportMaterial);
} else if (opt_key == "bridge_flow") { } else if (opt_key == "bridge_flow" || opt_key == "internal_bridge_flow") {
if (m_config.support_top_z_distance > 0.) { if (m_config.support_top_z_distance > 0.) {
// Only invalidate due to bridging if bridging is enabled. // Only invalidate due to bridging if bridging is enabled.
// If later "support_top_z_distance" is modified, the complete PrintObject is invalidated anyway. // If later "support_top_z_distance" is modified, the complete PrintObject is invalidated anyway.

View file

@ -1896,6 +1896,7 @@ void TabPrint::build()
optgroup->append_single_option_line("wall_infill_order"); optgroup->append_single_option_line("wall_infill_order");
optgroup->append_single_option_line("print_flow_ratio"); optgroup->append_single_option_line("print_flow_ratio");
optgroup->append_single_option_line("bridge_flow"); optgroup->append_single_option_line("bridge_flow");
optgroup->append_single_option_line("internal_bridge_flow");
optgroup->append_single_option_line("bridge_density"); optgroup->append_single_option_line("bridge_density");
optgroup->append_single_option_line("thick_bridges"); optgroup->append_single_option_line("thick_bridges");
optgroup->append_single_option_line("top_solid_infill_flow_ratio"); optgroup->append_single_option_line("top_solid_infill_flow_ratio");