diff options
author | Merill <merill@fr.fr> | 2018-07-01 19:35:56 +0300 |
---|---|---|
committer | supermerill <merill@free.fr> | 2018-07-02 12:14:25 +0300 |
commit | 64c724dc1fcf8878f48a0b99d1b97c4e1f51a9f5 (patch) | |
tree | 71ceda873d6ace09abed3474d7bf6105ee8ec567 | |
parent | d21c33e9b5777ade5c5644e088a4a696d153070a (diff) |
Anchor solid infill / external_infill_margin -> split with bridged.supermerill-dev
-rw-r--r-- | xs/src/libslic3r/LayerRegion.cpp | 7 | ||||
-rw-r--r-- | xs/src/libslic3r/PrintConfig.cpp | 13 | ||||
-rw-r--r-- | xs/src/libslic3r/PrintConfig.hpp | 2 | ||||
-rw-r--r-- | xs/src/libslic3r/PrintObject.cpp | 3 | ||||
-rw-r--r-- | xs/src/slic3r/GUI/Preset.cpp | 2 | ||||
-rw-r--r-- | xs/src/slic3r/GUI/Tab.cpp | 5 |
6 files changed, 24 insertions, 8 deletions
diff --git a/xs/src/libslic3r/LayerRegion.cpp b/xs/src/libslic3r/LayerRegion.cpp index 9ffc0dda2..e29f5618a 100644 --- a/xs/src/libslic3r/LayerRegion.cpp +++ b/xs/src/libslic3r/LayerRegion.cpp @@ -94,12 +94,13 @@ void LayerRegion::process_external_surfaces(const Layer* lower_layer) { const Surfaces &surfaces = this->fill_surfaces.surfaces; 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 export_region_fill_surfaces_to_svg_debug("3_process_external_surfaces-initial"); #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. // Bottom surfaces, grown. Surfaces bottom; @@ -186,8 +187,8 @@ void LayerRegion::process_external_surfaces(const Layer* lower_layer) idx_island = j; break; } - // Grown by 3mm. - Polygons polys = offset(to_polygons(bridges[i].expolygon), float(margin), EXTERNAL_SURFACES_OFFSET_PARAMETERS); + // Grown by bridged_infill_margin. + Polygons polys = offset(to_polygons(bridges[i].expolygon), float(margin_bridged), EXTERNAL_SURFACES_OFFSET_PARAMETERS); if (idx_island == -1) { printf("Bridge did not fall into the source region!\r\n"); } else { diff --git a/xs/src/libslic3r/PrintConfig.cpp b/xs/src/libslic3r/PrintConfig.cpp index 01f1a97bf..97354b933 100644 --- a/xs/src/libslic3r/PrintConfig.cpp +++ b/xs/src/libslic3r/PrintConfig.cpp @@ -343,9 +343,18 @@ PrintConfigDef::PrintConfigDef() def->default_value = new ConfigOptionBool(true); 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->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 top/bottom layers by some mm to anchor them into the part. Put 0 to deactivate it."); + 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->cli = "top-layer-anchor=f"; def->min = 0; diff --git a/xs/src/libslic3r/PrintConfig.hpp b/xs/src/libslic3r/PrintConfig.hpp index f69b806d3..4e52316b5 100644 --- a/xs/src/libslic3r/PrintConfig.hpp +++ b/xs/src/libslic3r/PrintConfig.hpp @@ -393,6 +393,7 @@ public: ConfigOptionEnum<InfillPattern> bottom_fill_pattern; ConfigOptionBool enforce_full_fill_volume; ConfigOptionFloat external_infill_margin; + ConfigOptionFloat bridged_infill_margin; ConfigOptionFloatOrPercent external_perimeter_extrusion_width; ConfigOptionFloatOrPercent external_perimeter_speed; ConfigOptionBool external_perimeters_first; @@ -436,6 +437,7 @@ protected: OPT_PTR(bottom_fill_pattern); OPT_PTR(enforce_full_fill_volume); OPT_PTR(external_infill_margin); + OPT_PTR(bridged_infill_margin); OPT_PTR(external_perimeter_extrusion_width); OPT_PTR(external_perimeter_speed); OPT_PTR(external_perimeters_first); diff --git a/xs/src/libslic3r/PrintObject.cpp b/xs/src/libslic3r/PrintObject.cpp index 938fff712..ab2f18ace 100644 --- a/xs/src/libslic3r/PrintObject.cpp +++ b/xs/src/libslic3r/PrintObject.cpp @@ -193,6 +193,7 @@ bool PrintObject::invalidate_state_by_config_options(const std::vector<t_config_ || opt_key == "top_solid_layers" || opt_key == "solid_infill_below_area" || opt_key == "external_infill_margin" + || opt_key == "bridged_infill_margin" || opt_key == "infill_extruder" || opt_key == "solid_infill_extruder" || opt_key == "infill_extrusion_width" @@ -307,7 +308,7 @@ void PrintObject::_prepare_infill() // 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. - // 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. // 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. diff --git a/xs/src/slic3r/GUI/Preset.cpp b/xs/src/slic3r/GUI/Preset.cpp index 33af8fa3e..edd4578df 100644 --- a/xs/src/slic3r/GUI/Preset.cpp +++ b/xs/src/slic3r/GUI/Preset.cpp @@ -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", "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", - "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", "wipe_tower_width", "wipe_tower_rotation_angle", "wipe_tower_bridging", "only_one_perimeter_top", "compatible_printers", "compatible_printers_condition","inherits" }; diff --git a/xs/src/slic3r/GUI/Tab.cpp b/xs/src/slic3r/GUI/Tab.cpp index 0d9301e76..d10233772 100644 --- a/xs/src/slic3r/GUI/Tab.cpp +++ b/xs/src/slic3r/GUI/Tab.cpp @@ -861,7 +861,10 @@ void TabPrint::build() 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("external_infill_margin"); + line = { _(L("Anchor solid infill by X mm")), "" }; + line.append_option(optgroup->get_option("external_infill_margin")); + line.append_option(optgroup->get_option("bridged_infill_margin")); + optgroup->append_line(line); optgroup->append_single_option_line("bridge_angle"); optgroup->append_single_option_line("only_retract_when_crossing_perimeters"); optgroup->append_single_option_line("infill_first"); |