#414 #591 overhang speed separate from bridge speed

And separate speed for "inner bridge" (the ones over sparse infill)
This commit is contained in:
supermerill 2020-11-05 19:08:46 +01:00
parent f7bf94840a
commit 27196d34ea
16 changed files with 94 additions and 11 deletions

View File

@ -5,6 +5,7 @@ Internal infill = B1302A
Solid infill = D732D7 Solid infill = D732D7
Top solid infill = FF1A1A Top solid infill = FF1A1A
Bridge infill = 9999FF Bridge infill = 9999FF
Internal Bridge infill = AAAADD
Thin wall = FFB000 Thin wall = FFB000
Gap fill = FFFFFF Gap fill = FFFFFF
Skirt = 845321 Skirt = 845321

View File

@ -206,7 +206,9 @@ group:label_width$8:Speed for print moves
setting:width$4:support_material_interface_speed setting:width$4:support_material_interface_speed
end_line end_line
line:Bridge speed 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 end_line
line:Thin extrusions speed line:Thin extrusions speed
setting:width$4:gap_fill_speed setting:width$4:gap_fill_speed

View File

@ -274,6 +274,7 @@ std::string ExtrusionEntity::role_to_string(ExtrusionRole role)
case erInternalInfill : return L("Internal infill"); case erInternalInfill : return L("Internal infill");
case erSolidInfill : return L("Solid infill"); case erSolidInfill : return L("Solid infill");
case erTopSolidInfill : return L("Top solid infill"); case erTopSolidInfill : return L("Top solid infill");
case erInternalBridgeInfill : return L("Internal Bridge infill");
case erBridgeInfill : return L("Bridge infill"); case erBridgeInfill : return L("Bridge infill");
case erThinWall : return L("Thin wall"); case erThinWall : return L("Thin wall");
case erGapFill : return L("Gap fill"); case erGapFill : return L("Gap fill");

View File

@ -14,6 +14,41 @@ class ExtrusionEntityCollection;
class Extruder; class Extruder;
// Each ExtrusionRole value identifies a distinct set of { extruder, speed } // 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 { enum ExtrusionRole : uint8_t {
erNone, erNone,
erPerimeter, erPerimeter,
@ -23,6 +58,7 @@ enum ExtrusionRole : uint8_t {
erSolidInfill, erSolidInfill,
erTopSolidInfill, erTopSolidInfill,
erBridgeInfill, erBridgeInfill,
erInternalBridgeInfill,
erThinWall, erThinWall,
erGapFill, erGapFill,
erSkirt, erSkirt,
@ -35,6 +71,7 @@ enum ExtrusionRole : uint8_t {
erMixed, erMixed,
erCount erCount
}; };
// perimeter / infill / support / skirt / gapfill / wipetower / custom / mixed // perimeter / infill / support / skirt / gapfill / wipetower / custom / mixed
// side / internal / top / bottom // side / internal / top / bottom
// bridge // bridge

View File

