diff --git a/resources/ui_layout/colors.ini b/resources/ui_layout/colors.ini index 16de83f66..ea60fd257 100644 --- a/resources/ui_layout/colors.ini +++ b/resources/ui_layout/colors.ini @@ -5,6 +5,7 @@ Internal infill = B1302A Solid infill = D732D7 Top solid infill = FF1A1A Bridge infill = 9999FF +Internal Bridge infill = AAAADD Thin wall = FFB000 Gap fill = FFFFFF Skirt = 845321 diff --git a/resources/ui_layout/print.ui b/resources/ui_layout/print.ui index b3a5f615f..56cd0974b 100644 --- a/resources/ui_layout/print.ui +++ b/resources/ui_layout/print.ui @@ -206,7 +206,9 @@ group:label_width$8:Speed for print moves setting:width$4:support_material_interface_speed end_line line:Bridge speed - setting:label$_:width$4:bridge_speed + setting:width$4:bridge_speed + setting:width$4:bridge_speed_internal + setting:width$4:overhangs_speed end_line line:Thin extrusions speed setting:width$4:gap_fill_speed diff --git a/src/libslic3r/ExtrusionEntity.cpp b/src/libslic3r/ExtrusionEntity.cpp index 792bf678f..3bd3b4ec1 100644 --- a/src/libslic3r/ExtrusionEntity.cpp +++ b/src/libslic3r/ExtrusionEntity.cpp @@ -274,6 +274,7 @@ std::string ExtrusionEntity::role_to_string(ExtrusionRole role) case erInternalInfill : return L("Internal infill"); case erSolidInfill : return L("Solid infill"); case erTopSolidInfill : return L("Top solid infill"); + case erInternalBridgeInfill : return L("Internal Bridge infill"); case erBridgeInfill : return L("Bridge infill"); case erThinWall : return L("Thin wall"); case erGapFill : return L("Gap fill"); diff --git a/src/libslic3r/ExtrusionEntity.hpp b/src/libslic3r/ExtrusionEntity.hpp index 3f8b61d72..5939e433c 100644 --- a/src/libslic3r/ExtrusionEntity.hpp +++ b/src/libslic3r/ExtrusionEntity.hpp @@ -14,6 +14,41 @@ class ExtrusionEntityCollection; class Extruder; // Each ExtrusionRole value identifies a distinct set of { extruder, speed } +/* +enum ExtrusionRoleModifier : uint16_t { + ermPerimeter = (1 << 0), + ermInfill = (2 << 1), + ermThin = (2 << 2), + ermSkirt = (2 << 3), + ermOther = (2 << 4), + ermInternal = (1 << 10), + ermExternal = (1 << 11), + ermSolid = (1 << 12), + ermBridge = (1 << 13), + ermSupport = (1 << 13) +}; +enum ExtrusionRole : uint16_t { + erNone = 0, + erPerimeter = ermPerimeter | ermInternal, + erExternalPerimeter = ermPerimeter | ermExternal, + erOverhangPerimeter = ermPerimeter | ermBridge, + erInternalInfill = ermInfill | ermInternal, + erSolidInfill = ermInfill | ermSolid | ermInternal, + erTopSolidInfill = ermInfill | ermSolid | ermExternal, + erBridgeInfill = ermInfill | ermSolid | ermBridge | ermExternal, + erInternalBridgeInfill = ermInfill | ermSolid | ermBridge, + erThinWall = ermThin | ermInternal, + erGapFill = ermThin | ermExternal, + erSkirt = ermSkirt, + erSupportMaterial = ermInfill | ermSupport | ermInternal, + erSupportMaterialInterface = ermInfill | ermSupport | ermExternal, + erWipeTower = ermSkirt | ermSupport, + erMilling = ermOther | ermPerimeter, + erCustom = ermOther | ermSkirt, + // Extrusion role for a collection with multiple extrusion roles. + erMixed = ermOther +}; +*/ enum ExtrusionRole : uint8_t { erNone, erPerimeter, @@ -23,6 +58,7 @@ enum ExtrusionRole : uint8_t { erSolidInfill, erTopSolidInfill, erBridgeInfill, + erInternalBridgeInfill, erThinWall, erGapFill, erSkirt, @@ -35,6 +71,7 @@ enum ExtrusionRole : uint8_t { erMixed, erCount }; + // perimeter / infill / support / skirt / gapfill / wipetower / custom / mixed // side / internal / top / bottom // bridge diff --git a/src/libslic3r/Fill/FillBase.cpp b/src/libslic3r/Fill/FillBase.cpp index 7f874707f..a650892ba 100644 --- a/src/libslic3r/Fill/FillBase.cpp +++ b/src/libslic3r/Fill/FillBase.cpp @@ -604,7 +604,7 @@ Fill::do_gap_fill(const ExPolygons &gapfill_areas, const FillParams ¶ms, Ext MedialAxis{ ex, params.flow->scaled_width() * 2, params.flow->scaled_width() / 5, coord_t(params.flow->height) }.build(polylines_gapfill); } } - if (!polylines_gapfill.empty() && params.role != erBridgeInfill) { + if (!polylines_gapfill.empty() && params.role != erBridgeInfill && params.role != erInternalBridgeInfill) { //test #ifdef _DEBUG for (ThickPolyline poly : polylines_gapfill) { diff --git a/src/libslic3r/Fill/FillBase.hpp b/src/libslic3r/Fill/FillBase.hpp index 621f361a6..d81109aac 100644 --- a/src/libslic3r/Fill/FillBase.hpp +++ b/src/libslic3r/Fill/FillBase.hpp @@ -147,7 +147,7 @@ protected: ExtrusionRole getRoleFromSurfaceType(const FillParams ¶ms, const Surface *surface) const { if (params.role == erNone || params.role == erCustom) { return params.flow->bridge ? - erBridgeInfill : + (surface->has_pos_bottom() ? erBridgeInfill :erInternalBridgeInfill) : (surface->has_fill_solid() ? ((surface->has_pos_top()) ? erTopSolidInfill : erSolidInfill) : erInternalInfill); diff --git a/src/libslic3r/Fill/FillConcentric.cpp b/src/libslic3r/Fill/FillConcentric.cpp index 4530412cc..b9118bf55 100644 --- a/src/libslic3r/Fill/FillConcentric.cpp +++ b/src/libslic3r/Fill/FillConcentric.cpp @@ -153,7 +153,7 @@ FillConcentricWGapFill::fill_surface_extrusion( MedialAxis{ ex, coord_t(max), coord_t(min), coord_t(params.flow->height) }.build(polylines); } } - if (!polylines.empty() && good_role != erBridgeInfill) { + if (!polylines.empty() && good_role != erBridgeInfill && good_role != erInternalBridgeInfill) { ExtrusionEntityCollection gap_fill = thin_variable_width(polylines, erGapFill, *params.flow); //set role if needed if (good_role != erSolidInfill) { diff --git a/src/libslic3r/GCode.cpp b/src/libslic3r/GCode.cpp index db8079bfb..088c2f063 100644 --- a/src/libslic3r/GCode.cpp +++ b/src/libslic3r/GCode.cpp @@ -954,12 +954,13 @@ namespace DoExport { if (region->config().get_abs_value("perimeter_speed") == 0 || region->config().get_abs_value("small_perimeter_speed") == 0 || region->config().get_abs_value("external_perimeter_speed") == 0 || - region->config().get_abs_value("bridge_speed") == 0) + region->config().get_abs_value("overhangs_speed") == 0) mm3_per_mm.push_back(layerm->perimeters.min_mm3_per_mm()); if (region->config().get_abs_value("infill_speed") == 0 || region->config().get_abs_value("solid_infill_speed") == 0 || region->config().get_abs_value("top_solid_infill_speed") == 0 || - region->config().get_abs_value("bridge_speed") == 0) + region->config().get_abs_value("bridge_speed") == 0 || + region->config().get_abs_value("bridge_speed_internal") == 0) mm3_per_mm.push_back(layerm->fills.min_mm3_per_mm()); } } @@ -3759,6 +3760,7 @@ std::string extrusion_role_2_string(const ExtrusionRole &er) { case erInternalInfill: return "infill internal"; case erSolidInfill: return "infill solid"; case erTopSolidInfill: return "infill solid top"; + case erInternalBridgeInfill: case erBridgeInfill: return "infill bridge"; case erThinWall: return "thin_wall"; case erGapFill: return "gap_fill"; @@ -4161,8 +4163,12 @@ std::string GCode::_before_extrude(const ExtrusionPath &path, const std::string speed = m_config.get_abs_value("perimeter_speed"); } else if (path.role() == erExternalPerimeter) { speed = m_config.get_abs_value("external_perimeter_speed"); - } else if (path.role() == erOverhangPerimeter || path.role() == erBridgeInfill) { - speed = m_config.get_abs_value("bridge_speed"); + } else if (path.role() == erBridgeInfill) { + speed = m_config.get_abs_value("bridge_speed"); + } else if (path.role() == erInternalBridgeInfill) { + speed = m_config.get_abs_value("bridge_speed_internal"); + } else if (path.role() == erOverhangPerimeter) { + speed = m_config.get_abs_value("overhangs_speed"); } else if (path.role() == erInternalInfill) { speed = m_config.get_abs_value("infill_speed"); } else if (path.role() == erSolidInfill) { @@ -4181,7 +4187,7 @@ std::string GCode::_before_extrude(const ExtrusionPath &path, const std::string throw std::invalid_argument("Invalid speed"); } //don't modify bridge speed - if (factor < 1 && !(path.role() == erOverhangPerimeter || path.role() == erBridgeInfill)) { + if (factor < 1 && !(path.role() == erOverhangPerimeter || path.role() == erBridgeInfill || path.role() == erInternalBridgeInfill)) { float small_speed = m_config.small_perimeter_speed.get_abs_value(m_config.perimeter_speed); //apply factor between feature speed and small speed speed = speed * factor + (1 - factor) * small_speed; @@ -4667,6 +4673,7 @@ GCode::extrusion_role_to_string_for_parser(const ExtrusionRole & role) { case erTopSolidInfill: return "TopSolidInfill"; case erBridgeInfill: + case erInternalBridgeInfill: return "BridgeInfill"; case erThinWall: return "ThinWall"; diff --git a/src/libslic3r/GCode/PressureEqualizer.cpp b/src/libslic3r/GCode/PressureEqualizer.cpp index 3b2a58a88..4d945414c 100644 --- a/src/libslic3r/GCode/PressureEqualizer.cpp +++ b/src/libslic3r/GCode/PressureEqualizer.cpp @@ -62,6 +62,8 @@ void PressureEqualizer::reset() // Don't regulate the pressure in infill. m_max_volumetric_extrusion_rate_slopes[erBridgeInfill].negative = 0; m_max_volumetric_extrusion_rate_slopes[erBridgeInfill].positive = 0; + m_max_volumetric_extrusion_rate_slopes[erInternalBridgeInfill].negative = 0; + m_max_volumetric_extrusion_rate_slopes[erInternalBridgeInfill].positive = 0; // Don't regulate the pressure in gap fill. m_max_volumetric_extrusion_rate_slopes[erGapFill].negative = 0; m_max_volumetric_extrusion_rate_slopes[erGapFill].positive = 0; diff --git a/src/libslic3r/GCode/PreviewData.cpp b/src/libslic3r/GCode/PreviewData.cpp index eedd48c99..f38c28ecf 100644 --- a/src/libslic3r/GCode/PreviewData.cpp +++ b/src/libslic3r/GCode/PreviewData.cpp @@ -135,6 +135,7 @@ const Color GCodePreviewData::Extrusion::Default_Extrusion_Role_Colors[erCount] Color(1.0f, 0.0f, 1.0f, 1.0f), // erSolidInfill Color(0.0f, 1.0f, 1.0f, 1.0f), // erTopSolidInfill Color(0.5f, 0.5f, 0.5f, 1.0f), // erBridgeInfill + Color(0.4f, 0.4f, 0.4f, 1.0f), // erInternalBridgeInfill Color(0.0f, 1.0f, 0.4f, 1.0f), // erThinWall Color(1.0f, 1.0f, 1.0f, 1.0f), // erGapFill Color(0.5f, 0.0f, 0.0f, 1.0f), // erSkirt diff --git a/src/libslic3r/PrintConfig.cpp b/src/libslic3r/PrintConfig.cpp index a054e68b3..370712717 100644 --- a/src/libslic3r/PrintConfig.cpp +++ b/src/libslic3r/PrintConfig.cpp @@ -348,6 +348,17 @@ void PrintConfigDef::init_fff_params() def->min = 0; def->mode = comAdvanced; def->set_default_value(new ConfigOptionFloat(60)); + + def = this->add("bridge_speed_internal", coFloatOrPercent); + def->label = L("Internal bridges"); + def->full_label = L("Internal bridge speed"); + def->category = OptionCategory::speed; + def->tooltip = L("Speed for printing the bridges that support the top layer.\nCan be a % of the bridge speed."); + def->sidetext = L("mm/s"); + def->ratio_over = "bridge_speed"; + def->min = 0; + def->mode = comAdvanced; + def->set_default_value(new ConfigOptionFloatOrPercent(150,true)); def = this->add("brim_inside_holes", coBool); def->label = L("Brim inside holes"); @@ -2358,6 +2369,17 @@ void PrintConfigDef::init_fff_params() def->mode = comExpert; def->set_default_value(new ConfigOptionString("[input_filename_base].gcode")); + def = this->add("overhangs_speed", coFloatOrPercent); + def->label = L("Overhangs"); + def->full_label = L("Overhangs speed"); + def->category = OptionCategory::speed; + def->tooltip = L("Speed for printing overhangs.\nCan be a % of the bridge speed."); + def->sidetext = L("mm/s"); + def->ratio_over = "bridge_speed"; + def->min = 0; + def->mode = comAdvanced; + def->set_default_value(new ConfigOptionFloatOrPercent(20, false)); + def = this->add("overhangs_width_speed", coFloatOrPercent); def->label = L("'As bridge' speed threshold"); def->full_label = L("Overhang bridge speed threshold"); diff --git a/src/libslic3r/PrintConfig.hpp b/src/libslic3r/PrintConfig.hpp index 7655fe4f0..2644ec2f6 100644 --- a/src/libslic3r/PrintConfig.hpp +++ b/src/libslic3r/PrintConfig.hpp @@ -651,7 +651,8 @@ public: ConfigOptionPercent bridge_overlap; ConfigOptionEnum bottom_fill_pattern; ConfigOptionFloatOrPercent bridged_infill_margin; - ConfigOptionFloat bridge_speed; + ConfigOptionFloat bridge_speed; + ConfigOptionFloatOrPercent bridge_speed_internal; ConfigOptionFloat curve_smoothing_precision; ConfigOptionFloat curve_smoothing_cutoff_dist; ConfigOptionFloat curve_smoothing_angle_convex; @@ -697,6 +698,7 @@ public: ConfigOptionFloat milling_speed; ConfigOptionFloatOrPercent min_width_top_surface; // Detect bridging perimeters + ConfigOptionFloatOrPercent overhangs_speed; ConfigOptionFloatOrPercent overhangs_width; ConfigOptionFloatOrPercent overhangs_width_speed; ConfigOptionBool overhangs_reverse; @@ -747,6 +749,7 @@ protected: OPT_PTR(bottom_fill_pattern); OPT_PTR(bridged_infill_margin); OPT_PTR(bridge_speed); + OPT_PTR(bridge_speed_internal); OPT_PTR(curve_smoothing_precision); OPT_PTR(curve_smoothing_cutoff_dist); OPT_PTR(curve_smoothing_angle_convex); @@ -791,6 +794,7 @@ protected: OPT_PTR(milling_post_process); OPT_PTR(milling_speed); OPT_PTR(min_width_top_surface); + OPT_PTR(overhangs_speed); OPT_PTR(overhangs_width); OPT_PTR(overhangs_width_speed); OPT_PTR(overhangs_reverse); diff --git a/src/libslic3r/PrintObject.cpp b/src/libslic3r/PrintObject.cpp index eea125c22..c5ceb1d2c 100644 --- a/src/libslic3r/PrintObject.cpp +++ b/src/libslic3r/PrintObject.cpp @@ -744,10 +744,12 @@ bool PrintObject::invalidate_state_by_config_options(const std::vectoris_loop()); - if (ee->role() == erBridgeInfill) + if (ee->role() == erBridgeInfill || ee->role() == erInternalBridgeInfill) return true; } } diff --git a/src/slic3r/GUI/GUI_Preview.cpp b/src/slic3r/GUI/GUI_Preview.cpp index b0bd025e3..250a1a1e1 100644 --- a/src/slic3r/GUI/GUI_Preview.cpp +++ b/src/slic3r/GUI/GUI_Preview.cpp @@ -273,6 +273,7 @@ bool Preview::init(wxWindow* parent, Bed3D& bed, Camera& camera, GLToolbar& view _(L("Solid infill")) + "|" + _(L("Top solid infill")) + "|" + _(L("Bridge infill")) + "|" + + _(L("Internal Bridge infill")) + "|" + _(L("Thin wall")) + "|" + _(L("Gap fill")) + "|" + _(L("Skirt")) + "|" + @@ -331,6 +332,7 @@ bool Preview::init(wxWindow* parent, Bed3D& bed, Camera& camera, GLToolbar& view "Solid infill", "D732D7", "Top solid infill", "FF1A1A", "Bridge infill", "9999FF", + "Internal Bridge infill", "9999EE", "Thin wall", "FFB000", "Gap fill", "FFFFFF", "Skirt", "845321", diff --git a/src/slic3r/GUI/Preset.cpp b/src/slic3r/GUI/Preset.cpp index fe4da3f14..ef3e34bb0 100644 --- a/src/slic3r/GUI/Preset.cpp +++ b/src/slic3r/GUI/Preset.cpp @@ -440,6 +440,7 @@ const std::vector& Preset::print_options() "avoid_crossing_not_first_layer", "thin_perimeters", "thin_perimeters_all", "thin_walls", + "overhangs_speed", "overhangs_width", "overhangs_width_speed", "overhangs_reverse", @@ -475,6 +476,7 @@ const std::vector& Preset::print_options() "external_perimeter_speed", "infill_speed", "solid_infill_speed", "top_solid_infill_speed", "support_material_speed", "support_material_xy_spacing", "support_material_interface_speed", "bridge_speed", + "bridge_speed_internal", "gap_fill", "gap_fill_min_area", "gap_fill_overlap",