Skip to content

Commit

Permalink
new setting: internal_bridge_expansion, to disable the bridge infill …
Browse files Browse the repository at this point in the history
…growth into sparse infill
  • Loading branch information
supermerill committed Dec 2, 2024
1 parent 7bf3090 commit 3d19c9b
Show file tree
Hide file tree
Showing 6 changed files with 44 additions and 26 deletions.
1 change: 1 addition & 0 deletions resources/ui_layout/default/print.ui
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,7 @@ group:Reducing printing time
setting:tags$Advanced$Expert$SuSi:sidetext_width$0:label$_:infill_dense
setting:width$20:infill_dense_algo
end_line
setting:internal_bridge_expansion
group:sidetext_width$5:Infill angle
line:Angle
setting:label_width$8:width$5:fill_angle
Expand Down
2 changes: 1 addition & 1 deletion src/libslic3r/GCode.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4319,7 +4319,7 @@ void GCodeGenerator::seam_notch(const ExtrusionLoop& original_loop,
is_convex = polygon_to_test.convex_points(0, 3.07).empty();
} else {
// 3.3 instead of PI to allow for some concave outliers (sometimes, stl can be a bit imprecise)
is_convex = polygon_to_test.concave_points(0, 3.3).empty();
is_convex = polygon_to_test.concave_points(0, 3.07).empty();
}
if (is_convex) {
// Computing circle center
Expand Down
1 change: 1 addition & 0 deletions src/libslic3r/Preset.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -718,6 +718,7 @@ static std::vector<std::string> s_Preset_print_options {
"first_layer_flow_ratio",
"enforce_full_fill_volume",
"external_infill_margin", "bridged_infill_margin",
"internal_bridge_expansion",
"small_area_infill_flow_compensation", "small_area_infill_flow_compensation_model",
// compensation
"first_layer_size_compensation",
Expand Down
58 changes: 34 additions & 24 deletions src/libslic3r/PrintConfig.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -832,6 +832,18 @@ void PrintConfigDef::init_fff_params()
def->mode = comAdvancedE | comPrusa;
def->set_default_value(disable_defaultoption(new ConfigOptionFloat(0.), false));

def = this->add("bridged_infill_margin", coFloatOrPercent);
def->label = L("Bridged");
def->full_label = L("Bridge margin");
def->category = OptionCategory::infill;
def->tooltip = L("This parameter grows the bridged solid infill layers by the specified mm to anchor them into the sparse infill and over the perimeters below. Put 0 to deactivate it. Can be a % of the width of the external perimeter.");
def->sidetext = L("mm or %");
def->ratio_over = "external_perimeter_extrusion_width";
def->min = 0;
def->max_literal = { 50, true };
def->mode = comExpert | comSuSi;
def->set_default_value(new ConfigOptionFloatOrPercent(200, true));

def = this->add("bridge_fan_speed", coInts);
def->label = L("Bridges fan speed");
def->category = OptionCategory::cooling;
Expand All @@ -847,6 +859,17 @@ void PrintConfigDef::init_fff_params()
def->can_be_disabled = true;
def->set_default_value(disable_defaultoption(new ConfigOptionInts{ 100 }, false));

def = this->add("bridge_fill_pattern", coEnum);
def->label = L("Bridging fill pattern");
def->category = OptionCategory::infill;
def->tooltip = L("Fill pattern for bridges and internal bridge infill.");
def->set_enum<InfillPattern>({
{ "rectilinear", L("Rectilinear") },
{ "monotonic", L("Monotonic") },
});
def->mode = comExpert | comSuSi;
def->set_default_value(new ConfigOptionEnum<InfillPattern>(ipRectilinear));

def = this->add("bridge_type", coEnum);
def->label = L("Bridge flow baseline");
def->category = OptionCategory::width;
Expand Down Expand Up @@ -956,7 +979,7 @@ void PrintConfigDef::init_fff_params()
def->category = OptionCategory::skirtBrim;
def->tooltip = L("Create a brim per object instead of a brim for the plater."
" Useful for complete_object or if you have your brim detaching before printing the object."
"\nBe aware that the brim may be truncated if objects are too close together..");
"\nBe aware that the brim may be truncated if objects are too close together.");
def->mode = comAdvancedE | comSuSi;
def->set_default_value(new ConfigOptionBool(false));

Expand Down Expand Up @@ -1475,17 +1498,6 @@ void PrintConfigDef::init_fff_params()
def->mode = comExpert | comSuSi;
def->set_default_value(new ConfigOptionEnum<InfillPattern>(ipRectilinearWGapFill));

def = this->add("bridge_fill_pattern", coEnum);
def->label = L("Bridging fill pattern");
def->category = OptionCategory::infill;
def->tooltip = L("Fill pattern for bridges and internal bridge infill.");
def->set_enum<InfillPattern>({
{ "rectilinear", L("Rectilinear") },
{ "monotonic", L("Monotonic") },
});
def->mode = comExpert | comSuSi;
def->set_default_value(new ConfigOptionEnum<InfillPattern>(ipRectilinear));

def = this->add("enforce_full_fill_volume", coBool);
def->label = L("Enforce 100% fill volume");
def->category = OptionCategory::infill;
Expand Down Expand Up @@ -1531,18 +1543,6 @@ void PrintConfigDef::init_fff_params()
def->mode = comExpert | comSuSi;
def->set_default_value(new ConfigOptionFloatOrPercent(150, true));

def = this->add("bridged_infill_margin", coFloatOrPercent);
def->label = L("Bridged");
def->full_label = L("Bridge margin");
def->category = OptionCategory::infill;
def->tooltip = L("This parameter grows the bridged solid infill layers by the specified mm to anchor them into the sparse infill and over the perimeters below. Put 0 to deactivate it. Can be a % of the width of the external perimeter.");
def->sidetext = L("mm or %");
def->ratio_over = "external_perimeter_extrusion_width";
def->min = 0;
def->max_literal = { 50, true };
def->mode = comExpert | comSuSi;
def->set_default_value(new ConfigOptionFloatOrPercent(200, true));

def = this->add("external_perimeter_extrusion_width", coFloatOrPercent);
def->label = L("External perimeters");
def->full_label = L("External perimeters width");
Expand Down Expand Up @@ -3480,6 +3480,15 @@ void PrintConfigDef::init_fff_params()
def->set_default_value(new ConfigOptionFloatOrPercent(0,false));
def->aliases = { "bridge_internal_acceleration" };

def = this->add("internal_bridge_expansion", coBool);
def->label = L("Extends internal bridge to infill");
def->category = OptionCategory::skirtBrim;
def->tooltip = L("When creating internal bridges, extends the line to the nearest internal line it can use to support itself."
" This way, it can avoid curling up as when bridges lines ends over a void.");
def->category = OptionCategory::infill;
def->mode = comAdvancedE | comSuSi;
def->set_default_value(new ConfigOptionBool(true));

def = this->add("internal_bridge_fan_speed", coInts);
def->label = L("Infill bridges fan speed");
def->category = OptionCategory::cooling;
Expand Down Expand Up @@ -9461,6 +9470,7 @@ std::unordered_set<std::string> prusa_export_to_remove_keys = {
"infill_fan_speed",
"init_z_rotate",
"internal_bridge_acceleration",
"internal_bridge_expansion",
"internal_bridge_fan_speed",
"internal_bridge_speed",
"ironing_acceleration",
Expand Down
1 change: 1 addition & 0 deletions src/libslic3r/PrintConfig.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -941,6 +941,7 @@ PRINT_CONFIG_CLASS_DEFINE(
((ConfigOptionEnum<DenseInfillAlgo>, infill_dense_algo))
((ConfigOptionBool, infill_first))
((ConfigOptionFloatOrPercent, internal_bridge_acceleration))
((ConfigOptionBool, internal_bridge_expansion))
((ConfigOptionFloatOrPercent, internal_bridge_speed))
// Ironing options
((ConfigOptionBool, ironing))
Expand Down
7 changes: 6 additions & 1 deletion src/libslic3r/PrintObject.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1436,6 +1436,7 @@ bool PrintObject::invalidate_state_by_config_options(
|| opt_key == "infill_dense"
|| opt_key == "infill_dense_algo"
|| opt_key == "infill_only_where_needed"
|| opt_key == "internal_bridge_expansion"
|| opt_key == "ironing"
|| opt_key == "ironing_type"
|| opt_key == "over_bridge_flow_ratio"
Expand Down Expand Up @@ -3881,7 +3882,11 @@ void PrintObject::bridge_over_infill()

Polygons bridging_area;
double bridging_angle = 0;
{
if (!candidate.region->region().config().internal_bridge_expansion.value) {
bridging_area = area_to_be_bridge;
bridging_angle = determine_bridging_angle(area_to_be_bridge, to_lines(boundary_plines),
InfillPattern::ipLine);
} else {

#ifdef DEBUG_BRIDGE_OVER_INFILL
int r = rand();
Expand Down

0 comments on commit 3d19c9b

Please sign in to comment.