update to infill_anchor integration

This commit is contained in:
supermerill 2020-11-29 00:40:17 +01:00
parent 48d1f380a8
commit ab7c688a72
3 changed files with 15 additions and 14 deletions

View File

@ -85,7 +85,7 @@ group:Modifying slices
setting:width$6:curve_smoothing_precision setting:width$6:curve_smoothing_precision
setting:width$6:curve_smoothing_angle_convex setting:width$6:curve_smoothing_angle_convex
setting:width$6:curve_smoothing_angle_concave setting:width$6:curve_smoothing_angle_concave
setting:label_width$6:width$6:curve_smoothing_cutoff_dist setting:width$6:curve_smoothing_cutoff_dist
end_line end_line
line:XY compensation line:XY compensation
setting:width$6:xy_size_compensation setting:width$6:xy_size_compensation
@ -107,9 +107,11 @@ group:title_width$8:Infill
setting:width$5:label$_:sidetext_width$1:fill_density setting:width$5:label$_:sidetext_width$1:fill_density
setting:label_width$1:label$_:fill_pattern setting:label_width$1:label$_:fill_pattern
setting:label$_:width$18:infill_connection setting:label$_:width$18:infill_connection
setting:sidetext_width$7:infill_anchor
setting:sidetext_width$7:infill_anchor_max
end_line end_line
line:_
setting:label$Connection length:label_width$20:sidetext_width$7:width$12:infill_anchor_max
setting:label$Perimeter anchor:sidetext_width$7:width$12:infill_anchor
end_line
line:Solid line:Solid
setting:label_width$11:label$_:solid_fill_pattern setting:label_width$11:label$_:solid_fill_pattern
setting:label$_:width$18:infill_connection_solid setting:label$_:width$18:infill_connection_solid

View File