@ -604,7 +604,7 @@ Fill::do_gap_fill(const ExPolygons &gapfill_areas, const FillParams &params, Ext
MedialAxis{ ex, params.flow->scaled_width() * 2, params.flow->scaled_width() / 5, coord_t(params.flow->height) }.build(polylines_gapfill); 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 //test
#ifdef _DEBUG #ifdef _DEBUG
for (ThickPolyline poly : polylines_gapfill) { for (ThickPolyline poly : polylines_gapfill) {

View File

@ -147,7 +147,7 @@ protected:
ExtrusionRole getRoleFromSurfaceType(const FillParams &params, const Surface *surface) const { ExtrusionRole getRoleFromSurfaceType(const FillParams &params, const Surface *surface) const {
if (params.role == erNone || params.role == erCustom) { if (params.role == erNone || params.role == erCustom) {
return params.flow->bridge ? return params.flow->bridge ?
erBridgeInfill : (surface->has_pos_bottom() ? erBridgeInfill :erInternalBridgeInfill) :
(surface->has_fill_solid() ? (surface->has_fill_solid() ?
((surface->has_pos_top()) ? erTopSolidInfill : erSolidInfill) : ((surface->has_pos_top()) ? erTopSolidInfill : erSolidInfill) :
erInternalInfill); erInternalInfill);

View File

@ -153,7 +153,7 @@ FillConcentricWGapFill::fill_surface_extrusion(
MedialAxis{ ex, coord_t(max), coord_t(min), coord_t(params.flow->height) }.build(polylines); 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); ExtrusionEntityCollection gap_fill = thin_variable_width(polylines, erGapFill, *params.flow);
//set role if needed //set role if needed
if (good_role != erSolidInfill) { if (good_role != erSolidInfill) {

View File

@ -954,12 +954,13 @@ namespace DoExport {
if (region->config().get_abs_value("perimeter_speed") == 0 || if (region->config().get_abs_value("perimeter_speed") == 0 ||
region->config().get_abs_value("small_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("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()); mm3_per_mm.push_back(layerm->perimeters.min_mm3_per_mm());
if (region->config().get_abs_value("infill_speed") == 0 || if (region->config().get_abs_value("infill_speed") == 0 ||
region->config().get_abs_value("solid_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("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()); 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 erInternalInfill: return "infill internal";
case erSolidInfill: return "infill solid"; case erSolidInfill: return "infill solid";
case erTopSolidInfill: return "infill solid top"; case erTopSolidInfill: return "infill solid top";
case erInternalBridgeInfill:
case erBridgeInfill: return "infill bridge"; case erBridgeInfill: return "infill bridge";
case erThinWall: return "thin_wall"; case erThinWall: return "thin_wall";
case erGapFill: return "gap_fill"; 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"); speed = m_config.get_abs_value("perimeter_speed");
} else if (path.role() == erExternalPerimeter) { } else if (path.role() == erExternalPerimeter) {
speed = m_config.get_abs_value("external_perimeter_speed"); speed = m_config.get_abs_value("external_perimeter_speed");
} else if (path.role() == erOverhangPerimeter || path.role() == erBridgeInfill) { } else if (path.role() == erBridgeInfill) {
speed = m_config.get_abs_value("bridge_speed"); 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) { } else if (path.role() == erInternalInfill) {
speed = m_config.get_abs_value("infill_speed"); speed = m_config.get_abs_value("infill_speed");
} else if (path.role() == erSolidInfill) { } 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"); throw std::invalid_argument("Invalid speed");
} }
//don't modify bridge 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); float small_speed = m_config.small_perimeter_speed.get_abs_value(m_config.perimeter_speed);
//apply factor between feature speed and small speed //apply factor between feature speed and small speed
speed = speed * factor + (1 - factor) * 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: case erTopSolidInfill:
return "TopSolidInfill"; return "TopSolidInfill";
case erBridgeInfill: case erBridgeInfill:
case erInternalBridgeInfill:
return "BridgeInfill"; return "BridgeInfill";
case erThinWall: case erThinWall:
return "ThinWall"; return "ThinWall";

View File

@ -62,6 +62,8 @@ void PressureEqualizer::reset()
// Don't regulate the pressure in infill. // Don't regulate the pressure in infill.
m_max_volumetric_extrusion_rate_slopes[erBridgeInfill].negative = 0; m_max_volumetric_extrusion_rate_slopes[erBridgeInfill].negative = 0;
m_max_volumetric_extrusion_rate_slopes[erBridgeInfill].positive = 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. // Don't regulate the pressure in gap fill.
m_max_volumetric_extrusion_rate_slopes[erGapFill].negative = 0; m_max_volumetric_extrusion_rate_slopes[erGapFill].negative = 0;
m_max_volumetric_extrusion_rate_slopes[erGapFill].positive = 0; m_max_volumetric_extrusion_rate_slopes[erGapFill].positive = 0;

View File

@ -135,6 +135,7 @@ const Color GCodePreviewData::Extrusion::Default_Extrusion_Role_Colors[erCount]
Color(1.0f, 0.0f, 1.0f, 1.0f), // erSolidInfill Color(1.0f, 0.0f, 1.0f, 1.0f), // erSolidInfill
Color(0.0f, 1.0f, 1.0f, 1.0f), // erTopSolidInfill Color(0.0f, 1.0f, 1.0f, 1.0f), // erTopSolidInfill
Color(0.5f, 0.5f, 0.5f, 1.0f), // erBridgeInfill 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(0.0f, 1.0f, 0.4f, 1.0f), // erThinWall
Color(1.0f, 1.0f, 1.0f, 1.0f), // erGapFill Color(1.0f, 1.0f, 1.0f, 1.0f), // erGapFill
Color(0.5f, 0.0f, 0.0f, 1.0f), // erSkirt Color(0.5f, 0.0f, 0.0f, 1.0f), // erSkirt

View File

@ -349,6 +349,17 @@ void PrintConfigDef::init_fff_params()
def->mode = comAdvanced; def->mode = comAdvanced;
def->set_default_value(new ConfigOptionFloat(60)); 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 = this->add("brim_inside_holes", coBool);
def->label = L("Brim inside holes"); def->label = L("Brim inside holes");
def->full_label = L("Brim inside holes"); def->full_label = L("Brim inside holes");
@ -2358,6 +2369,17 @@ void PrintConfigDef::init_fff_params()
def->mode = comExpert; def->mode = comExpert;
def->set_default_value(new ConfigOptionString("[input_filename_base].gcode")); 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 = this->add("overhangs_width_speed", coFloatOrPercent);
def->label = L("'As bridge' speed threshold"); def->label = L("'As bridge' speed threshold");
def->full_label = L("Overhang bridge speed threshold"); def->full_label = L("Overhang bridge speed threshold");

View File

@ -652,6 +652,7 @@ public:
ConfigOptionEnum<InfillPattern> bottom_fill_pattern; ConfigOptionEnum<InfillPattern> bottom_fill_pattern;
ConfigOptionFloatOrPercent bridged_infill_margin; ConfigOptionFloatOrPercent bridged_infill_margin;
ConfigOptionFloat bridge_speed; ConfigOptionFloat bridge_speed;
ConfigOptionFloatOrPercent bridge_speed_internal;
ConfigOptionFloat curve_smoothing_precision; ConfigOptionFloat curve_smoothing_precision;
ConfigOptionFloat curve_smoothing_cutoff_dist; ConfigOptionFloat curve_smoothing_cutoff_dist;
ConfigOptionFloat curve_smoothing_angle_convex; ConfigOptionFloat curve_smoothing_angle_convex;
@ -697,6 +698,7 @@ public:
ConfigOptionFloat milling_speed; ConfigOptionFloat milling_speed;
ConfigOptionFloatOrPercent min_width_top_surface; ConfigOptionFloatOrPercent min_width_top_surface;
// Detect bridging perimeters // Detect bridging perimeters
ConfigOptionFloatOrPercent overhangs_speed;
ConfigOptionFloatOrPercent overhangs_width; ConfigOptionFloatOrPercent overhangs_width;
ConfigOptionFloatOrPercent overhangs_width_speed; ConfigOptionFloatOrPercent overhangs_width_speed;
ConfigOptionBool overhangs_reverse; ConfigOptionBool overhangs_reverse;
@ -747,6 +749,7 @@ protected:
OPT_PTR(bottom_fill_pattern); OPT_PTR(bottom_fill_pattern);
OPT_PTR(bridged_infill_margin); OPT_PTR(bridged_infill_margin);
OPT_PTR(bridge_speed); OPT_PTR(bridge_speed);
OPT_PTR(bridge_speed_internal);
OPT_PTR(curve_smoothing_precision); OPT_PTR(curve_smoothing_precision);
OPT_PTR(curve_smoothing_cutoff_dist); OPT_PTR(curve_smoothing_cutoff_dist);
OPT_PTR(curve_smoothing_angle_convex); OPT_PTR(curve_smoothing_angle_convex);
@ -791,6 +794,7 @@ protected:
OPT_PTR(milling_post_process); OPT_PTR(milling_post_process);
OPT_PTR(milling_speed); OPT_PTR(milling_speed);
OPT_PTR(min_width_top_surface); OPT_PTR(min_width_top_surface);
OPT_PTR(overhangs_speed);
OPT_PTR(overhangs_width); OPT_PTR(overhangs_width);
OPT_PTR(overhangs_width_speed); OPT_PTR(overhangs_width_speed);
OPT_PTR(overhangs_reverse); OPT_PTR(overhangs_reverse);

View File

@ -744,10 +744,12 @@ bool PrintObject::invalidate_state_by_config_options(const std::vector<t_config_
//} //}
} else if ( } else if (
opt_key == "bridge_speed" opt_key == "bridge_speed"
|| opt_key == "bridge_speed_internal"
|| opt_key == "external_perimeter_speed" || opt_key == "external_perimeter_speed"
|| opt_key == "external_perimeters_vase" || opt_key == "external_perimeters_vase"
|| opt_key == "gap_fill_speed" || opt_key == "gap_fill_speed"
|| opt_key == "infill_speed" || opt_key == "infill_speed"
|| opt_key == "overhangs_speed"
|| opt_key == "perimeter_speed" || opt_key == "perimeter_speed"
|| opt_key == "seam_position" || opt_key == "seam_position"
|| opt_key == "seam_preferred_direction" || opt_key == "seam_preferred_direction"

View File

@ -808,7 +808,7 @@ namespace SupportMaterialInternal {
return true; return true;
} else { } else {
assert(! ee->is_loop()); assert(! ee->is_loop());
if (ee->role() == erBridgeInfill) if (ee->role() == erBridgeInfill || ee->role() == erInternalBridgeInfill)
return true; return true;
} }
} }

View File

@ -273,6 +273,7 @@ bool Preview::init(wxWindow* parent, Bed3D& bed, Camera& camera, GLToolbar& view
_(L("Solid infill")) + "|" + _(L("Solid infill")) + "|" +
_(L("Top solid infill")) + "|" + _(L("Top solid infill")) + "|" +
_(L("Bridge infill")) + "|" + _(L("Bridge infill")) + "|" +
_(L("Internal Bridge infill")) + "|" +
_(L("Thin wall")) + "|" + _(L("Thin wall")) + "|" +
_(L("Gap fill")) + "|" + _(L("Gap fill")) + "|" +
_(L("Skirt")) + "|" + _(L("Skirt")) + "|" +
@ -331,6 +332,7 @@ bool Preview::init(wxWindow* parent, Bed3D& bed, Camera& camera, GLToolbar& view
"Solid infill", "D732D7", "Solid infill", "D732D7",
"Top solid infill", "FF1A1A", "Top solid infill", "FF1A1A",
"Bridge infill", "9999FF", "Bridge infill", "9999FF",
"Internal Bridge infill", "9999EE",
"Thin wall", "FFB000", "Thin wall", "FFB000",
"Gap fill", "FFFFFF", "Gap fill", "FFFFFF",
"Skirt", "845321", "Skirt", "845321",

View File

@ -440,6 +440,7 @@ const std::vector<std::string>& Preset::print_options()
"avoid_crossing_not_first_layer", "avoid_crossing_not_first_layer",
"thin_perimeters", "thin_perimeters_all", "thin_perimeters", "thin_perimeters_all",
"thin_walls", "thin_walls",
"overhangs_speed",
"overhangs_width", "overhangs_width",
"overhangs_width_speed", "overhangs_width_speed",
"overhangs_reverse", "overhangs_reverse",
@ -475,6 +476,7 @@ const std::vector<std::string>& Preset::print_options()
"external_perimeter_speed", "infill_speed", "solid_infill_speed", "external_perimeter_speed", "infill_speed", "solid_infill_speed",
"top_solid_infill_speed", "support_material_speed", "support_material_xy_spacing", "support_material_interface_speed", "top_solid_infill_speed", "support_material_speed", "support_material_xy_spacing", "support_material_interface_speed",
"bridge_speed", "bridge_speed",
"bridge_speed_internal",
"gap_fill", "gap_fill",
"gap_fill_min_area", "gap_fill_min_area",
"gap_fill_overlap", "gap_fill_overlap",