Anchor solid infill / external_infill_margin -> split with bridged.

This commit is contained in:
supermerill 2018-07-01 19:35:56 +02:00
parent 3de81fc960
commit 47ad0dad77
6 changed files with 31 additions and 15 deletions

View File

@ -94,12 +94,13 @@ void LayerRegion::process_external_surfaces(const Layer* lower_layer)
{ {
const Surfaces &surfaces = this->fill_surfaces.surfaces; const Surfaces &surfaces = this->fill_surfaces.surfaces;
const double margin = scale_(this->region()->config.external_infill_margin.getFloat()); const double margin = scale_(this->region()->config.external_infill_margin.getFloat());
const double margin_bridged = scale_(this->region()->config.bridged_infill_margin.getFloat());
#ifdef SLIC3R_DEBUG_SLICE_PROCESSING #ifdef SLIC3R_DEBUG_SLICE_PROCESSING
export_region_fill_surfaces_to_svg_debug("3_process_external_surfaces-initial"); export_region_fill_surfaces_to_svg_debug("3_process_external_surfaces-initial");
#endif /* SLIC3R_DEBUG_SLICE_PROCESSING */ #endif /* SLIC3R_DEBUG_SLICE_PROCESSING */
// 1) Collect bottom and bridge surfaces, each of them grown by a fixed 3mm offset // 1) Collect bottom and bridge surfaces, each of them grown by a parametrised ~3mm offset
// for better anchoring. // for better anchoring.
// Bottom surfaces, grown. // Bottom surfaces, grown.
Surfaces bottom; Surfaces bottom;
@ -186,8 +187,8 @@ void LayerRegion::process_external_surfaces(const Layer* lower_layer)
idx_island = j; idx_island = j;
break; break;
} }
// Grown by 3mm. // Grown by bridged_infill_margin.
Polygons polys = offset(to_polygons(bridges[i].expolygon), float(margin), EXTERNAL_SURFACES_OFFSET_PARAMETERS); Polygons polys = offset(to_polygons(bridges[i].expolygon), float(margin_bridged), EXTERNAL_SURFACES_OFFSET_PARAMETERS);
if (idx_island == -1) { if (idx_island == -1) {
printf("Bridge did not fall into the source region!\r\n"); printf("Bridge did not fall into the source region!\r\n");
} else { } else {

View File

@ -343,9 +343,18 @@ PrintConfigDef::PrintConfigDef()
def->default_value = new ConfigOptionBool(true); def->default_value = new ConfigOptionBool(true);
def = this->add("external_infill_margin", coFloat); def = this->add("external_infill_margin", coFloat);
def->label = L("Anchor the top by X mm"); def->label = L("Default");
def->category = L("Infill"); def->category = L("Infill");
def->tooltip = L("This parameter grow the top/bottom layers by some mm to anchor them into the part. Put 0 to deactivate it."); def->tooltip = L("This parameter grow the top/bottom/solid layers by some mm to anchor them into the part. Put 0 to deactivate it.");
def->sidetext = L("mm");
def->cli = "top-layer-anchor=f";
def->min = 0;
def->default_value = new ConfigOptionFloat(3);
def = this->add("bridged_infill_margin", coFloat);
def->label = L("Bridged");
def->category = L("Infill");
def->tooltip = L("This parameter grow the bridged solid infill layers by some mm to anchor them into the part. Put 0 to deactivate it.");
def->sidetext = L("mm"); def->sidetext = L("mm");
def->cli = "top-layer-anchor=f"; def->cli = "top-layer-anchor=f";
def->min = 0; def->min = 0;

View File

@ -393,6 +393,7 @@ public:
ConfigOptionEnum<InfillPattern> bottom_fill_pattern; ConfigOptionEnum<InfillPattern> bottom_fill_pattern;
ConfigOptionBool enforce_full_fill_volume; ConfigOptionBool enforce_full_fill_volume;
ConfigOptionFloat external_infill_margin; ConfigOptionFloat external_infill_margin;
ConfigOptionFloat bridged_infill_margin;
ConfigOptionFloatOrPercent external_perimeter_extrusion_width; ConfigOptionFloatOrPercent external_perimeter_extrusion_width;
ConfigOptionFloatOrPercent external_perimeter_speed; ConfigOptionFloatOrPercent external_perimeter_speed;
ConfigOptionBool external_perimeters_first; ConfigOptionBool external_perimeters_first;
@ -438,6 +439,7 @@ protected:
OPT_PTR(bottom_fill_pattern); OPT_PTR(bottom_fill_pattern);
OPT_PTR(enforce_full_fill_volume); OPT_PTR(enforce_full_fill_volume);
OPT_PTR(external_infill_margin); OPT_PTR(external_infill_margin);
OPT_PTR(bridged_infill_margin);
OPT_PTR(external_perimeter_extrusion_width); OPT_PTR(external_perimeter_extrusion_width);
OPT_PTR(external_perimeter_speed); OPT_PTR(external_perimeter_speed);
OPT_PTR(external_perimeters_first); OPT_PTR(external_perimeters_first);

View File

@ -195,6 +195,7 @@ bool PrintObject::invalidate_state_by_config_options(const std::vector<t_config_
|| opt_key == "top_solid_layers" || opt_key == "top_solid_layers"
|| opt_key == "solid_infill_below_area" || opt_key == "solid_infill_below_area"
|| opt_key == "external_infill_margin" || opt_key == "external_infill_margin"
|| opt_key == "bridged_infill_margin"
|| opt_key == "infill_extruder" || opt_key == "infill_extruder"
|| opt_key == "solid_infill_extruder" || opt_key == "solid_infill_extruder"
|| opt_key == "infill_extrusion_width" || opt_key == "infill_extrusion_width"
@ -309,7 +310,7 @@ void PrintObject::_prepare_infill()
// It produces enlarged overlapping bridging areas. // It produces enlarged overlapping bridging areas.
// //
// 1) S_TYPE_BOTTOMBRIDGE / S_TYPE_BOTTOM infill is grown by 3mm and clipped by the total infill area. Bridges are detected. The areas may overlap. // 1) S_TYPE_BOTTOMBRIDGE / S_TYPE_BOTTOM infill is grown by 3mm and clipped by the total infill area. Bridges are detected. The areas may overlap.
// 2) S_TYPE_TOP is grown by 3mm and clipped by the grown bottom areas. The areas may overlap. // 2) S_TYPE_TOP is grown by 3mm (or external_infill_margin) and clipped by the grown bottom areas. The areas may overlap.
// 3) Clip the internal surfaces by the grown top/bottom surfaces. // 3) Clip the internal surfaces by the grown top/bottom surfaces.
// 4) Merge surfaces with the same style. This will mostly get rid of the overlaps. // 4) Merge surfaces with the same style. This will mostly get rid of the overlaps.
//FIXME This does not likely merge surfaces, which are supported by a material with different colors, but same properties. //FIXME This does not likely merge surfaces, which are supported by a material with different colors, but same properties.

View File

@ -297,7 +297,7 @@ const std::vector<std::string>& Preset::print_options()
"ooze_prevention", "standby_temperature_delta", "interface_shells", "extrusion_width", "first_layer_extrusion_width", "ooze_prevention", "standby_temperature_delta", "interface_shells", "extrusion_width", "first_layer_extrusion_width",
"perimeter_extrusion_width", "external_perimeter_extrusion_width", "infill_extrusion_width", "solid_infill_extrusion_width", "perimeter_extrusion_width", "external_perimeter_extrusion_width", "infill_extrusion_width", "solid_infill_extrusion_width",
"top_infill_extrusion_width", "support_material_extrusion_width", "infill_overlap", "bridge_flow_ratio", "top_infill_extrusion_width", "support_material_extrusion_width", "infill_overlap", "bridge_flow_ratio",
"over_bridge_flow_ratio", "clip_multipart_objects", "enforce_full_fill_volume", "external_infill_margin", "over_bridge_flow_ratio", "clip_multipart_objects", "enforce_full_fill_volume", "external_infill_margin", "bridged_infill_margin",
"elefant_foot_compensation", "xy_size_compensation", "threads", "resolution", "wipe_tower", "wipe_tower_x", "wipe_tower_y", "elefant_foot_compensation", "xy_size_compensation", "threads", "resolution", "wipe_tower", "wipe_tower_x", "wipe_tower_y",
"wipe_tower_width", "wipe_tower_rotation_angle", "wipe_tower_bridging", "only_one_perimeter_top", "compatible_printers", "wipe_tower_width", "wipe_tower_rotation_angle", "wipe_tower_bridging", "only_one_perimeter_top", "compatible_printers",
"compatible_printers_condition", "inherits", "infill_dense_layers", "infill_dense_density" "compatible_printers_condition", "inherits", "infill_dense_layers", "infill_dense_density"

View File

@ -861,14 +861,17 @@ void TabPrint::build()
line.append_option(optgroup->get_option("infill_dense_density")); line.append_option(optgroup->get_option("infill_dense_density"));
optgroup->append_line(line); optgroup->append_line(line);
optgroup = page->new_optgroup(_(L("Advanced"))); optgroup = page->new_optgroup(_(L("Advanced")));
optgroup->append_single_option_line("solid_infill_every_layers"); optgroup->append_single_option_line("solid_infill_every_layers");
optgroup->append_single_option_line("fill_angle"); optgroup->append_single_option_line("solid_infill_below_area");
optgroup->append_single_option_line("solid_infill_below_area"); optgroup->append_single_option_line("fill_angle");
optgroup->append_single_option_line("external_infill_margin"); optgroup->append_single_option_line("bridge_angle");
optgroup->append_single_option_line("bridge_angle"); line = { _(L("Anchor solid infill by X mm")), "" };
optgroup->append_single_option_line("only_retract_when_crossing_perimeters"); line.append_option(optgroup->get_option("external_infill_margin"));
optgroup->append_single_option_line("infill_first"); line.append_option(optgroup->get_option("bridged_infill_margin"));
optgroup->append_line(line);
optgroup->append_single_option_line("only_retract_when_crossing_perimeters");
optgroup->append_single_option_line("infill_first");
page = add_options_page(_(L("Skirt and brim")), "box.png"); page = add_options_page(_(L("Skirt and brim")), "box.png");
optgroup = page->new_optgroup(_(L("Skirt"))); optgroup = page->new_optgroup(_(L("Skirt")));