@ -2477,14 +2477,14 @@ void connect_infill(Polylines&& infill_ordered, const std::vector<const Polygon*
} }
void Fill::connect_infill(Polylines&& infill_ordered, const ExPolygon& boundary, Polylines& polylines_out, const double spacing, const FillParams& params) { void Fill::connect_infill(Polylines&& infill_ordered, const ExPolygon& boundary, Polylines& polylines_out, const double spacing, const FillParams& params) {
if (params.anchor_length == 0) { if (params.anchor_length_max == 0) {
PrusaSimpleConnect::connect_infill(std::move(infill_ordered), boundary, polylines_out, spacing, params); PrusaSimpleConnect::connect_infill(std::move(infill_ordered), boundary, polylines_out, spacing, params);
} else { } else {
FakePerimeterConnect::connect_infill(std::move(infill_ordered), boundary, polylines_out, spacing, params); FakePerimeterConnect::connect_infill(std::move(infill_ordered), boundary, polylines_out, spacing, params);
} }
} }
void Fill::connect_infill(Polylines&& infill_ordered, const ExPolygon& boundary, const Polygons& polygons_src, Polylines& polylines_out, const double spacing, const FillParams& params) { void Fill::connect_infill(Polylines&& infill_ordered, const ExPolygon& boundary, const Polygons& polygons_src, Polylines& polylines_out, const double spacing, const FillParams& params) {
if (params.anchor_length == 0) { if (params.anchor_length_max == 0) {
PrusaSimpleConnect::connect_infill(std::move(infill_ordered), boundary, polylines_out, spacing, params); PrusaSimpleConnect::connect_infill(std::move(infill_ordered), boundary, polylines_out, spacing, params);
} else { } else {
FakePerimeterConnect::connect_infill(std::move(infill_ordered), polygons_src, get_extents(boundary.contour), polylines_out, spacing, params); FakePerimeterConnect::connect_infill(std::move(infill_ordered), polygons_src, get_extents(boundary.contour), polylines_out, spacing, params);

View File

@ -1890,7 +1890,7 @@ void PrintConfigDef::init_fff_params()
"PrusaSlicer tries to connect two close infill lines to a short perimeter segment. If no such perimeter segment " "PrusaSlicer tries to connect two close infill lines to a short perimeter segment. If no such perimeter segment "
"shorter than infill_anchor_max is found, the infill line is connected to a perimeter segment at just one side " "shorter than infill_anchor_max is found, the infill line is connected to a perimeter segment at just one side "
"and the length of the perimeter segment taken is limited to this parameter, but no longer than anchor_length_max. " "and the length of the perimeter segment taken is limited to this parameter, but no longer than anchor_length_max. "
"\nIf set to 0, it will use a simpler algo that don't try to create a fake perimeter."); "\nSet this parameter to zero to disable anchoring perimeters connected to a single infill line.");
def->sidetext = L("mm or %"); def->sidetext = L("mm or %");
def->ratio_over = "infill_extrusion_width"; def->ratio_over = "infill_extrusion_width";
def->gui_type = "f_enum_open"; def->gui_type = "f_enum_open";
@ -1900,15 +1900,14 @@ void PrintConfigDef::init_fff_params()
def->enum_values.push_back("5"); def->enum_values.push_back("5");
def->enum_values.push_back("10"); def->enum_values.push_back("10");
def->enum_values.push_back("1000"); def->enum_values.push_back("1000");
def->enum_labels.push_back(L("0 (Simple connect)")); def->enum_labels.push_back(L("0 (no open anchors)"));
def->enum_labels.push_back("1 mm"); def->enum_labels.push_back("1 mm");
def->enum_labels.push_back("2 mm"); def->enum_labels.push_back("2 mm");
def->enum_labels.push_back("5 mm"); def->enum_labels.push_back("5 mm");
def->enum_labels.push_back("10 mm"); def->enum_labels.push_back("10 mm");
def->enum_labels.push_back(L("1000 (unlimited)")); def->enum_labels.push_back(L("1000 (unlimited)"));
def->mode = comAdvanced; def->mode = comExpert;
def->set_default_value(new ConfigOptionFloatOrPercent(1000, false)); def->set_default_value(new ConfigOptionFloatOrPercent(600, true));
def->set_default_value(new ConfigOptionFloatOrPercent(0, false));
def = this->add("infill_anchor_max", coFloatOrPercent); def = this->add("infill_anchor_max", coFloatOrPercent);
def->label = L("Maximum length of the infill anchor"); def->label = L("Maximum length of the infill anchor");
@ -1918,19 +1917,19 @@ void PrintConfigDef::init_fff_params()
"PrusaSlicer tries to connect two close infill lines to a short perimeter segment. If no such perimeter segment " "PrusaSlicer tries to connect two close infill lines to a short perimeter segment. If no such perimeter segment "
"shorter than this parameter is found, the infill line is connected to a perimeter segment at just one side " "shorter than this parameter is found, the infill line is connected to a perimeter segment at just one side "
"and the length of the perimeter segment taken is limited to infill_anchor, but no longer than this parameter. " "and the length of the perimeter segment taken is limited to infill_anchor, but no longer than this parameter. "
"Set this parameter to zero to disable anchoring."); "\nIf set to 0, the old algorithm for infill connection will be used, it should create the same result as with 1000 & 0.");
def->sidetext = def_infill_anchor_min->sidetext; def->sidetext = def_infill_anchor_min->sidetext;
def->ratio_over = def_infill_anchor_min->ratio_over; def->ratio_over = def_infill_anchor_min->ratio_over;
def->gui_type = def_infill_anchor_min->gui_type; def->gui_type = def_infill_anchor_min->gui_type;
def->enum_values = def_infill_anchor_min->enum_values; def->enum_values = def_infill_anchor_min->enum_values;
def->enum_labels.push_back(L("0 (not anchored)")); def->enum_labels.push_back(L("0 (Simple connect)"));
def->enum_labels.push_back("1 mm"); def->enum_labels.push_back("1 mm");
def->enum_labels.push_back("2 mm"); def->enum_labels.push_back("2 mm");
def->enum_labels.push_back("5 mm"); def->enum_labels.push_back("5 mm");
def->enum_labels.push_back("10 mm"); def->enum_labels.push_back("10 mm");
def->enum_labels.push_back(L("1000 (unlimited)")); def->enum_labels.push_back(L("1000 (unlimited)"));
def->mode = def_infill_anchor_min->mode; def->mode = comAdvanced;
def->set_default_value(new ConfigOptionFloatOrPercent(50, false)); def->set_default_value(new ConfigOptionFloatOrPercent(0, false));
def = this->add("infill_dense", coBool); def = this->add("infill_dense", coBool);
def->label = (""); def->label = ("");